From bab85abe6641c36bc23b955015fe411f9e2ddd3d Mon Sep 17 00:00:00 2001 From: Aleksandr Veselov Date: Thu, 14 Nov 2024 12:10:13 +0000 Subject: [PATCH 01/53] !953 Fix C++ interop file generation for XML --- demos/xml/generated/DeserializerBase.h | 17 +- demos/xml/generated/callbacks.h | 39 -- demos/xml/generated/xml.cc | 354 +++++++----------- demos/xml/generated/xml.h | 114 +++--- src/peer-generation/OhosGenerator.ts | 51 ++- .../printers/BridgeCcPrinter.ts | 127 ++++++- .../printers/CallbacksPrinter.ts | 5 +- templates/c++/api_impl_epilogue.cc | 90 ++++- templates/c++/api_impl_prologue.cc | 19 +- templates/c++/ohos_DeserializerBase.h | 30 +- templates/c++/ohos_SerializerBase.h | 35 +- templates/c++/ohos_api_prologue.h | 8 +- 12 files changed, 484 insertions(+), 405 deletions(-) delete mode 100644 demos/xml/generated/callbacks.h diff --git a/demos/xml/generated/DeserializerBase.h b/demos/xml/generated/DeserializerBase.h index 6d6e9d35..f821fafc 100644 --- a/demos/xml/generated/DeserializerBase.h +++ b/demos/xml/generated/DeserializerBase.h @@ -12,13 +12,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include "xml.h" +#include #include #include #include #include -#include "xml.h" + // callbacks.h @@ -192,18 +193,6 @@ inline void WriteToString(std::string *result, const OH_Undefined *value) result->append("{}"); } -template <> -inline void WriteToString(std::string *result, OH_Void value) -{ - result->append("{}"); -} - -template <> -inline void WriteToString(std::string *result, const OH_Void *value) -{ - result->append("{}"); -} - template <> inline void WriteToString(std::string *result, const OH_CustomObject *value) { diff --git a/demos/xml/generated/callbacks.h b/demos/xml/generated/callbacks.h deleted file mode 100644 index c7c73c45..00000000 --- a/demos/xml/generated/callbacks.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2024 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. - */ - -#ifndef _ARKOALA_CALLBACKS_H -#define _ARKOALA_CALLBACKS_H - -#include -#include -#include "koala-types.h" -#include "xml.h" -#include "callback_kind.h" -#include "callback_resource_holder.h" - -struct CallbackBuffer { - CallbackKind kind; - uint8_t buffer[60 * 4]; - CallbackResourceHolder resourceHolder; -}; -void enqueueArkoalaCallback(const CallbackBuffer* event); - -Ark_NativePointer getManagedCallbackCaller(CallbackKind kind); -void holdManagedCallbackResource(Ark_Int32 resourceId); -void releaseManagedCallbackResource(Ark_Int32 resourceId); - -void deserializeAndCallCallback(KInt kind, KByte* args, KInt argsSize); - -#endif \ No newline at end of file diff --git a/demos/xml/generated/xml.cc b/demos/xml/generated/xml.cc index 4256f168..2abaeb81 100644 --- a/demos/xml/generated/xml.cc +++ b/demos/xml/generated/xml.cc @@ -13,21 +13,22 @@ * limitations under the License. */ -#include "SerializerBase.h" -#include "DeserializerBase.h" #include "xml.h" + #include "common-interop.h" -#include +#include "SerializerBase.h" +#include "DeserializerBase.h" #include + #include "parser_impl.h" CustomDeserializer * DeserializerBase::customDeserializers = nullptr; typedef enum CallbackKind { - Kind_Callback_Boolean_Void = 0, + Kind_Callback_Boolean_void = 0, Kind_Callback_EventType_ParseInfo_Boolean = 1, Kind_Callback_String_String_Boolean = 2, - Kind_Callback_Void = 3, + Kind_Callback_void = 3, } CallbackKind; struct CallbackBuffer { @@ -90,12 +91,12 @@ inline OH_RuntimeType runtimeType(const Opt_Number& value) return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); } template <> -inline OH_RuntimeType runtimeType(const OH_Callback_EventType_ParseInfo_Boolean& value) +inline OH_RuntimeType runtimeType(const Callback_EventType_ParseInfo_Boolean& value) { return OH_RUNTIME_OBJECT; } template <> -inline void WriteToString(std::string* result, const OH_Callback_EventType_ParseInfo_Boolean* value) { +inline void WriteToString(std::string* result, const Callback_EventType_ParseInfo_Boolean* value) { result->append("{"); result->append(".resource="); WriteToString(result, &value->resource); @@ -121,12 +122,12 @@ inline OH_RuntimeType runtimeType(const Opt_Callback_EventType_ParseInfo_Boolean return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); } template <> -inline OH_RuntimeType runtimeType(const OH_Callback_String_String_Boolean& value) +inline OH_RuntimeType runtimeType(const Callback_String_String_Boolean& value) { return OH_RUNTIME_OBJECT; } template <> -inline void WriteToString(std::string* result, const OH_Callback_String_String_Boolean* value) { +inline void WriteToString(std::string* result, const Callback_String_String_Boolean* value) { result->append("{"); result->append(".resource="); WriteToString(result, &value->resource); @@ -224,12 +225,12 @@ inline OH_RuntimeType runtimeType(const Opt_ArrayBuffer& value) return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); } template <> -inline OH_RuntimeType runtimeType(const OH_Callback_Void& value) +inline OH_RuntimeType runtimeType(const Callback_void& value) { return OH_RUNTIME_OBJECT; } template <> -inline void WriteToString(std::string* result, const OH_Callback_Void* value) { +inline void WriteToString(std::string* result, const Callback_void* value) { result->append("{"); result->append(".resource="); WriteToString(result, &value->resource); @@ -237,7 +238,7 @@ inline void WriteToString(std::string* result, const OH_Callback_Void* value) { result->append("}"); } template <> -inline void WriteToString(std::string* result, const Opt_Callback_Void* value) { +inline void WriteToString(std::string* result, const Opt_Callback_void* value) { result->append("{.tag="); result->append(tagNameExact((OH_Tag)(value->tag))); result->append(", .value="); @@ -250,17 +251,17 @@ inline void WriteToString(std::string* result, const Opt_Callback_Void* value) { result->append("}"); } template <> -inline OH_RuntimeType runtimeType(const Opt_Callback_Void& value) +inline OH_RuntimeType runtimeType(const Opt_Callback_void& value) { return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); } template <> -inline OH_RuntimeType runtimeType(const OH_Callback_Boolean_Void& value) +inline OH_RuntimeType runtimeType(const Callback_Boolean_void& value) { return OH_RUNTIME_OBJECT; } template <> -inline void WriteToString(std::string* result, const OH_Callback_Boolean_Void* value) { +inline void WriteToString(std::string* result, const Callback_Boolean_void* value) { result->append("{"); result->append(".resource="); WriteToString(result, &value->resource); @@ -268,7 +269,7 @@ inline void WriteToString(std::string* result, const OH_Callback_Boolean_Void* v result->append("}"); } template <> -inline void WriteToString(std::string* result, const Opt_Callback_Boolean_Void* value) { +inline void WriteToString(std::string* result, const Opt_Callback_Boolean_void* value) { result->append("{.tag="); result->append(tagNameExact((OH_Tag)(value->tag))); result->append(", .value="); @@ -281,30 +282,7 @@ inline void WriteToString(std::string* result, const Opt_Callback_Boolean_Void* result->append("}"); } template <> -inline OH_RuntimeType runtimeType(const Opt_Callback_Boolean_Void& value) -{ - return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); -} -template <> -inline OH_RuntimeType runtimeType(const OH_Void& value) -{ - return OH_RUNTIME_OBJECT; -} -template <> -inline void WriteToString(std::string* result, const Opt_Void* value) { - result->append("{.tag="); - result->append(tagNameExact((OH_Tag)(value->tag))); - result->append(", .value="); - if (value->tag != OH_TAG_UNDEFINED) { - WriteToString(result, value->value); - } else { - OH_Undefined undefined = { 0 }; - WriteToString(result, undefined); - } - result->append("}"); -} -template <> -inline OH_RuntimeType runtimeType(const Opt_Void& value) +inline OH_RuntimeType runtimeType(const Opt_Callback_Boolean_void& value) { return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); } @@ -356,12 +334,12 @@ inline OH_RuntimeType runtimeType(const Opt_xml_EventType& value) return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); } template <> -inline OH_RuntimeType runtimeType(const OH_XML_ParseOptions& value) +inline OH_RuntimeType runtimeType(const OH_ParseOptions& value) { return OH_RUNTIME_OBJECT; } template <> -inline void WriteToString(std::string* result, const OH_XML_ParseOptions* value) { +inline void WriteToString(std::string* result, const OH_ParseOptions* value) { result->append("{"); // OH_Boolean supportDoctype result->append(".supportDoctype="); @@ -370,15 +348,15 @@ inline void WriteToString(std::string* result, const OH_XML_ParseOptions* value) result->append(", "); result->append(".ignoreNameSpace="); WriteToString(result, &value->ignoreNameSpace); - // OH_Callback_String_String_Boolean tagValueCallbackFunction + // Callback_String_String_Boolean tagValueCallbackFunction result->append(", "); result->append(".tagValueCallbackFunction="); WriteToString(result, &value->tagValueCallbackFunction); - // OH_Callback_String_String_Boolean attributeValueCallbackFunction + // Callback_String_String_Boolean attributeValueCallbackFunction result->append(", "); result->append(".attributeValueCallbackFunction="); WriteToString(result, &value->attributeValueCallbackFunction); - // OH_Callback_EventType_ParseInfo_Boolean tokenValueCallbackFunction + // Callback_EventType_ParseInfo_Boolean tokenValueCallbackFunction result->append(", "); result->append(".tokenValueCallbackFunction="); WriteToString(result, &value->tokenValueCallbackFunction); @@ -403,6 +381,29 @@ inline OH_RuntimeType runtimeType(const Opt_ParseOptions& value) return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); } template <> +inline OH_RuntimeType runtimeType(const OH_String& value) +{ + return OH_RUNTIME_STRING; +} +template <> +inline void WriteToString(std::string* result, const Opt_String* value) { + result->append("{.tag="); + result->append(tagNameExact((OH_Tag)(value->tag))); + result->append(", .value="); + if (value->tag != OH_TAG_UNDEFINED) { + WriteToString(result, &value->value); + } else { + OH_Undefined undefined = { 0 }; + WriteToString(result, undefined); + } + result->append("}"); +} +template <> +inline OH_RuntimeType runtimeType(const Opt_String& value) +{ + return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); +} +template <> inline OH_RuntimeType runtimeType(const OH_Union_ArrayBuffer_DataView& value) { switch (value.selector) { @@ -417,7 +418,7 @@ inline void WriteToString(std::string* result, const OH_Union_ArrayBuffer_DataVi result->append(".selector="); result->append(std::to_string(value->selector)); result->append(", "); - // OH_XML_ArrayBuffer + // OH_ArrayBuffer if (value->selector == 0) { result->append(".value0="); WriteToString(result, &value->value0); @@ -447,46 +448,22 @@ inline OH_RuntimeType runtimeType(const Opt_Union_ArrayBuffer_DataView& value) { return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); } -template <> -inline OH_RuntimeType runtimeType(const OH_String& value) -{ - return OH_RUNTIME_STRING; -} -template <> -inline void WriteToString(std::string* result, const Opt_String* value) { - result->append("{.tag="); - result->append(tagNameExact((OH_Tag)(value->tag))); - result->append(", .value="); - if (value->tag != OH_TAG_UNDEFINED) { - WriteToString(result, &value->value); - } else { - OH_Undefined undefined = { 0 }; - WriteToString(result, undefined); - } - result->append("}"); -} -template <> -inline OH_RuntimeType runtimeType(const Opt_String& value) -{ - return (value.tag != OH_TAG_UNDEFINED) ? (OH_RUNTIME_OBJECT) : (OH_RUNTIME_UNDEFINED); -} - class Serializer : public SerializerBase { public: Serializer(uint8_t* data, CallbackResourceHolder* resourceHolder = nullptr) : SerializerBase(data, resourceHolder) { } - void writeArrayBuffer(const OH_ArrayBuffer& value) + void writeArrayBuffer(OH_ArrayBuffer value) { Serializer& valueSerializer = *this; const auto value_byteLength = value.byteLength; valueSerializer.writeNumber(value_byteLength); } - void writeParseInfo(const OH_XML_ParseInfo& value) + void writeParseInfo(OH_ParseInfo value) { Serializer& valueSerializer = *this; valueSerializer.writePointer(value.ptr); } - void writeParseOptions(const OH_XML_ParseOptions& value) + void writeParseOptions(OH_ParseOptions value) { Serializer& valueSerializer = *this; const auto value_supportDoctype = value.supportDoctype; @@ -537,7 +514,7 @@ class Serializer : public SerializerBase { class Deserializer : public DeserializerBase { public: - Deserializer(uint8_t* data, const OH_Int32& length) : DeserializerBase(data, length) { + Deserializer(uint8_t* data, OH_Int32 length) : DeserializerBase(data, length) { } OH_ArrayBuffer readArrayBuffer() { @@ -546,15 +523,15 @@ class Deserializer : public DeserializerBase { value.byteLength = static_cast(valueDeserializer.readNumber()); return static_cast(value); } - OH_XML_ParseInfo readParseInfo() + OH_ParseInfo readParseInfo() { Deserializer& valueDeserializer = *this; void* ptr = valueDeserializer.readPointer(); return { .ptr = ptr }; } - OH_XML_ParseOptions readParseOptions() + OH_ParseOptions readParseOptions() { - OH_XML_ParseOptions value = {}; + OH_ParseOptions value = {}; Deserializer& valueDeserializer = *this; const auto supportDoctype_buf_runtimeType = static_cast(valueDeserializer.readInt8()); Opt_Boolean supportDoctype_buf = {}; @@ -577,7 +554,7 @@ class Deserializer : public DeserializerBase { tagValueCallbackFunction_buf.tag = tagValueCallbackFunction_buf_runtimeType == OH_RUNTIME_UNDEFINED ? OH_TAG_UNDEFINED : OH_TAG_OBJECT; if ((OH_RUNTIME_UNDEFINED) != (tagValueCallbackFunction_buf_runtimeType)) { - tagValueCallbackFunction_buf.value = {valueDeserializer.readCallbackResource(), reinterpret_cast(valueDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_String_String_Boolean))))}; + tagValueCallbackFunction_buf.value = {valueDeserializer.readCallbackResource(), reinterpret_cast(valueDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_String_String_Boolean))))}; } value.tagValueCallbackFunction = tagValueCallbackFunction_buf; const auto attributeValueCallbackFunction_buf_runtimeType = static_cast(valueDeserializer.readInt8()); @@ -585,7 +562,7 @@ class Deserializer : public DeserializerBase { attributeValueCallbackFunction_buf.tag = attributeValueCallbackFunction_buf_runtimeType == OH_RUNTIME_UNDEFINED ? OH_TAG_UNDEFINED : OH_TAG_OBJECT; if ((OH_RUNTIME_UNDEFINED) != (attributeValueCallbackFunction_buf_runtimeType)) { - attributeValueCallbackFunction_buf.value = {valueDeserializer.readCallbackResource(), reinterpret_cast(valueDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_String_String_Boolean))))}; + attributeValueCallbackFunction_buf.value = {valueDeserializer.readCallbackResource(), reinterpret_cast(valueDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_String_String_Boolean))))}; } value.attributeValueCallbackFunction = attributeValueCallbackFunction_buf; const auto tokenValueCallbackFunction_buf_runtimeType = static_cast(valueDeserializer.readInt8()); @@ -593,54 +570,44 @@ class Deserializer : public DeserializerBase { tokenValueCallbackFunction_buf.tag = tokenValueCallbackFunction_buf_runtimeType == OH_RUNTIME_UNDEFINED ? OH_TAG_UNDEFINED : OH_TAG_OBJECT; if ((OH_RUNTIME_UNDEFINED) != (tokenValueCallbackFunction_buf_runtimeType)) { - tokenValueCallbackFunction_buf.value = {valueDeserializer.readCallbackResource(), reinterpret_cast(valueDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_EventType_ParseInfo_Boolean))))}; + tokenValueCallbackFunction_buf.value = {valueDeserializer.readCallbackResource(), reinterpret_cast(valueDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_EventType_ParseInfo_Boolean))))}; } value.tokenValueCallbackFunction = tokenValueCallbackFunction_buf; - return static_cast(value); + return static_cast(value); } }; -OH_XML_XmlSerializerHandle XmlSerializer_constructImpl(const OH_Union_ArrayBuffer_DataView* buffer, const OH_String* encoding) { +OH_XML_XmlSerializerHandle XmlSerializer_constructImpl(const OH_Union_ArrayBuffer_DataView* buffer, const Opt_String* encoding) { return {}; } void XmlSerializer_destructImpl(OH_XML_XmlSerializerHandle thiz) { } -OH_Void XmlSerializer_setAttributesImpl(OH_NativePointer thisPtr, const OH_String* name, const OH_String* value) { - return {}; +void XmlSerializer_setAttributesImpl(OH_NativePointer thisPtr, const OH_String* name, const OH_String* value) { } -OH_Void XmlSerializer_addEmptyElementImpl(OH_NativePointer thisPtr, const OH_String* name) { - return {}; +void XmlSerializer_addEmptyElementImpl(OH_NativePointer thisPtr, const OH_String* name) { } -OH_Void XmlSerializer_setDeclarationImpl(OH_NativePointer thisPtr) { - return {}; +void XmlSerializer_setDeclarationImpl(OH_NativePointer thisPtr) { } -OH_Void XmlSerializer_startElementImpl(OH_NativePointer thisPtr, const OH_String* name) { - return {}; +void XmlSerializer_startElementImpl(OH_NativePointer thisPtr, const OH_String* name) { } -OH_Void XmlSerializer_endElementImpl(OH_NativePointer thisPtr) { - return {}; +void XmlSerializer_endElementImpl(OH_NativePointer thisPtr) { } -OH_Void XmlSerializer_setNamespaceImpl(OH_NativePointer thisPtr, const OH_String* prefix, const OH_String* namespace_) { - return {}; +void XmlSerializer_setNamespaceImpl(OH_NativePointer thisPtr, const OH_String* prefix, const OH_String* namespace_) { } -OH_Void XmlSerializer_setCommentImpl(OH_NativePointer thisPtr, const OH_String* text) { - return {}; +void XmlSerializer_setCommentImpl(OH_NativePointer thisPtr, const OH_String* text) { } -OH_Void XmlSerializer_setCDATAImpl(OH_NativePointer thisPtr, const OH_String* text) { - return {}; +void XmlSerializer_setCDATAImpl(OH_NativePointer thisPtr, const OH_String* text) { } -OH_Void XmlSerializer_setTextImpl(OH_NativePointer thisPtr, const OH_String* text) { - return {}; +void XmlSerializer_setTextImpl(OH_NativePointer thisPtr, const OH_String* text) { } -OH_Void XmlSerializer_setDocTypeImpl(OH_NativePointer thisPtr, const OH_String* text) { - return {}; +void XmlSerializer_setDocTypeImpl(OH_NativePointer thisPtr, const OH_String* text) { } -OH_Int32 ParseInfo_getColumnNumberImpl(OH_NativePointer thisPtr) { +OH_Number ParseInfo_getColumnNumberImpl(OH_NativePointer thisPtr) { return {}; } -OH_Int32 ParseInfo_getDepthImpl(OH_NativePointer thisPtr) { +OH_Number ParseInfo_getDepthImpl(OH_NativePointer thisPtr) { return {}; } -OH_Int32 ParseInfo_getLineNumberImpl(OH_NativePointer thisPtr) { +OH_Number ParseInfo_getLineNumberImpl(OH_NativePointer thisPtr) { return {}; } OH_String ParseInfo_getNameImpl(OH_NativePointer thisPtr) { @@ -661,10 +628,10 @@ OH_Boolean ParseInfo_isEmptyElementTagImpl(OH_NativePointer thisPtr) { OH_Boolean ParseInfo_isWhitespaceImpl(OH_NativePointer thisPtr) { return {}; } -OH_Int32 ParseInfo_getAttributeCountImpl(OH_NativePointer thisPtr) { +OH_Number ParseInfo_getAttributeCountImpl(OH_NativePointer thisPtr) { return {}; } -OH_XML_XmlPullParserHandle XmlPullParser_constructImpl(const OH_String* buffer, const OH_String* encoding) { +OH_XML_XmlPullParserHandle XmlPullParser_constructImpl(const OH_String* buffer, const Opt_String* encoding) { const ExpatParser* parser = new ExpatParser(*buffer); return (OH_XML_XmlPullParserHandle) parser; } @@ -677,7 +644,7 @@ void temp_hold(int resId) {} void temp_release(int resId) {} void temp_call(const OH_Int32 resourceId, const OH_Boolean value) {} -OH_Void XmlPullParser_parseImpl(OH_NativePointer thisPtr, const OH_XML_ParseOptions* option) { +void XmlPullParser_parseImpl(OH_NativePointer thisPtr, const OH_ParseOptions* option) { ExpatParser* parser = (ExpatParser*) thisPtr; if (option->tagValueCallbackFunction.tag != OH_TAG_UNDEFINED) { parser->setTagValueCallback([&](const char* name, const char* value) { @@ -708,7 +675,6 @@ OH_Void XmlPullParser_parseImpl(OH_NativePointer thisPtr, const OH_XML_ParseOpti // TODO handle other properties from ParseOptions parser->parse(); parser->reset(); - return {}; } const OH_XML_XmlSerializerModifier* OH_XML_XmlSerializerModifierImpl() { @@ -762,28 +728,6 @@ const OH_XML_API* GetXMLAPIImpl(int version) { return &api; } -const OH_AnyAPI* impls[16] = { 0 }; - - -const OH_AnyAPI* GetAnyAPIImpl(int kind, int version) { - switch (kind) { - case OH_XML_API_KIND: - return reinterpret_cast(GetXMLAPIImpl(version)); - default: - return nullptr; - } -} - -extern "C" const OH_AnyAPI* GetAnyAPI(int kind, int version) { - if (kind < 0 || kind > 15) return nullptr; - if (!impls[kind]) { - impls[kind] = GetAnyAPIImpl(kind, version); - } - return impls[kind]; -} - - - // Accessors OH_NativePointer impl_XmlSerializer_ctor(uint8_t* thisArray, int32_t thisLength) { @@ -803,78 +747,67 @@ OH_NativePointer impl_XmlSerializer_ctor(uint8_t* thisArray, int32_t thisLength) const auto encoding_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); Opt_String encoding_value_buf = {}; encoding_value_buf.tag = encoding_value_buf_runtimeType == OH_RUNTIME_UNDEFINED ? OH_TAG_UNDEFINED : OH_TAG_OBJECT; - if ((OH_RUNTIME_UNDEFINED) != (encoding_value_buf_runtimeType)) { + if ((OH_RUNTIME_UNDEFINED) != (encoding_value_buf_runtimeType)) { encoding_value_buf.value = static_cast(thisDeserializer.readString()); } - } Opt_String encoding_value = encoding_value_buf;; - return GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->construct((const OH_Union_ArrayBuffer_DataView*)&buffer_value, /* TODO optional! */ (const OH_String*) &encoding_value); + return GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->construct((const OH_Union_ArrayBuffer_DataView*)&buffer_value, (const Opt_String*)&encoding_value); } KOALA_INTEROP_2(XmlSerializer_ctor, OH_NativePointer, uint8_t*, int32_t) OH_NativePointer impl_XmlSerializer_getFinalizer() { - return (OH_NativePointer) GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->destruct; + return (OH_NativePointer) &GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->destruct; } KOALA_INTEROP_0(XmlSerializer_getFinalizer, OH_NativePointer) void impl_XmlSerializer_setAttributes(OH_NativePointer thisPtr, const KStringPtr& name, const KStringPtr& value) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setAttributes(self, (const OH_String*)&name, (const OH_String*)&value); + GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setAttributes(thisPtr, (const OH_String*)&name, (const OH_String*)&value); } KOALA_INTEROP_V3(XmlSerializer_setAttributes, OH_NativePointer, KStringPtr, KStringPtr) void impl_XmlSerializer_addEmptyElement(OH_NativePointer thisPtr, const KStringPtr& name) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->addEmptyElement(self, (const OH_String*)&name); + GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->addEmptyElement(thisPtr, (const OH_String*)&name); } KOALA_INTEROP_V2(XmlSerializer_addEmptyElement, OH_NativePointer, KStringPtr) void impl_XmlSerializer_setDeclaration(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setDeclaration(self); + GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setDeclaration(thisPtr); } KOALA_INTEROP_V1(XmlSerializer_setDeclaration, OH_NativePointer) void impl_XmlSerializer_startElement(OH_NativePointer thisPtr, const KStringPtr& name) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->startElement(self, (const OH_String*)&name); + GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->startElement(thisPtr, (const OH_String*)&name); } KOALA_INTEROP_V2(XmlSerializer_startElement, OH_NativePointer, KStringPtr) void impl_XmlSerializer_endElement(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->endElement(self); + GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->endElement(thisPtr); } KOALA_INTEROP_V1(XmlSerializer_endElement, OH_NativePointer) void impl_XmlSerializer_setNamespace(OH_NativePointer thisPtr, const KStringPtr& prefix, const KStringPtr& namespace_) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setNamespace(self, (const OH_String*)&prefix, (const OH_String*)&namespace_); + GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setNamespace(thisPtr, (const OH_String*)&prefix, (const OH_String*)&namespace_); } KOALA_INTEROP_V3(XmlSerializer_setNamespace, OH_NativePointer, KStringPtr, KStringPtr) void impl_XmlSerializer_setComment(OH_NativePointer thisPtr, const KStringPtr& text) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setComment(self, (const OH_String*)&text); + GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setComment(thisPtr, (const OH_String*)&text); } KOALA_INTEROP_V2(XmlSerializer_setComment, OH_NativePointer, KStringPtr) void impl_XmlSerializer_setCDATA(OH_NativePointer thisPtr, const KStringPtr& text) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setCDATA(self, (const OH_String*)&text); + GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setCDATA(thisPtr, (const OH_String*)&text); } KOALA_INTEROP_V2(XmlSerializer_setCDATA, OH_NativePointer, KStringPtr) void impl_XmlSerializer_setText(OH_NativePointer thisPtr, const KStringPtr& text) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setText(self, (const OH_String*)&text); + GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setText(thisPtr, (const OH_String*)&text); } KOALA_INTEROP_V2(XmlSerializer_setText, OH_NativePointer, KStringPtr) void impl_XmlSerializer_setDocType(OH_NativePointer thisPtr, const KStringPtr& text) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setDocType(self, (const OH_String*)&text); + GetXMLAPIImpl(XML_API_VERSION)->XmlSerializer()->setDocType(thisPtr, (const OH_String*)&text); } KOALA_INTEROP_V2(XmlSerializer_setDocType, OH_NativePointer, KStringPtr) @@ -884,67 +817,57 @@ KOALA_INTEROP_V2(XmlSerializer_setDocType, OH_NativePointer, KStringPtr) // KOALA_INTEROP_0(ParseInfo_ctor, OH_NativePointer) // OH_NativePointer impl_ParseInfo_getFinalizer() { -// return (OH_NativePointer) GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->destruct; +// return (OH_NativePointer) &GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->destruct; // } // KOALA_INTEROP_0(ParseInfo_getFinalizer, OH_NativePointer) OH_Int32 impl_ParseInfo_getColumnNumber(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getColumnNumber(self); + return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getColumnNumber(thisPtr).i32; } KOALA_INTEROP_1(ParseInfo_getColumnNumber, OH_Int32, OH_NativePointer) OH_Int32 impl_ParseInfo_getDepth(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getDepth(self); + return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getDepth(thisPtr).i32; } KOALA_INTEROP_1(ParseInfo_getDepth, OH_Int32, OH_NativePointer) OH_Int32 impl_ParseInfo_getLineNumber(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getLineNumber(self); + return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getLineNumber(thisPtr).i32; } KOALA_INTEROP_1(ParseInfo_getLineNumber, OH_Int32, OH_NativePointer) void impl_ParseInfo_getName(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getName(self); + GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getName(thisPtr); } KOALA_INTEROP_V1(ParseInfo_getName, OH_NativePointer) void impl_ParseInfo_getNamespace(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getNamespace(self); + GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getNamespace(thisPtr); } KOALA_INTEROP_V1(ParseInfo_getNamespace, OH_NativePointer) void impl_ParseInfo_getPrefix(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getPrefix(self); + GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getPrefix(thisPtr); } KOALA_INTEROP_V1(ParseInfo_getPrefix, OH_NativePointer) void impl_ParseInfo_getText(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getText(self); + GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getText(thisPtr); } KOALA_INTEROP_V1(ParseInfo_getText, OH_NativePointer) OH_Boolean impl_ParseInfo_isEmptyElementTag(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->isEmptyElementTag(self); + return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->isEmptyElementTag(thisPtr); } KOALA_INTEROP_1(ParseInfo_isEmptyElementTag, OH_Boolean, OH_NativePointer) OH_Boolean impl_ParseInfo_isWhitespace(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->isWhitespace(self); + return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->isWhitespace(thisPtr); } KOALA_INTEROP_1(ParseInfo_isWhitespace, OH_Boolean, OH_NativePointer) OH_Int32 impl_ParseInfo_getAttributeCount(OH_NativePointer thisPtr) { - void* self = reinterpret_cast(thisPtr); - return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getAttributeCount(self); + return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getAttributeCount(thisPtr).i32; } KOALA_INTEROP_1(ParseInfo_getAttributeCount, OH_Int32, OH_NativePointer) @@ -953,32 +876,28 @@ OH_NativePointer impl_XmlPullParser_ctor(const KStringPtr& buffer, uint8_t* this const auto encoding_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); Opt_String encoding_value_buf = {}; encoding_value_buf.tag = encoding_value_buf_runtimeType == OH_RUNTIME_UNDEFINED ? OH_TAG_UNDEFINED : OH_TAG_OBJECT; - if ((OH_RUNTIME_UNDEFINED) != (encoding_value_buf_runtimeType)) { + if ((OH_RUNTIME_UNDEFINED) != (encoding_value_buf_runtimeType)) { encoding_value_buf.value = static_cast(thisDeserializer.readString()); } - } Opt_String encoding_value = encoding_value_buf;; - return GetXMLAPIImpl(XML_API_VERSION)->XmlPullParser()->construct((const OH_String*)&buffer, (const OH_String*)&encoding_value); + return GetXMLAPIImpl(XML_API_VERSION)->XmlPullParser()->construct((const OH_String*)&buffer, (const Opt_String*)&encoding_value); } KOALA_INTEROP_3(XmlPullParser_ctor, OH_NativePointer, KStringPtr, uint8_t*, int32_t) OH_NativePointer impl_XmlPullParser_getFinalizer() { - return (OH_NativePointer) GetXMLAPIImpl(XML_API_VERSION)->XmlPullParser()->destruct; + return (OH_NativePointer) &GetXMLAPIImpl(XML_API_VERSION)->XmlPullParser()->destruct; } KOALA_INTEROP_0(XmlPullParser_getFinalizer, OH_NativePointer) void impl_XmlPullParser_parse(OH_NativePointer thisPtr, uint8_t* thisArray, int32_t thisLength) { - void* self = reinterpret_cast(thisPtr); Deserializer thisDeserializer(thisArray, thisLength); - OH_XML_ParseOptions option_value = thisDeserializer.readParseOptions();; - GetXMLAPIImpl(XML_API_VERSION)->XmlPullParser()->parse(self, (const OH_XML_ParseOptions*)&option_value); + OH_ParseOptions option_value = thisDeserializer.readParseOptions();; + GetXMLAPIImpl(XML_API_VERSION)->XmlPullParser()->parse(thisPtr, (const OH_ParseOptions*)&option_value); } KOALA_INTEROP_V3(XmlPullParser_parse, OH_NativePointer, uint8_t*, int32_t) - -// ------------------------------------------- - -void deserializeAndCallCallback_Boolean_Void(uint8_t* thisArray, OH_Int32 thisLength) + +void deserializeAndCallCallback_Boolean_void(uint8_t* thisArray, OH_Int32 thisLength) { Deserializer thisDeserializer = Deserializer(thisArray, thisLength); const OH_Int32 _resourceId = thisDeserializer.readInt32(); @@ -990,23 +909,23 @@ void deserializeAndCallCallback_EventType_ParseInfo_Boolean(uint8_t* thisArray, { Deserializer thisDeserializer = Deserializer(thisArray, thisLength); const OH_Int32 _resourceId = thisDeserializer.readInt32(); - const auto _call = reinterpret_cast(thisDeserializer.readPointer()); + const auto _call = reinterpret_cast(thisDeserializer.readPointer()); OH_xml_EventType eventType = static_cast(thisDeserializer.readInt32()); - OH_XML_ParseInfo value = static_cast(thisDeserializer.readParseInfo()); - OH_Callback_Boolean_Void _continuation = {thisDeserializer.readCallbackResource(), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_Boolean_Void))))}; + OH_ParseInfo value = static_cast(thisDeserializer.readParseInfo()); + Callback_Boolean_void _continuation = {thisDeserializer.readCallbackResource(), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_Boolean_void))))}; _call(_resourceId, eventType, value, _continuation); } void deserializeAndCallCallback_String_String_Boolean(uint8_t* thisArray, OH_Int32 thisLength) { Deserializer thisDeserializer = Deserializer(thisArray, thisLength); const OH_Int32 _resourceId = thisDeserializer.readInt32(); - const auto _call = reinterpret_cast(thisDeserializer.readPointer()); + const auto _call = reinterpret_cast(thisDeserializer.readPointer()); OH_String name = static_cast(thisDeserializer.readString()); OH_String value = static_cast(thisDeserializer.readString()); - OH_Callback_Boolean_Void _continuation = {thisDeserializer.readCallbackResource(), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_Boolean_Void))))}; + Callback_Boolean_void _continuation = {thisDeserializer.readCallbackResource(), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_Boolean_void))))}; _call(_resourceId, name, value, _continuation); } -void deserializeAndCallCallback_Void(uint8_t* thisArray, OH_Int32 thisLength) +void deserializeAndCallCallback_void(uint8_t* thisArray, OH_Int32 thisLength) { Deserializer thisDeserializer = Deserializer(thisArray, thisLength); const OH_Int32 _resourceId = thisDeserializer.readInt32(); @@ -1016,27 +935,24 @@ void deserializeAndCallCallback_Void(uint8_t* thisArray, OH_Int32 thisLength) void deserializeAndCallCallback(OH_Int32 kind, uint8_t* thisArray, OH_Int32 thisLength) { switch (kind) { - case Kind_Callback_Boolean_Void: return deserializeAndCallCallback_Boolean_Void(thisArray, thisLength); + case Kind_Callback_Boolean_void: return deserializeAndCallCallback_Boolean_void(thisArray, thisLength); case Kind_Callback_EventType_ParseInfo_Boolean: return deserializeAndCallCallback_EventType_ParseInfo_Boolean(thisArray, thisLength); case Kind_Callback_String_String_Boolean: return deserializeAndCallCallback_String_String_Boolean(thisArray, thisLength); - case Kind_Callback_Void: return deserializeAndCallCallback_Void(thisArray, thisLength); + case Kind_Callback_void: return deserializeAndCallCallback_void(thisArray, thisLength); } } -// ------------------------------------- - - -void callManagedCallback_Boolean_Void(OH_Int32 resourceId, OH_Boolean value) +void callManagedCallback_Boolean_void(OH_Int32 resourceId, OH_Boolean value) { CallbackBuffer __buffer = {{}, {}}; const OH_CallbackResource __callbackResource = {resourceId, holdManagedCallbackResource, releaseManagedCallbackResource}; __buffer.resourceHolder.holdCallbackResource(&__callbackResource); Serializer argsSerializer = Serializer(__buffer.buffer, &(__buffer.resourceHolder)); - argsSerializer.writeInt32(Kind_Callback_Boolean_Void); + argsSerializer.writeInt32(Kind_Callback_Boolean_void); argsSerializer.writeInt32(resourceId); argsSerializer.writeBoolean(value); enqueueArkoalaCallback(&__buffer); } -void callManagedCallback_EventType_ParseInfo_Boolean(OH_Int32 resourceId, OH_xml_EventType eventType, OH_XML_ParseInfo value, OH_Callback_Boolean_Void continuation) +void callManagedCallback_EventType_ParseInfo_Boolean(OH_Int32 resourceId, OH_xml_EventType eventType, OH_ParseInfo value, Callback_Boolean_void continuation) { CallbackBuffer __buffer = {{}, {}}; const OH_CallbackResource __callbackResource = {resourceId, holdManagedCallbackResource, releaseManagedCallbackResource}; @@ -1050,7 +966,7 @@ void callManagedCallback_EventType_ParseInfo_Boolean(OH_Int32 resourceId, OH_xml argsSerializer.writePointer(reinterpret_cast(continuation.call)); enqueueArkoalaCallback(&__buffer); } -void callManagedCallback_String_String_Boolean(OH_Int32 resourceId, OH_String name, OH_String value, OH_Callback_Boolean_Void continuation) +void callManagedCallback_String_String_Boolean(OH_Int32 resourceId, OH_String name, OH_String value, Callback_Boolean_void continuation) { CallbackBuffer __buffer = {{}, {}}; const OH_CallbackResource __callbackResource = {resourceId, holdManagedCallbackResource, releaseManagedCallbackResource}; @@ -1064,29 +980,26 @@ void callManagedCallback_String_String_Boolean(OH_Int32 resourceId, OH_String na argsSerializer.writePointer(reinterpret_cast(continuation.call)); enqueueArkoalaCallback(&__buffer); } -void callManagedCallback_Void(OH_Int32 resourceId) +void callManagedCallback_void(OH_Int32 resourceId) { CallbackBuffer __buffer = {{}, {}}; const OH_CallbackResource __callbackResource = {resourceId, holdManagedCallbackResource, releaseManagedCallbackResource}; __buffer.resourceHolder.holdCallbackResource(&__callbackResource); Serializer argsSerializer = Serializer(__buffer.buffer, &(__buffer.resourceHolder)); - argsSerializer.writeInt32(Kind_Callback_Void); + argsSerializer.writeInt32(Kind_Callback_void); argsSerializer.writeInt32(resourceId); enqueueArkoalaCallback(&__buffer); } void* getManagedCallbackCaller(CallbackKind kind) { switch (kind) { - case Kind_Callback_Boolean_Void: return reinterpret_cast(callManagedCallback_Boolean_Void); + case Kind_Callback_Boolean_void: return reinterpret_cast(callManagedCallback_Boolean_void); case Kind_Callback_EventType_ParseInfo_Boolean: return reinterpret_cast(callManagedCallback_EventType_ParseInfo_Boolean); case Kind_Callback_String_String_Boolean: return reinterpret_cast(callManagedCallback_String_String_Boolean); - case Kind_Callback_Void: return reinterpret_cast(callManagedCallback_Void); + case Kind_Callback_void: return reinterpret_cast(callManagedCallback_void); } return nullptr; } - -// callbacks.cc - enum CallbackEventKind { Event_CallCallback = 0, Event_HoldManagedResource = 1, @@ -1162,4 +1075,25 @@ void holdManagedCallbackResource(OH_Int32 resourceId) { void releaseManagedCallbackResource(OH_Int32 resourceId) { callbackEventsQueue.push_back(Event_ReleaseManagedResource); callbackResourceSubqueue.push_back(resourceId); -} \ No newline at end of file +} + + +const OH_AnyAPI* impls[16] = { 0 }; + + +const OH_AnyAPI* GetAnyAPIImpl(int kind, int version) { + switch (kind) { + case OH_XML_API_KIND: + return reinterpret_cast(GetXMLAPIImpl(version)); + default: + return nullptr; + } +} + +extern "C" const OH_AnyAPI* GetAnyAPI(int kind, int version) { + if (kind < 0 || kind > 15) return nullptr; + if (!impls[kind]) { + impls[kind] = GetAnyAPIImpl(kind, version); + } + return impls[kind]; +} diff --git a/demos/xml/generated/xml.h b/demos/xml/generated/xml.h index a7f6bd17..2e4bb823 100644 --- a/demos/xml/generated/xml.h +++ b/demos/xml/generated/xml.h @@ -15,10 +15,10 @@ #ifndef OH_XML_H #define OH_XML_H -#include - #define XML_API_VERSION 1 +#include + /* clang-format off */ #ifdef __cplusplus @@ -90,10 +90,6 @@ typedef struct OH_Undefined { OH_Int32 dummy; // Empty structs are forbidden in C. } OH_Undefined; -typedef struct OH_Void { - OH_Int32 dummy; // Empty structs are forbidden in C. -} OH_Void; - // TODO: wrong, provide real definitions. typedef void* OH_DataView; @@ -104,19 +100,19 @@ typedef struct OH_AnyAPI { typedef enum OH_APIKind { OH_XML_API_KIND = 1 } OH_APIKind; -typedef struct OH_Callback_EventType_ParseInfo_Boolean OH_Callback_EventType_ParseInfo_Boolean; +typedef struct Callback_EventType_ParseInfo_Boolean Callback_EventType_ParseInfo_Boolean; typedef struct Opt_Callback_EventType_ParseInfo_Boolean Opt_Callback_EventType_ParseInfo_Boolean; -typedef struct OH_Callback_String_String_Boolean OH_Callback_String_String_Boolean; +typedef struct Callback_String_String_Boolean Callback_String_String_Boolean; typedef struct Opt_Callback_String_String_Boolean Opt_Callback_String_String_Boolean; typedef struct OH_ArrayBuffer OH_ArrayBuffer; typedef struct Opt_ArrayBuffer Opt_ArrayBuffer; -typedef struct OH_Callback_Void OH_Callback_Void; -typedef struct Opt_Callback_Void Opt_Callback_Void; -typedef struct OH_Callback_Boolean_Void OH_Callback_Boolean_Void; -typedef struct Opt_Callback_Boolean_Void Opt_Callback_Boolean_Void; -typedef OH_Materialized OH_XML_ParseInfo; +typedef struct Callback_void Callback_void; +typedef struct Opt_Callback_void Opt_Callback_void; +typedef struct Callback_Boolean_void Callback_Boolean_void; +typedef struct Opt_Callback_Boolean_void Opt_Callback_Boolean_void; +typedef OH_Materialized OH_ParseInfo; typedef struct Opt_ParseInfo Opt_ParseInfo; -typedef struct OH_XML_ParseOptions OH_XML_ParseOptions; +typedef struct OH_ParseOptions OH_ParseOptions; typedef struct Opt_ParseOptions Opt_ParseOptions; typedef struct OH_Union_ArrayBuffer_DataView OH_Union_ArrayBuffer_DataView; typedef struct Opt_Union_ArrayBuffer_DataView Opt_Union_ArrayBuffer_DataView; @@ -145,21 +141,21 @@ typedef struct Opt_Number { OH_Tag tag; OH_Number value; } Opt_Number; -typedef struct OH_Callback_EventType_ParseInfo_Boolean { +typedef struct Callback_EventType_ParseInfo_Boolean { OH_CallbackResource resource; - void (*call)(const OH_Int32 resourceId, OH_xml_EventType eventType, const OH_Materialized value, const OH_Callback_Boolean_Void continuation); -} OH_Callback_EventType_ParseInfo_Boolean; + void (*call)(const OH_Int32 resourceId, OH_xml_EventType eventType, const OH_Materialized value, const Callback_Boolean_void continuation); +} Callback_EventType_ParseInfo_Boolean; typedef struct Opt_Callback_EventType_ParseInfo_Boolean { OH_Tag tag; - OH_Callback_EventType_ParseInfo_Boolean value; + Callback_EventType_ParseInfo_Boolean value; } Opt_Callback_EventType_ParseInfo_Boolean; -typedef struct OH_Callback_String_String_Boolean { +typedef struct Callback_String_String_Boolean { OH_CallbackResource resource; - void (*call)(const OH_Int32 resourceId, const OH_String name, const OH_String value, const OH_Callback_Boolean_Void continuation); -} OH_Callback_String_String_Boolean; + void (*call)(const OH_Int32 resourceId, const OH_String name, const OH_String value, const Callback_Boolean_void continuation); +} Callback_String_String_Boolean; typedef struct Opt_Callback_String_String_Boolean { OH_Tag tag; - OH_Callback_String_String_Boolean value; + Callback_String_String_Boolean value; } Opt_Callback_String_String_Boolean; typedef struct Opt_Boolean { OH_Tag tag; @@ -176,41 +172,41 @@ typedef struct Opt_ArrayBuffer { OH_Tag tag; OH_ArrayBuffer value; } Opt_ArrayBuffer; -typedef struct OH_Callback_Void { +typedef struct Callback_void { OH_CallbackResource resource; void (*call)(const OH_Int32 resourceId); -} OH_Callback_Void; -typedef struct Opt_Callback_Void { +} Callback_void; +typedef struct Opt_Callback_void { OH_Tag tag; - OH_Callback_Void value; -} Opt_Callback_Void; -typedef struct OH_Callback_Boolean_Void { + Callback_void value; +} Opt_Callback_void; +typedef struct Callback_Boolean_void { OH_CallbackResource resource; void (*call)(const OH_Int32 resourceId, const OH_Boolean value); -} OH_Callback_Boolean_Void; -typedef struct Opt_Callback_Boolean_Void { +} Callback_Boolean_void; +typedef struct Opt_Callback_Boolean_void { OH_Tag tag; - OH_Callback_Boolean_Void value; -} Opt_Callback_Boolean_Void; -typedef struct Opt_Void { - OH_Tag tag; - OH_Void value; -} Opt_Void; + Callback_Boolean_void value; +} Opt_Callback_Boolean_void; typedef struct Opt_ParseInfo { OH_Tag tag; - OH_XML_ParseInfo value; + OH_ParseInfo value; } Opt_ParseInfo; -typedef struct OH_XML_ParseOptions { +typedef struct OH_ParseOptions { Opt_Boolean supportDoctype; Opt_Boolean ignoreNameSpace; Opt_Callback_String_String_Boolean tagValueCallbackFunction; Opt_Callback_String_String_Boolean attributeValueCallbackFunction; Opt_Callback_EventType_ParseInfo_Boolean tokenValueCallbackFunction; -} OH_XML_ParseOptions; +} OH_ParseOptions; typedef struct Opt_ParseOptions { OH_Tag tag; - OH_XML_ParseOptions value; + OH_ParseOptions value; } Opt_ParseOptions; +typedef struct Opt_String { + OH_Tag tag; + OH_String value; +} Opt_String; typedef struct OH_Union_ArrayBuffer_DataView { OH_Int32 selector; union { @@ -222,46 +218,42 @@ typedef struct Opt_Union_ArrayBuffer_DataView { OH_Tag tag; OH_Union_ArrayBuffer_DataView value; } Opt_Union_ArrayBuffer_DataView; -typedef struct Opt_String { - OH_Tag tag; - OH_String value; -} Opt_String; struct OH_XML_XmlSerializerHandleOpaque; typedef struct OH_XML_XmlSerializerHandleOpaque* OH_XML_XmlSerializerHandle; typedef struct OH_XML_XmlSerializerModifier { - OH_XML_XmlSerializerHandle (*construct)(const OH_Union_ArrayBuffer_DataView* buffer, const OH_String* encoding); + OH_XML_XmlSerializerHandle (*construct)(const OH_Union_ArrayBuffer_DataView* buffer, const Opt_String* encoding); void (*destruct)(OH_XML_XmlSerializerHandle thiz); - OH_Void (*setAttributes)(OH_NativePointer thisPtr, const OH_String* name, const OH_String* value); - OH_Void (*addEmptyElement)(OH_NativePointer thisPtr, const OH_String* name); - OH_Void (*setDeclaration)(OH_NativePointer thisPtr); - OH_Void (*startElement)(OH_NativePointer thisPtr, const OH_String* name); - OH_Void (*endElement)(OH_NativePointer thisPtr); - OH_Void (*setNamespace)(OH_NativePointer thisPtr, const OH_String* prefix, const OH_String* namespace_); - OH_Void (*setComment)(OH_NativePointer thisPtr, const OH_String* text); - OH_Void (*setCDATA)(OH_NativePointer thisPtr, const OH_String* text); - OH_Void (*setText)(OH_NativePointer thisPtr, const OH_String* text); - OH_Void (*setDocType)(OH_NativePointer thisPtr, const OH_String* text); + void (*setAttributes)(OH_NativePointer thisPtr, const OH_String* name, const OH_String* value); + void (*addEmptyElement)(OH_NativePointer thisPtr, const OH_String* name); + void (*setDeclaration)(OH_NativePointer thisPtr); + void (*startElement)(OH_NativePointer thisPtr, const OH_String* name); + void (*endElement)(OH_NativePointer thisPtr); + void (*setNamespace)(OH_NativePointer thisPtr, const OH_String* prefix, const OH_String* namespace_); + void (*setComment)(OH_NativePointer thisPtr, const OH_String* text); + void (*setCDATA)(OH_NativePointer thisPtr, const OH_String* text); + void (*setText)(OH_NativePointer thisPtr, const OH_String* text); + void (*setDocType)(OH_NativePointer thisPtr, const OH_String* text); } OH_XML_XmlSerializerModifier; struct OH_XML_ParseInfoHandleOpaque; typedef struct OH_XML_ParseInfoHandleOpaque* OH_XML_ParseInfoHandle; typedef struct OH_XML_ParseInfoModifier { - OH_Int32 (*getColumnNumber)(OH_NativePointer thisPtr); - OH_Int32 (*getDepth)(OH_NativePointer thisPtr); - OH_Int32 (*getLineNumber)(OH_NativePointer thisPtr); + OH_Number (*getColumnNumber)(OH_NativePointer thisPtr); + OH_Number (*getDepth)(OH_NativePointer thisPtr); + OH_Number (*getLineNumber)(OH_NativePointer thisPtr); OH_String (*getName)(OH_NativePointer thisPtr); OH_String (*getNamespace)(OH_NativePointer thisPtr); OH_String (*getPrefix)(OH_NativePointer thisPtr); OH_String (*getText)(OH_NativePointer thisPtr); OH_Boolean (*isEmptyElementTag)(OH_NativePointer thisPtr); OH_Boolean (*isWhitespace)(OH_NativePointer thisPtr); - OH_Int32 (*getAttributeCount)(OH_NativePointer thisPtr); + OH_Number (*getAttributeCount)(OH_NativePointer thisPtr); } OH_XML_ParseInfoModifier; struct OH_XML_XmlPullParserHandleOpaque; typedef struct OH_XML_XmlPullParserHandleOpaque* OH_XML_XmlPullParserHandle; typedef struct OH_XML_XmlPullParserModifier { - OH_XML_XmlPullParserHandle (*construct)(const OH_String* buffer, const OH_String* encoding); + OH_XML_XmlPullParserHandle (*construct)(const OH_String* buffer, const Opt_String* encoding); void (*destruct)(OH_XML_XmlPullParserHandle thiz); - OH_Void (*parse)(OH_NativePointer thisPtr, const OH_XML_ParseOptions* option); + void (*parse)(OH_NativePointer thisPtr, const OH_ParseOptions* option); } OH_XML_XmlPullParserModifier; typedef struct OH_XML_API { OH_Int32 version; diff --git a/src/peer-generation/OhosGenerator.ts b/src/peer-generation/OhosGenerator.ts index dbd199be..5b55fac4 100644 --- a/src/peer-generation/OhosGenerator.ts +++ b/src/peer-generation/OhosGenerator.ts @@ -15,22 +15,21 @@ import * as fs from 'fs' import * as path from 'path' +import { createContainerType, createReferenceType, forceAsNamedNode, hasExtAttribute, IDLCallback, IDLConstructor, IDLEntry, IDLEnum, IDLExtendedAttributes, IDLI32Type, IDLInterface, IDLMethod, IDLNumberType, IDLParameter, IDLPointerType, IDLType, IDLU8Type, IDLVoidType, isCallback, isClass, isConstructor, isContainerType, isEnum, isInterface, isMethod, isReferenceType, isType, isUnionType, maybeOptional } from '../idl' import { IndentedPrinter } from "../IndentedPrinter" -import { IdlPeerLibrary } from './idl/IdlPeerLibrary' -import { CppLanguageWriter, createLanguageWriter, ExpressionStatement, FieldModifier, LanguageExpression, LanguageWriter, Method, MethodSignature, NamedMethodSignature } from './LanguageWriters' -import { createContainerType, createReferenceType, forceAsNamedNode, hasExtAttribute, IDLCallback, IDLEntry, IDLEnum, IDLExtendedAttributes, IDLI32Type, IDLInterface, IDLMethod, IDLNumberType, IDLParameter, IDLPointerType, IDLType, IDLU8Type, IDLVoidType, isCallback, isClass, isConstructor, isContainerType, isEnum, isInterface, isMethod, isReferenceType, isType, isUnionType, maybeOptional } from '../idl' -import { makeDeserializeAndCall, makeSerializerForOhos, readLangTemplate } from './FileGenerators' +import { Language } from '../Language' import { capitalize } from '../util' -import { isMaterialized } from './idl/IdlPeerGeneratorVisitor' +import { ArgConvertor, generateCallbackAPIArguments } from './ArgConvertors' import { PrimitiveType } from './ArkPrimitiveType' -import { Language } from '../Language' -import { ArgConvertor } from './ArgConvertors' -import { writeDeserializer, writeSerializer } from './printers/SerializerPrinter' +import { makeDeserializeAndCall, makeSerializerForOhos, readLangTemplate } from './FileGenerators' import { qualifiedName } from './idl/common' -import { printCallbacksKinds, printManagedCaller } from './printers/CallbacksPrinter' +import { isMaterialized } from './idl/IdlPeerGeneratorVisitor' +import { IdlPeerLibrary } from './idl/IdlPeerLibrary' import { StructPrinter } from './idl/StructPrinter' -import { generateCallbackAPIArguments } from './ArgConvertors' -import { printBridgeCc } from './printers/BridgeCcPrinter' +import { CppLanguageWriter, createLanguageWriter, ExpressionStatement, FieldModifier, LanguageExpression, LanguageWriter, Method, MethodSignature, NamedMethodSignature } from './LanguageWriters' +import { printBridgeCcForOHOS } from './printers/BridgeCcPrinter' +import { printCallbacksKinds, printManagedCaller } from './printers/CallbacksPrinter' +import { writeDeserializer, writeSerializer } from './printers/SerializerPrinter' class NameType { constructor(public name: string, public type: string) {} @@ -121,10 +120,12 @@ class OHOSVisitor { clazz.constructors.forEach((ctor, index) => { let name = `construct${(index > 0) ? index.toString() : ""}` let params = ctor.parameters.map(it => new NameType(_h.escapeKeyword(it.name), this.mapType(it.type!))) - _h.print(`${handleType} (*${name})(${params.map(it => `const ${it.type}* ${it.name}`).join(", ")});`) // TODO check + let argConvertors = ctor.parameters.map(param => generateArgConvertor(this.library, param)) + let cppArgs = generateCParameters(ctor, argConvertors, _h) + _h.print(`${handleType} (*${name})(${cppArgs});`) // TODO check let implName = `${clazz.name}_${name}Impl` _c.print(`&${implName},`) - this.impls.set(implName, { params, returnType: handleType}) + this.impls.set(implName, { params, returnType: handleType, paramsCString: cppArgs}) }) if (clazz.constructors.length > 0) { let destructName = `${clazz.name}_destructImpl` @@ -468,17 +469,21 @@ class OHOSVisitor { } private printC() { + let callbackKindsPrinter = createLanguageWriter(Language.CPP, this.library); + printCallbacksKinds(this.library, callbackKindsPrinter) + this.cppWriter.writeLines( readLangTemplate('api_impl_prologue.cc', Language.CPP) .replaceAll("%API_HEADER_PATH%", `${this.libraryName.toLowerCase()}.h`) + .replaceAll("%CALLBACK_KINDS%", callbackKindsPrinter.getOutput().join("\n")) + .replaceAll("%LIBRARY_NAME%", this.libraryName.toUpperCase()) ) this.hWriter.writeLines( readLangTemplate('ohos_api_prologue.h', Language.CPP) .replaceAll("%INCLUDE_GUARD_DEFINE%", `OH_${this.libraryName.toUpperCase()}_H`) + .replaceAll("%LIBRARY_NAME%", this.libraryName.toUpperCase()) ) - - printCallbacksKinds(this.library, this.cppWriter) let toStringsPrinter = createLanguageWriter(Language.CPP, this.library) new StructPrinter(this.library).generateStructs(this.hWriter, this.hWriter.printer, toStringsPrinter) this.cppWriter.concat(toStringsPrinter) @@ -490,15 +495,19 @@ class OHOSVisitor { this.writeModifiers(writer) this.writeImpls() this.cppWriter.concat(writer) - this.cppWriter.concat(printBridgeCc(this.library, false).generated) + this.cppWriter.concat(printBridgeCcForOHOS(this.library).generated) this.cppWriter.concat(makeDeserializeAndCall(this.library, Language.CPP, 'serializer.cc').content) this.cppWriter.concat(printManagedCaller(this.library).content) this.hWriter.writeLines( readLangTemplate('ohos_api_epilogue.h', Language.CPP) .replaceAll("%INCLUDE_GUARD_DEFINE%", `OH_${this.libraryName.toUpperCase()}_H`) + .replaceAll("%LIBRARY_NAME%", this.libraryName.toUpperCase()) + ) + this.cppWriter.writeLines( + readLangTemplate('api_impl_epilogue.cc', Language.CPP) + .replaceAll("%LIBRARY_NAME%", this.libraryName.toUpperCase()) ) - this.cppWriter.writeLines(readLangTemplate('api_impl_epilogue.cc', Language.CPP)) } execute(outDir: string, managedOutDir: string) { @@ -612,10 +621,12 @@ function generateArgConvertor(library: IdlPeerLibrary, param: IDLParameter): Arg } // TODO drop this method -function generateCParameters(method: IDLMethod, argConvertors: ArgConvertor[], writer: LanguageWriter): string { - let args = [`${PrimitiveType.NativePointer.getText()} thisPtr`] +function generateCParameters(method: IDLMethod | IDLConstructor, argConvertors: ArgConvertor[], writer: LanguageWriter): string { + let args = isConstructor(method) ? [] : [`${PrimitiveType.NativePointer} thisPtr`] for (let i = 0; i < argConvertors.length; ++i) { - args.push(`const ${writer.stringifyType(method.parameters[i].type!)}* ${writer.escapeKeyword(method.parameters[i].name)}`) + const typeName = writer.stringifyType(argConvertors[i].nativeType()) + const argName = writer.escapeKeyword(method.parameters[i].name) + args.push(`const ${typeName}* ${argName}`) } return args.join(", ") } diff --git a/src/peer-generation/printers/BridgeCcPrinter.ts b/src/peer-generation/printers/BridgeCcPrinter.ts index bbf8dd3f..44f0bd28 100644 --- a/src/peer-generation/printers/BridgeCcPrinter.ts +++ b/src/peer-generation/printers/BridgeCcPrinter.ts @@ -14,7 +14,7 @@ */ import { capitalize, dropSuffix, isDefined } from "../../util"; -import { ArgConvertor } from "../ArgConvertors"; +import { ArgConvertor, RetConvertor } from "../ArgConvertors"; import { PrimitiveType } from "../ArkPrimitiveType" import { bridgeCcCustomDeclaration, bridgeCcGeneratedDeclaration } from "../FileGenerators"; import { createLanguageWriter, createTypeNameConvertor, ExpressionStatement, LanguageWriter } from "../LanguageWriters"; @@ -29,45 +29,73 @@ class BridgeCcVisitor { readonly customApi = createLanguageWriter(Language.CPP, this.library) constructor( - private readonly library: IdlPeerLibrary, - private readonly callLog: boolean, + protected readonly library: IdlPeerLibrary, + protected readonly callLog: boolean, ) {} - private generateApiCall(method: IdlPeerMethod, modifierName?: string): string { + protected generateApiCall(method: IdlPeerMethod, modifierName?: string): string { // TODO: may be need some translation tables? let clazz = modifierName ?? dropSuffix(dropSuffix(dropSuffix(method.originalParentName, "Method"), "Attribute"), "Interface") return `get${capitalize(clazz)}${method.apiKind}()` } + protected escapeKeyword(kw: string): string { + return this.generatedApi.escapeKeyword(kw) + } + // TODO: may be this is another method of ArgConvertor? private generateApiArgument(argConvertor: ArgConvertor): string { const nameConverter = createTypeNameConvertor(Language.CPP, getReferenceResolver(this.library)) const prefix = argConvertor.isPointerType() ? `(const ${nameConverter.convertType(argConvertor.nativeType())}*)&`: " " if (argConvertor.useArray) - return `${prefix}${argConvertor.param}_value` + return `${prefix}${this.escapeKeyword(argConvertor.param)}_value` else - return `${argConvertor.convertorArg(argConvertor.param, this.generatedApi)}` + return `${argConvertor.convertorArg(this.escapeKeyword(argConvertor.param), this.generatedApi)}` + } + + protected getApiCall(method: IdlPeerMethod): string { + return method.apiCall } - private printAPICall(method: IdlPeerMethod, modifierName?: string) { + protected printAPICall(method: IdlPeerMethod, modifierName?: string) { const hasReceiver = method.hasReceiver() const argConvertors = method.argConvertors const isVoid = method.retConvertor.isVoid const modifier = this.generateApiCall(method, modifierName) - const peerMethod = method.peerMethodName - const receiver = hasReceiver ? ['self'] : [] + const peerMethod = this.getPeerMethodName(method) + const receiver = hasReceiver ? [this.getReceiverArgName()] : [] // TODO: how do we know the real amount of arguments of the API functions? // Do they always match in TS and in C one to one? const args = receiver.concat(argConvertors.map(it => this.generateApiArgument(it))).join(", ") - const call = `${isVoid ? "" : "return "}${method.apiCall}->${modifier}->${peerMethod}(${args});` - if (this.callLog) this.printCallLog(method, method.apiCall, modifier) + const apiCall = this.getApiCall(method) + const field = this.getApiCallResultField(method) + const call = `${isVoid ? "" : "return "}${apiCall}->${modifier}->${peerMethod}(${args})${field};` + if (this.callLog) this.printCallLog(method, apiCall, modifier) this.generatedApi.print(call) } + protected getApiCallResultField(method: IdlPeerMethod): string { + return "" + } + + protected getReceiverArgName(): string { + return "self" + } + + protected getPeerMethodName(method: IdlPeerMethod): string { + return method.peerMethodName + } + + protected printReceiverCastCall(method: IdlPeerMethod) { + const receiverType = method.receiverType; + const self = this.getReceiverArgName(); + this.generatedApi.print(`${receiverType} ${self} = reinterpret_cast<${receiverType}>(thisPtr);`) + } + private printNativeBody(method: IdlPeerMethod, modifierName?: string) { this.generatedApi.pushIndent() if (method.hasReceiver()) { - this.generatedApi.print(`${method.receiverType} self = reinterpret_cast<${method.receiverType}>(thisPtr);`) + this.printReceiverCastCall(method) } let deserializerCreated = false method.argConvertors.forEach(it => { @@ -107,9 +135,9 @@ class BridgeCcVisitor { BridgeCcVisitor.varCnt += 1 } - this.generatedApi.print(`_logData.append(" ${api}->${modifier}->${method.peerMethodName}(");`) + this.generatedApi.print(`_logData.append(" ${api}->${modifier}->${this.getPeerMethodName(method)}(");`) if (method.hasReceiver()) { - this.generatedApi.print(`_logData.append("(Ark_NativePointer)");`) + this.generatedApi.print(`_logData.append("(${PrimitiveType.NativePointer})");`) this.generatedApi.print(`_logData.append("peer" + std::to_string((uintptr_t)thisPtr));`); if (method.argConvertors.length > 0) this.generatedApi.print(`_logData.append(", ");`) @@ -185,7 +213,7 @@ class BridgeCcVisitor { type = `const KLength&` break } - maybeReceiver.push(`${type} ${it.param}`) + maybeReceiver.push(`${type} ${this.escapeKeyword(it.param)}`) } } return maybeReceiver @@ -196,9 +224,7 @@ class BridgeCcVisitor { const argConvertors = method.argConvertors let cName = `${method.originalParentName}_${method.overloadedName}` - let retValue: string | undefined = retConvertor.interopType - ? retConvertor.interopType() - : retConvertor.nativeType() + let retValue: string | undefined = this.getRetValue(method, retConvertor) this.generatedApi.print(`${retValue} impl_${cName}(${this.generateCParameters(method, argConvertors).join(", ")}) {`) this.generatedApi.pushIndent() this.printNativeBody(method, modifierName) @@ -213,6 +239,12 @@ class BridgeCcVisitor { this.generatedApi.print(` `) } + protected getRetValue(method: IdlPeerMethod, retConvertor: RetConvertor): string | undefined { + return retConvertor.interopType + ? retConvertor.interopType() + : retConvertor.nativeType(); + } + /* printCustomApiMethod(c: CustomAPI, m: Method) { const sig = m.signature as NamedMethodSignature @@ -275,11 +307,70 @@ class BridgeCcVisitor { } } +// TODO commonize this piece of code +class OhosBridgeCcVisitor extends BridgeCcVisitor { + protected generateApiCall(method: IdlPeerMethod, modifierName?: string): string { + // TODO: may be need some translation tables? + let clazz = modifierName ?? dropSuffix(dropSuffix(dropSuffix(method.originalParentName, "Method"), "Attribute"), "Interface") + return capitalize(clazz) + "()" + } + + protected getApiCall(method: IdlPeerMethod): string { + const libName = this.library.name; + return `Get${libName}APIImpl(${libName}_API_VERSION)` + } + + + protected getReceiverArgName(): string { + return "thisPtr" + } + + protected printReceiverCastCall(method: IdlPeerMethod) { + // OHOS API does not need to cast native pointer at this moment + } + + protected getPeerMethodName(method: IdlPeerMethod): string { + switch (method.peerMethodName) { + case "ctor": return "construct" + case "getFinalizer": return "destruct" + default: return method.peerMethodName + } + } + + protected printAPICall(method: IdlPeerMethod, modifierName?: string) { + if (method.peerMethodName == "getFinalizer") { + const modifier = this.generateApiCall(method, modifierName) + const peerMethod = this.getPeerMethodName(method) + const apiCall = this.getApiCall(method) + const call = `return (${PrimitiveType.NativePointer}) &${apiCall}->${modifier}->${peerMethod};` + this.generatedApi.print(call) + } else { + super.printAPICall(method, modifierName) + } + } + + protected getApiCallResultField(method: IdlPeerMethod): string { + // TODO Remove this workaround for case when number is replaced with int32 + if (method.method.signature.returnType === IDLNumberType) { + return ".i32" + } else { + return super.getApiCallResultField(method) + } + + } +} + type BridgeCcApi = { generated: LanguageWriter; custom: LanguageWriter; }; +export function printBridgeCcForOHOS(peerLibrary: IdlPeerLibrary): BridgeCcApi { + const visitor = new OhosBridgeCcVisitor(peerLibrary, false) + visitor.print() + return { generated: visitor.generatedApi, custom: visitor.customApi } +} + export function printBridgeCc(peerLibrary: IdlPeerLibrary, callLog: boolean): BridgeCcApi { const visitor = new BridgeCcVisitor(peerLibrary, callLog) visitor.print() diff --git a/src/peer-generation/printers/CallbacksPrinter.ts b/src/peer-generation/printers/CallbacksPrinter.ts index fc8c5aa5..0603a5e6 100644 --- a/src/peer-generation/printers/CallbacksPrinter.ts +++ b/src/peer-generation/printers/CallbacksPrinter.ts @@ -25,6 +25,7 @@ import { CallbackKind, generateCallbackAPIArguments, generateCallbackKindAccess, import { MethodArgPrintHint } from "../LanguageWriters/LanguageWriter"; import { collectMaterializedImports } from "../Materialized"; import { CppSourceFile, SourceFile, TsSourceFile } from "./SourceFile"; +import { PrimitiveType } from "../ArkPrimitiveType"; function collectEntryCallbacks(library: IdlPeerLibrary, entry: idl.IDLEntry): idl.IDLCallback[] { let res: idl.IDLCallback[] = [] @@ -124,8 +125,6 @@ class DeserializeCallbacksVisitor { } private writeImports() { - this.writer.writeLines(cStyleCopyright) - if (this.writer.language === Language.CPP) { const cppFile = this.destFile as CppSourceFile cppFile.addInclude("arkoala_api_generated.h") @@ -306,7 +305,7 @@ class ManagedCallCallbackVisitor { writer.print(`switch (kind) {`) writer.pushIndent() for (const callback of callbacks) { - writer.print(`case ${generateCallbackKindName(callback)}: return reinterpret_cast(callManaged${callback.name});`) + writer.print(`case ${generateCallbackKindName(callback)}: return reinterpret_cast<${PrimitiveType.NativePointer}>(callManaged${callback.name});`) } writer.popIndent() writer.print(`}`) diff --git a/templates/c++/api_impl_epilogue.cc b/templates/c++/api_impl_epilogue.cc index b2703fd4..88cd974a 100644 --- a/templates/c++/api_impl_epilogue.cc +++ b/templates/c++/api_impl_epilogue.cc @@ -1,11 +1,88 @@ +enum CallbackEventKind { + Event_CallCallback = 0, + Event_HoldManagedResource = 1, + Event_ReleaseManagedResource = 2, +}; + +static bool needReleaseFront = false; +static std::deque callbackEventsQueue; +static std::deque callbackCallSubqueue; +static std::deque callbackResourceSubqueue; +KInt impl_CheckArkoalaCallbackEvent(KByte* result, KInt size) { + if (needReleaseFront) + { + switch (callbackEventsQueue.front()) + { + case Event_CallCallback: + callbackCallSubqueue.front().resourceHolder.release(); + callbackCallSubqueue.pop_front(); + break; + case Event_HoldManagedResource: + case Event_ReleaseManagedResource: + callbackResourceSubqueue.pop_front(); + break; + default: + throw "Unknown event kind"; + } + callbackEventsQueue.pop_front(); + needReleaseFront = false; + } + if (callbackEventsQueue.empty()) { + return 0; + } + const CallbackEventKind frontEventKind = callbackEventsQueue.front(); + Serializer serializer(result); + serializer.writeInt32(frontEventKind); + switch (frontEventKind) + { + case Event_CallCallback: + serializer.writeBuffer(callbackCallSubqueue.front().buffer, sizeof(CallbackBuffer::buffer)); + break; + case Event_HoldManagedResource: + case Event_ReleaseManagedResource: + serializer.writeInt32(callbackResourceSubqueue.front()); + break; + default: + throw "Unknown event kind"; + } + needReleaseFront = true; + return 1; +} +KOALA_INTEROP_2(CheckArkoalaCallbackEvent, KInt, KByte*, KInt) + +void impl_ReleaseArkoalaResource(OH_Int32 resourceId) { + releaseManagedCallbackResource(resourceId); +} +KOALA_INTEROP_V1(ReleaseArkoalaResource, KInt) + +void impl_HoldArkoalaResource(OH_Int32 resourceId) { + holdManagedCallbackResource(resourceId); +} +KOALA_INTEROP_V1(HoldArkoalaResource, KInt) + +void enqueueArkoalaCallback(const CallbackBuffer* event) { + callbackEventsQueue.push_back(Event_CallCallback); + callbackCallSubqueue.push_back(*event); +} + +void holdManagedCallbackResource(OH_Int32 resourceId) { + callbackEventsQueue.push_back(Event_HoldManagedResource); + callbackResourceSubqueue.push_back(resourceId); +} + +void releaseManagedCallbackResource(OH_Int32 resourceId) { + callbackEventsQueue.push_back(Event_ReleaseManagedResource); + callbackResourceSubqueue.push_back(resourceId); +} + const OH_AnyAPI* impls[16] = { 0 }; const OH_AnyAPI* GetAnyAPIImpl(int kind, int version) { switch (kind) { - case OH_XML_API_KIND: - return reinterpret_cast(GetXMLAPIImpl(version)); + case OH_%LIBRARY_NAME%_API_KIND: + return reinterpret_cast(Get%LIBRARY_NAME%APIImpl(version)); default: return nullptr; } @@ -18,12 +95,3 @@ extern "C" const OH_AnyAPI* GetAnyAPI(int kind, int version) { } return impls[kind]; } - -int main(int argc, char** argv) { - const OH_XML_API* api = (const OH_XML_API*)GetAnyAPI(OH_XML_API_KIND, 1); - fprintf(stderr, "api=%p\n", api); - OH_XML_Union_ArrayBuffer_DataView data; - OH_XML_XmlSerializerHandle handle = api->XmlSerializer()->construct(data, "utf-8"); - fprintf(stderr, "handle=%p\n", handle); - return 0; -} \ No newline at end of file diff --git a/templates/c++/api_impl_prologue.cc b/templates/c++/api_impl_prologue.cc index 422dcc83..720b57c9 100644 --- a/templates/c++/api_impl_prologue.cc +++ b/templates/c++/api_impl_prologue.cc @@ -13,9 +13,26 @@ * limitations under the License. */ +#include "%API_HEADER_PATH%" + #include "common-interop.h" #include "SerializerBase.h" #include "DeserializerBase.h" -#include "%API_HEADER_PATH%" +#include CustomDeserializer * DeserializerBase::customDeserializers = nullptr; + +%CALLBACK_KINDS% + +struct CallbackBuffer { + CallbackKind kind; + uint8_t buffer[60 * 4]; + CallbackResourceHolder resourceHolder; +}; +void enqueueArkoalaCallback(const CallbackBuffer* event); + +OH_NativePointer getManagedCallbackCaller(CallbackKind kind); +void holdManagedCallbackResource(OH_Int32 resourceId); +void releaseManagedCallbackResource(OH_Int32 resourceId); + +void deserializeAndCallCallback(KInt kind, KByte* args, KInt argsSize); diff --git a/templates/c++/ohos_DeserializerBase.h b/templates/c++/ohos_DeserializerBase.h index 7988ee36..d7912e4d 100644 --- a/templates/c++/ohos_DeserializerBase.h +++ b/templates/c++/ohos_DeserializerBase.h @@ -12,13 +12,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include "%NATIVE_API_HEADER_PATH%" +#include #include #include #include #include -#include "%NATIVE_API_HEADER_PATH%" + + +// callbacks.h + +void holdManagedCallbackResource(OH_Int32 resourceId); +void releaseManagedCallbackResource(OH_Int32 resourceId); + +// --------- inline const char *tagName(OH_Tag tag) { @@ -185,18 +193,6 @@ inline void WriteToString(std::string *result, const OH_Undefined *value) result->append("{}"); } -template <> -inline void WriteToString(std::string *result, OH_Void value) -{ - result->append("{}"); -} - -template <> -inline void WriteToString(std::string *result, const OH_Void *value) -{ - result->append("{}"); -} - template <> inline void WriteToString(std::string *result, const OH_CustomObject *value) { @@ -386,7 +382,7 @@ public: OH_String readString() { - OH_String result = "todo"; + OH_String result = "TODO"; // TODO implement string // OH_Int32 length = readInt32(); // check(length); @@ -439,12 +435,10 @@ public: OH_CallbackResource readCallbackResource() { - // TODO implement holdManagedCallbackResource - void* holdManagedCallbackResource = nullptr; OH_CallbackResource result = {}; result.resourceId = readInt32(); result.hold = reinterpret_cast(readPointerOrDefault(reinterpret_cast(holdManagedCallbackResource))); - result.release = reinterpret_cast(readPointerOrDefault(reinterpret_cast(holdManagedCallbackResource))); + result.release = reinterpret_cast(readPointerOrDefault(reinterpret_cast(releaseManagedCallbackResource))); return result; } }; diff --git a/templates/c++/ohos_SerializerBase.h b/templates/c++/ohos_SerializerBase.h index 20f2326e..b94b0bb5 100644 --- a/templates/c++/ohos_SerializerBase.h +++ b/templates/c++/ohos_SerializerBase.h @@ -25,6 +25,7 @@ #include #include #include +#include template inline OH_RuntimeType runtimeType(const T& value) = delete; @@ -57,12 +58,29 @@ T* allocArray(const std::array& ref) { return array; } +class CallbackResourceHolder { +private: + std::vector heldResources; +public: + void holdCallbackResource(const OH_CallbackResource* resource) { + resource->hold(resource->resourceId); + this->heldResources.push_back(*resource); + } + void release() { + for (auto resource : this->heldResources) { + resource.release(resource.resourceId); + } + this->heldResources.clear(); + } +}; + class SerializerBase { private: uint8_t* data; int position; + CallbackResourceHolder* resourceHolder; public: - SerializerBase(uint8_t* data): data(data), position(0) {} + SerializerBase(uint8_t* data, CallbackResourceHolder* resourceHolder = nullptr): data(data), position(0), resourceHolder(resourceHolder) {} void writeInt8(OH_Int8 value) { *((OH_Int8*)(data + position)) = value; @@ -93,9 +111,10 @@ public: void writeString(OH_String value) { // TODO implement string - // writeInt32(value.length + 1); - // strcpy((char*)(data + position), value.chars); - // position += value.length + 1; + auto length = std::strlen(value); + writeInt32(length + 1); + strcpy((char*)(data + position), value); + position += length + 1; } void writeBoolean(OH_Boolean value) { @@ -111,6 +130,9 @@ public: writeInt32(resource.resourceId); writePointer(reinterpret_cast(resource.hold)); writePointer(reinterpret_cast(resource.release)); + if (this->resourceHolder != nullptr) { + this->resourceHolder->holdCallbackResource(&resource); + } } /* @@ -131,6 +153,11 @@ public: // There should be no need to pass accessors back from native code throw "Trying to pass materialized class back from native code -- is that really needed?"; } + + void writeBuffer(uint8_t* buffer, int size) { + memcpy(data + position, buffer, size); + position += size; + } }; #endif // _SERIALIZER_BASE_H \ No newline at end of file diff --git a/templates/c++/ohos_api_prologue.h b/templates/c++/ohos_api_prologue.h index b204caac..b4dd733d 100644 --- a/templates/c++/ohos_api_prologue.h +++ b/templates/c++/ohos_api_prologue.h @@ -15,7 +15,7 @@ #ifndef %INCLUDE_GUARD_DEFINE% #define %INCLUDE_GUARD_DEFINE% -#define XML_API_VERSION 1 +#define %LIBRARY_NAME%_API_VERSION 1 #include @@ -90,10 +90,6 @@ typedef struct OH_Undefined { OH_Int32 dummy; // Empty structs are forbidden in C. } OH_Undefined; -typedef struct OH_Void { - OH_Int32 dummy; // Empty structs are forbidden in C. -} OH_Void; - // TODO: wrong, provide real definitions. typedef void* OH_DataView; @@ -102,5 +98,5 @@ typedef struct OH_AnyAPI { } OH_AnyAPI; typedef enum OH_APIKind { - OH_XML_API_KIND = 1 + OH_%LIBRARY_NAME%_API_KIND = 1 } OH_APIKind; \ No newline at end of file -- Gitee From f818a09519392503e010bdf655fe47926b78c406 Mon Sep 17 00:00:00 2001 From: Roman Sedaikin Date: Thu, 14 Nov 2024 12:22:21 +0000 Subject: [PATCH 02/53] !960 Fix java for loader. --- external | 2 +- peer_lib/sig/arkoala/loader/loader.ts | 27 ++++++++++++--------------- predefined/sys/loader.idl | 4 ++-- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/external b/external index aaae4f4e..5f44a6e6 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit aaae4f4eb97e774e4d7ebfef53087ae9123d044d +Subproject commit 5f44a6e6df3d872ad2a15544f9027d6533f8f5b6 diff --git a/peer_lib/sig/arkoala/loader/loader.ts b/peer_lib/sig/arkoala/loader/loader.ts index 4799c2f6..716d79c5 100644 --- a/peer_lib/sig/arkoala/loader/loader.ts +++ b/peer_lib/sig/arkoala/loader/loader.ts @@ -15,33 +15,28 @@ import { env } from "node:process" import { int32 } from "@koalaui/common" import { Worker, isMainThread, parentPort } from "node:worker_threads" -import { wrapCallback } from "./CallbackRegistry" +import { callCallback, wrapCallback } from "./CallbackRegistry" import { KInt, KPointer, KUint8ArrayPtr, pointer } from "./types" export interface LoaderOps { _LoadVirtualMachine(vmKind: int32, appClassPath: string, appLibPath: string): int32 - _StartApplication(): int32 - _RunApplication(arg0: int32, arg1: int32): int32 + _StartApplication(): KPointer + _RunApplication(arg0: int32, arg1: int32): boolean _SetCallbackDispatcher(dispatcher: (id: int32, args: Uint8Array, length: int32) => int32): void } // todo: for control VSYNC export interface NativeControl extends LoaderOps { // todo: implement native methods + _GetPipelineContext(ptr0: KPointer): KPointer _SetVsyncCallback(ptr0: KPointer, arg: KInt): void _UnblockVsyncWait(ptr0: KPointer): void - _GetPipelineContext(): pointer } let theModule: NativeControl | undefined = undefined declare const LOAD_NATIVE: NativeControl -export function callCallback(id: int32, args: Uint8Array, length: int32): int32 { - console.log("Called callCallback()") - throw new Error("Not yet implemented") -} - export function nativeModule(): NativeControl { if (theModule) return theModule theModule = LOAD_NATIVE as NativeControl @@ -51,8 +46,11 @@ export function nativeModule(): NativeControl { return theModule } -function getNativePipelineContext(): pointer { - return nativeModule()._GetPipelineContext() +let rootPointer: KPointer + +function getNativePipelineContext(): KPointer { + const root = rootPointer + return nativeModule()._GetPipelineContext(root!) } function waitVSync(pipelineContext: KPointer): Promise { @@ -70,9 +68,8 @@ function waitVSync(pipelineContext: KPointer): Promise { } export async function runEventLoop() { - const pipelineContext: pointer = getNativePipelineContext() - for (let i = 0; i < 5; i++) { - nativeModule()._RunApplication(i, i * i) + const pipelineContext = getNativePipelineContext() + while (!nativeModule()._RunApplication(0, 0)) { await waitVSync(pipelineContext!) } } @@ -179,7 +176,7 @@ export function checkLoader(variant: string): int32 { let result = nativeModule()._LoadVirtualMachine(vm, classPath, nativePath) if (result == 0) { - nativeModule()._StartApplication(); + rootPointer = nativeModule()._StartApplication(); setTimeout(async () => runEventLoop(), 0) } else { throw new Error(`Cannot start VM: ${result}`) diff --git a/predefined/sys/loader.idl b/predefined/sys/loader.idl index d73c3120..f4746370 100644 --- a/predefined/sys/loader.idl +++ b/predefined/sys/loader.idl @@ -2,6 +2,6 @@ package "org.openharmony.idlize.predefined"; interface Loader { i32 LoadVirtualMachine(i32 arg0, String arg1, String arg2); - i32 RunApplication(i32 arg0, i32 arg1); - i32 StartApplication(); + boolean RunApplication(i32 arg0, i32 arg1); + pointer StartApplication(); }; -- Gitee From da87bb14656b2647ee990d2c673585a8ecf870e7 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Thu, 14 Nov 2024 16:54:05 +0000 Subject: [PATCH 03/53] !966 Fix running app --- external | 2 +- package.json | 4 ++-- .../src/org/koalaui/arkoala/Application.java | 24 +++++++++---------- peer_lib/sig/arkoala/loader/loader.ts | 6 ++--- predefined/sys/loader.idl | 2 +- rollup.config.dummy-panda.mjs | 4 ++-- tsconfig-loader.json | 11 +++++++-- 7 files changed, 30 insertions(+), 23 deletions(-) diff --git a/external b/external index 5f44a6e6..7fb0ab5e 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit 5f44a6e6df3d872ad2a15544f9027d6533f8f5b6 +Subproject commit 7fb0ab5e8d44f42b07b6ea962a917e9a0963df37 diff --git a/package.json b/package.json index c4460e96..f6af3b92 100644 --- a/package.json +++ b/package.json @@ -119,8 +119,8 @@ "compile:dummy-panda": "npm run compile:java && npm run rollup:host:subset && cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs", "run:dummy-panda:java": "npm run compile:java && npm run compile:native-node-host-java-subset && java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Application", "run:dummy-panda:panda": "rimraf build && npm run make:arkts && bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-application.json && npm run compile:native-node-host-arkts-subset && LD_LIBRARY_PATH=./native PANDA_LIB_PATH=./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/ bash ./external/incremental/tools/panda/arkts/ark --ark-boot-files ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/Application.abc", - "run:app:java": "npm run compile:dummy-panda && node lib/loader.js java", - "run:app:panda": "npm run rollup:host:subset && cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs && npm run make:arkts && bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-application.json && npm run compile:native-node-host-arkts-subset && PANDA_HOME=./external/incremental/tools/panda/node_modules/@panda/sdk node lib/loader.js panda", + "run:app:java": "npm run compile:dummy-panda && ACE_LIBRARY_PATH=./native node lib/loader.js java", + "run:app:panda": "cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs && npm run compile:all:arkts:idl && PANDA_HOME=./external/incremental/tools/panda/node_modules/@panda/sdk ACE_LIBRARY_PATH=./native node lib/loader.js panda", "run:es2panda": "npm run compile && npm run compile:dummy-panda && node lib/loader.js es2panda", "compile:native-ohos-subset-arm32": "npm run check:subset && node ./native/nativeBuild.mjs subset arm32", "compile:native-ohos-subset-arm64": "npm run check:subset && node ./native/nativeBuild.mjs subset arm64", diff --git a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java index a254ce9b..8e85be6e 100644 --- a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java +++ b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java @@ -13,16 +13,14 @@ * limitations under the License. */ - -// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! - package org.koalaui.arkoala; public class Application { Application() {} public static void main(String[] args) { - var app = Application.startApplication(); + var app = Application.createApplication(); + var root = app.start("init", ""); try { for (int i = 0; i < 10; i++) { app.loopIteration(i, 0); @@ -33,19 +31,20 @@ public class Application { } } - public static Application startApplication() { - NativeModule._NativeLog("NativeModule.startApplication"); - return new Application().start(); + public static Application createApplication() { + NativeModule._NativeLog("NativeModule.createApplication"); + return new Application(); } - public void enter(int arg0, int arg1) { - loopIteration(arg0, arg1); + public boolean enter(int arg0, int arg1) { + return loopIteration(arg0, arg1); } - public void loopIteration(int arg0, int arg1) { + public boolean loopIteration(int arg0, int arg1) { checkEvents(arg0); updateState(); render(); + return true; } void checkEvents(int what) { @@ -61,7 +60,8 @@ public class Application { System.out.println("JAVA: render"); } - public Application start() { - return this; + public long start(String app, String params) { + System.out.println("JAVA: start " + app + " , params=" + params); + return 42; } } diff --git a/peer_lib/sig/arkoala/loader/loader.ts b/peer_lib/sig/arkoala/loader/loader.ts index 716d79c5..e5539097 100644 --- a/peer_lib/sig/arkoala/loader/loader.ts +++ b/peer_lib/sig/arkoala/loader/loader.ts @@ -20,7 +20,7 @@ import { KInt, KPointer, KUint8ArrayPtr, pointer } from "./types" export interface LoaderOps { _LoadVirtualMachine(vmKind: int32, appClassPath: string, appLibPath: string): int32 - _StartApplication(): KPointer + _StartApplication(arg0: string, arg1: string): KPointer _RunApplication(arg0: int32, arg1: int32): boolean _SetCallbackDispatcher(dispatcher: (id: int32, args: Uint8Array, length: int32) => int32): void } @@ -165,7 +165,7 @@ export function checkLoader(variant: string): int32 { } case 'panda': { vm = 2 - classPath = __dirname + "/../out/abc-subset/sig/arkoala-arkts/arkui/src/generated" + classPath = __dirname + "/../external/arkoala-arkts/framework/build/abc/trivial" break } case 'es2panda': { @@ -176,7 +176,7 @@ export function checkLoader(variant: string): int32 { let result = nativeModule()._LoadVirtualMachine(vm, classPath, nativePath) if (result == 0) { - rootPointer = nativeModule()._StartApplication(); + rootPointer = nativeModule()._StartApplication("LoaderApp", "LoaderAppParams"); setTimeout(async () => runEventLoop(), 0) } else { throw new Error(`Cannot start VM: ${result}`) diff --git a/predefined/sys/loader.idl b/predefined/sys/loader.idl index f4746370..dc32a327 100644 --- a/predefined/sys/loader.idl +++ b/predefined/sys/loader.idl @@ -3,5 +3,5 @@ package "org.openharmony.idlize.predefined"; interface Loader { i32 LoadVirtualMachine(i32 arg0, String arg1, String arg2); boolean RunApplication(i32 arg0, i32 arg1); - pointer StartApplication(); + pointer StartApplication(String appUrl, String appParams); }; diff --git a/rollup.config.dummy-panda.mjs b/rollup.config.dummy-panda.mjs index e5a61d4b..a53f320d 100644 --- a/rollup.config.dummy-panda.mjs +++ b/rollup.config.dummy-panda.mjs @@ -63,7 +63,6 @@ export default { }, external: [], plugins: [ - commonjs(), typescript({ outputToFilesystem: false, module: "ESNext", @@ -74,8 +73,9 @@ export default { tsconfig: tsconfigFile, filterRoot: '.' }), + commonjs(), nodeResolve({ - extensions: [".js", ".mjs", ".cjs", ".ts", ".cts", ".mts"] + // extensions: [".js", ".mjs", ".cjs"] }), replace({ 'LOAD_NATIVE': `require('${crossPathRelative(outDir, 'native/NativeBridgeNapi.node')}')`, diff --git a/tsconfig-loader.json b/tsconfig-loader.json index 5e760241..58464493 100644 --- a/tsconfig-loader.json +++ b/tsconfig-loader.json @@ -13,11 +13,18 @@ "skipLibCheck": true, "removeComments": false, "outDir": "build/lib", - "rootDirs": ["src"], + "rootDirs": ["peer_lib/sig/arkoala/loader", "external/incremental", "external/interop"], "module": "CommonJS", + "baseUrl": ".", "paths": { - "@koalaui/common": ["./external/incremental/compat/src/typescript"] + "@koalaui/interop": ["./external/interop/src/arkts"], + "@koalaui/common": ["./external/incremental/common/src"], + "@koalaui/compat": ["./external/incremental/compat/src/typescript"], } }, "include": ["peer_lib/sig/arkoala/loader/*.ts"], + "references": [ + { "path": "./external/incremental/common" }, + { "path": "./external/interop" }, + ], } -- Gitee From 083a82de5645a896baa6d6a4054f9dcde72135c4 Mon Sep 17 00:00:00 2001 From: Peter Z Date: Fri, 15 Nov 2024 07:36:18 +0000 Subject: [PATCH 04/53] !943 Cleaned up PeerFile, PeerClass etc * IdlPeer* -> Peer* * Replaced EnumEntity/EnumMember with IDLEnum/IDLEnumMember * Moved printers from idl/ to printers/ --- external | 2 +- src/main.ts | 12 +-- src/peer-generation/BuilderClass.ts | 4 +- src/peer-generation/FileGenerators.ts | 22 ++--- .../LanguageWriters/LanguageWriter.ts | 15 ++-- .../writers/CJLanguageWriter.ts | 15 ++-- .../writers/CppLanguageWriter.ts | 11 +-- .../writers/ETSLanguageWriter.ts | 22 +++-- src/peer-generation/Materialized.ts | 10 +-- src/peer-generation/OhosGenerator.ts | 12 +-- src/peer-generation/PeerClass.ts | 33 +++++++ src/peer-generation/PeerFile.ts | 41 ++++++--- .../{idl/IdlPeerLibrary.ts => PeerLibrary.ts} | 50 +++++------ .../{idl/IdlPeerMethod.ts => PeerMethod.ts} | 22 +++-- src/peer-generation/ReferenceResolver.ts | 4 +- src/peer-generation/Tracker.ts | 14 +-- src/peer-generation/arkoala.ts | 12 +-- src/peer-generation/idl/DependencySorter.ts | 10 +-- src/peer-generation/idl/IdlPeerClass.ts | 57 ------------ src/peer-generation/idl/IdlPeerFile.ts | 48 ---------- .../idl/IdlPeerGeneratorVisitor.ts | 89 +++++++++---------- .../idl/IdlSyntheticDeclarations.ts | 4 +- src/peer-generation/plugin-api.ts | 4 +- .../printers/BridgeCcPrinter.ts | 50 +++++------ .../printers/BuilderClassPrinter.ts | 10 +-- .../printers/CallbacksPrinter.ts | 29 +++--- .../printers/ComponentsPrinter.ts | 24 ++--- .../ConflictedDeclarationsPrinter.ts} | 18 ++-- .../printers/ConvertorsPrinter.ts | 6 +- .../printers/DeclarationPrinter.ts | 5 +- src/peer-generation/printers/EventsPrinter.ts | 28 +++--- src/peer-generation/printers/GniPrinter.ts | 10 +-- src/peer-generation/printers/HeaderPrinter.ts | 22 ++--- .../{idl => printers}/InterfacePrinter.ts | 55 +++++------- .../printers/MaterializedPrinter.ts | 14 +-- src/peer-generation/printers/MesonPrinter.ts | 10 +-- .../printers/ModifierPrinter.ts | 44 ++++----- .../printers/NativeModulePrinter.ts | 20 ++--- .../printers/NativeModuleRecorderPrinter.ts | 19 ++-- .../printers/NodeTypesPrinter.ts | 6 +- .../printers/OverloadsPrinter.ts | 16 ++-- src/peer-generation/printers/PeersPrinter.ts | 52 +++++------ .../printers/SerializerPrinter.ts | 16 ++-- .../{idl => printers}/StructPrinter.ts | 18 ++-- .../printers/TypeCheckPrinter.ts | 18 ++-- .../printers/lang/CJPrinters.ts | 6 +- .../printers/lang/JavaPrinters.ts | 12 +-- src/skoala-generation/idl/idlSkoalaLibrary.ts | 2 +- 48 files changed, 466 insertions(+), 557 deletions(-) rename src/peer-generation/{idl/IdlPeerLibrary.ts => PeerLibrary.ts} (92%) rename src/peer-generation/{idl/IdlPeerMethod.ts => PeerMethod.ts} (84%) delete mode 100644 src/peer-generation/idl/IdlPeerClass.ts delete mode 100644 src/peer-generation/idl/IdlPeerFile.ts rename src/peer-generation/{idl/ConflictedDeclarationsPrinterIdl.ts => printers/ConflictedDeclarationsPrinter.ts} (86%) rename src/peer-generation/{idl => printers}/InterfacePrinter.ts (94%) rename src/peer-generation/{idl => printers}/StructPrinter.ts (97%) diff --git a/external b/external index 7fb0ab5e..8e83109a 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit 7fb0ab5e8d44f42b07b6ea962a917e9a0963df37 +Subproject commit 8e83109a2eccf8456828cad82689a562349dfd7b diff --git a/src/main.ts b/src/main.ts index 88c49ef6..12cbf295 100644 --- a/src/main.ts +++ b/src/main.ts @@ -28,8 +28,8 @@ import { defaultCompilerOptions, toSet } from "./util" import { initRNG } from "./rand_utils" import { PeerGeneratorConfig } from "./peer-generation/PeerGeneratorConfig" import { generateTracker } from "./peer-generation/Tracker" -import { IdlPeerLibrary } from "./peer-generation/idl/IdlPeerLibrary" -import { IdlPeerFile } from "./peer-generation/idl/IdlPeerFile" +import { PeerLibrary } from "./peer-generation/PeerLibrary" +import { PeerFile } from "./peer-generation/PeerFile" import { IdlPeerGeneratorVisitor, IdlPeerProcessor, @@ -293,7 +293,7 @@ if (options.dts2peer) { const generatedPeersDir = options.outputDir ?? "./out/ts-peers/generated" const lang = Language.fromString(options.language ?? "ts") - function scanPredefinedDirectory(dir: string, ...subdirs: string[]): IdlPeerFile[] { + function scanPredefinedDirectory(dir: string, ...subdirs: string[]): PeerFile[] { dir = path.join(dir, ...subdirs) return fs.readdirSync(dir) .filter(it => it.endsWith(".idl")) @@ -301,14 +301,14 @@ if (options.dts2peer) { const idlFile = path.resolve(path.join(dir, it)) const content = fs.readFileSync(path.resolve(path.join(dir, it))).toString() const nodes = webidl2.parse(content).map(it => toIDLNode(idlFile, it)) - return new IdlPeerFile(idlFile, nodes, new Set(), true) + return new PeerFile(idlFile, nodes, new Set(), true) }) } const PREDEFINED_PATH = path.join(__dirname, "..", "predefined") options.docs = "all" - const idlLibrary = new IdlPeerLibrary(lang, toSet(options.generateInterface)) + const idlLibrary = new PeerLibrary(lang, toSet(options.generateInterface)) // collect predefined files scanPredefinedDirectory(PREDEFINED_PATH, "sys").forEach(file => { IdlPredefinedGeneratorVisitor.create({ @@ -335,7 +335,7 @@ if (options.dts2peer) { compilerOptions: defaultCompilerOptions, onSingleFile(entries: IDLEntry[], outputDir, sourceFile) { entries.forEach(transformMethodsAsync2ReturnPromise) - const file = new IdlPeerFile(sourceFile.fileName, entries, idlLibrary.componentsToGenerate) + const file = new PeerFile(sourceFile.fileName, entries, idlLibrary.componentsToGenerate) idlLibrary.files.push(file) }, onEnd(outDir) { diff --git a/src/peer-generation/BuilderClass.ts b/src/peer-generation/BuilderClass.ts index 4d2381f9..55bb1878 100644 --- a/src/peer-generation/BuilderClass.ts +++ b/src/peer-generation/BuilderClass.ts @@ -17,7 +17,7 @@ import { Field, Method, MethodModifier, MethodSignature, NamedMethodSignature } import { SuperElement } from "./Materialized" import { ImportFeature } from "./ImportsCollector" import { Language } from "../Language"; -import { IdlPeerLibrary } from "./idl/IdlPeerLibrary"; +import { PeerLibrary } from "./PeerLibrary"; import { convertTypeToFeature } from "./idl/IdlPeerGeneratorVisitor"; import { createReferenceType, IDLThisType, IDLType, IDLVoidType, maybeOptional, toIDLType } from "../idl" @@ -42,7 +42,7 @@ export class BuilderClass { export const CUSTOM_BUILDER_CLASSES: BuilderClass[] = [] const CUSTOM_BUILDER_CLASSES_SET: Set = new Set() -export function initCustomBuilderClasses(library: IdlPeerLibrary) { +export function initCustomBuilderClasses(library: PeerLibrary) { CUSTOM_BUILDER_CLASSES.push( new BuilderClass("Indicator", ["T"], false, undefined, [], // fields diff --git a/src/peer-generation/FileGenerators.ts b/src/peer-generation/FileGenerators.ts index 4f52cd8d..59707aef 100644 --- a/src/peer-generation/FileGenerators.ts +++ b/src/peer-generation/FileGenerators.ts @@ -23,7 +23,7 @@ import { writeDeserializer, writeSerializer } from "./printers/SerializerPrinter import { SELECTOR_ID_PREFIX, writeConvertors } from "./printers/ConvertorsPrinter" import { ArkoalaInstall, LibaceInstall } from "../Install" import { ImportsCollector } from "./ImportsCollector" -import { IdlPeerLibrary } from "./idl/IdlPeerLibrary" +import { PeerLibrary } from "./PeerLibrary" import { writeARKTSTypeCheckers, writeTSTypeCheckers } from "./printers/TypeCheckPrinter" import { Language } from "../Language" import { printCallbacksKinds, printCallbacksKindsImports, printDeserializeAndCall } from "./printers/CallbacksPrinter" @@ -152,7 +152,7 @@ export function appendModifiersCommonPrologue(): LanguageWriter { return result } -export function getNodeTypes(library: IdlPeerLibrary): string[] { +export function getNodeTypes(library: PeerLibrary): string[] { const components: string[] = [] for (const file of library.files) { for (const peer of file.peers.values()) { @@ -162,7 +162,7 @@ export function getNodeTypes(library: IdlPeerLibrary): string[] { return [...PeerGeneratorConfig.customNodeTypes, ...components.sort()] } -export function appendViewModelBridge(library: IdlPeerLibrary): LanguageWriter { +export function appendViewModelBridge(library: PeerLibrary): LanguageWriter { let result = createLanguageWriter(Language.CPP, createEmptyReferenceResolver()) let body = readTemplate('view_model_bridge.cc') @@ -275,7 +275,7 @@ export function accessorStructList(lines: LanguageWriter): LanguageWriter { return result } -export function makeTSSerializer(library: IdlPeerLibrary): LanguageWriter { +export function makeTSSerializer(library: PeerLibrary): LanguageWriter { let printer = createLanguageWriter(library.language, getReferenceResolver(library)) printer.writeLines(cStyleCopyright) const imports = new ImportsCollector() @@ -299,7 +299,7 @@ export function makeTSSerializer(library: IdlPeerLibrary): LanguageWriter { return printer } -export function makeSerializerForOhos(library: IdlPeerLibrary, nativeModule: { name: string, path: string }, declarationPath?: string): LanguageWriter { +export function makeSerializerForOhos(library: PeerLibrary, nativeModule: { name: string, path: string }, declarationPath?: string): LanguageWriter { // TODO Add Java and migrate arkoala code if (library.language == Language.TS || library.language == Language.ARKTS) { let printer = createLanguageWriter(library.language, getReferenceResolver(library)) @@ -319,7 +319,7 @@ export function makeSerializerForOhos(library: IdlPeerLibrary, nativeModule: { n } } -export function makeTypeChecker(library: IdlPeerLibrary): { arkts: string, ts: string } { +export function makeTypeChecker(library: PeerLibrary): { arkts: string, ts: string } { let arktsPrinter = createLanguageWriter(Language.ARKTS, createEmptyReferenceResolver()) writeARKTSTypeCheckers(library, arktsPrinter) let tsPrinter = createLanguageWriter(Language.TS, createEmptyReferenceResolver()) @@ -330,7 +330,7 @@ export function makeTypeChecker(library: IdlPeerLibrary): { arkts: string, ts: s } } -export function makeConverterHeader(path: string, namespace: string, library: IdlPeerLibrary): LanguageWriter { +export function makeConverterHeader(path: string, namespace: string, library: PeerLibrary): LanguageWriter { const converter = new CppLanguageWriter(new IndentedPrinter(), library) converter.writeLines(cStyleCopyright) converter.writeLines(`/* @@ -363,7 +363,7 @@ export function makeConverterHeader(path: string, namespace: string, library: Id return converter } -export function makeCSerializers(library: IdlPeerLibrary, structs: LanguageWriter, typedefs: IndentedPrinter): string { +export function makeCSerializers(library: PeerLibrary, structs: LanguageWriter, typedefs: IndentedPrinter): string { const serializers = createLanguageWriter(Language.CPP, library) const writeToString = createLanguageWriter(Language.CPP, library) @@ -385,7 +385,7 @@ ${serializers.getOutput().join("\n")} ` } -export function makeTSDeserializer(library: IdlPeerLibrary): string { +export function makeTSDeserializer(library: PeerLibrary): string { const deserializer = createLanguageWriter(Language.TS, library) writeDeserializer(library, deserializer) return `${cStyleCopyright} @@ -551,7 +551,7 @@ ${content} ` } -export function makeDeserializeAndCall(library: IdlPeerLibrary, language: Language, fileName: string): SourceFile { +export function makeDeserializeAndCall(library: PeerLibrary, language: Language, fileName: string): SourceFile { const writer = SourceFile.make(fileName, language, library) printDeserializeAndCall(library, writer) return writer @@ -623,7 +623,7 @@ export function makeCEventsLibaceImpl(implData: PrinterLike, receiversList: Prin return writer.getOutput().join('\n') } -export function makeCallbacksKinds(library: IdlPeerLibrary, language: Language): string { +export function makeCallbacksKinds(library: PeerLibrary, language: Language): string { const writer = createLanguageWriter(language, library) printCallbacksKindsImports(language, writer) printCallbacksKinds(library, writer) diff --git a/src/peer-generation/LanguageWriters/LanguageWriter.ts b/src/peer-generation/LanguageWriters/LanguageWriter.ts index 2f06e924..bfa25551 100644 --- a/src/peer-generation/LanguageWriters/LanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/LanguageWriter.ts @@ -17,7 +17,6 @@ import * as idl from "../../idl" import { IndentedPrinter } from "../../IndentedPrinter" import { stringOrNone } from "../../util" import {ArgConvertor, BaseArgConvertor, RuntimeType} from "../ArgConvertors" -import { EnumEntity } from "../PeerFile" import * as fs from "fs" import { Language } from "../../Language" import { EnumConvertor } from "../ArgConvertors" @@ -226,16 +225,16 @@ export class CheckOptionalStatement implements LanguageStatement { // maybe rename or move of fix export class TsEnumEntityStatement implements LanguageStatement { - constructor(private readonly enumEntity: EnumEntity, private readonly isExport: boolean) {} + constructor(private readonly enumEntity: idl.IDLEnum, private readonly isExport: boolean) {} write(writer: LanguageWriter) { - writer.print(this.enumEntity.comment.length > 0 ? this.enumEntity.comment : undefined) + writer.print(this.enumEntity.comment) writer.print(`${this.isExport ? "export " : ""}enum ${this.enumEntity.name} {`) writer.pushIndent() - this.enumEntity.members.forEach((member, index) => { - writer.print(member.comment.length > 0 ? member.comment : undefined) - const commaOp = index < this.enumEntity.members.length - 1 ? ',' : '' - const initValue = member.initializerText ? ` = ${member.initializerText}` : `` + this.enumEntity.elements.forEach((member, index) => { + writer.print(member.comment) + const commaOp = index < this.enumEntity.elements.length - 1 ? ',' : '' + const initValue = member.initializer ? ` = ${member.initializer}` : `` writer.print(`${member.name}${initValue}${commaOp}`) }) writer.popIndent() @@ -643,7 +642,7 @@ export abstract class LanguageWriter { makeCallIsResource(value: string): LanguageExpression { return this.makeString(`isResource(${value})`) } - makeEnumEntity(enumEntity: EnumEntity, isExport: boolean): LanguageStatement { + makeEnumEntity(enumEntity: idl.IDLEnum, isExport: boolean): LanguageStatement { return new TsEnumEntityStatement(enumEntity, isExport) } makeFieldModifiersList(modifiers: FieldModifier[] | undefined, customFieldFilter?: (field :FieldModifier) => boolean) : string { diff --git a/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts index b4e5525b..82404d22 100644 --- a/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts @@ -21,7 +21,6 @@ import { CJKeywords } from "../../../languageSpecificKeywords" import { isDefined } from "../../../util" import { ArgConvertor, BaseArgConvertor, RuntimeType } from "../../ArgConvertors" import { EnumConvertor } from "../../ArgConvertors" -import { EnumEntity } from "../../PeerFile" import { ReferenceResolver } from "../../ReferenceResolver" import { AssignStatement, @@ -125,16 +124,16 @@ class CJMapForEachStatement implements LanguageStatement { } export class CJEnumEntityStatement implements LanguageStatement { - constructor(private readonly enumEntity: EnumEntity, private readonly isExport: boolean) {} + constructor(private readonly enumEntity: idl.IDLEnum, private readonly isExport: boolean) {} write(writer: LanguageWriter) { - writer.print(this.enumEntity.comment.length > 0 ? this.enumEntity.comment : undefined) + writer.print(this.enumEntity.comment) writer.print(`${this.isExport ? "public " : ""}enum ${this.enumEntity.name} {`) writer.pushIndent() - this.enumEntity.members.forEach((member, index) => { - writer.print(member.comment.length > 0 ? member.comment : undefined) - const varticalBar = index < this.enumEntity.members.length - 1 ? '|' : '' - const initValue = member.initializerText ? ` = ${member.initializerText}` : `` + this.enumEntity.elements.forEach((member, index) => { + writer.print(member.comment) + const varticalBar = index < this.enumEntity.elements.length - 1 ? '|' : '' + const initValue = member.initializer ? ` = ${member.initializer}` : `` writer.print(`${member.name}${initValue}${varticalBar}`) }) writer.popIndent() @@ -392,7 +391,7 @@ export class CJLanguageWriter extends LanguageWriter { ordinalFromEnum(value: LanguageExpression, _: idl.IDLEnum): LanguageExpression { throw new Error('Not yet implemented') } - makeEnumEntity(enumEntity: EnumEntity, isExport: boolean): LanguageStatement { + makeEnumEntity(enumEntity: idl.IDLEnum, isExport: boolean): LanguageStatement { return new CJEnumEntityStatement(enumEntity, isExport) } runtimeType(param: ArgConvertor, valueType: string, value: string) { diff --git a/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts index 2ab01f1e..af5b03db 100644 --- a/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts @@ -46,7 +46,6 @@ import { } from "./CLikeLanguageWriter" import { ReferenceResolver } from "../../ReferenceResolver" import { IdlNameConvertor, TypeConvertor } from "../nameConvertor" -import { EnumEntity } from "../../PeerFile" import { throwException } from "../../../util"; import { CppIDLNodeToStringConvertor } from "../convertors/CppConvertors" @@ -137,14 +136,12 @@ class CppMapForEachStatement implements LanguageStatement { } class CppEnumEntityStatement implements LanguageStatement { - constructor(private _enum: EnumEntity) {} + constructor(private _enum: IDLEnum) {} write(writer: LanguageWriter): void { writer.print(`typedef enum ${this._enum.name} {`) writer.pushIndent() - for (let i = 0; i < this._enum.members.length; i++) { - const member = this._enum.members[i] - writer.print(`${member.name} = ${member.initializerText ?? i},`) - } + this._enum.elements.forEach((member, index) => + writer.print(`${member.name} = ${member.initializer ?? index},`)) writer.popIndent() writer.print(`} ${this._enum.name};`) } @@ -397,7 +394,7 @@ export class CppLanguageWriter extends CLikeLanguageWriter { override escapeKeyword(name: string): string { return cppKeywords.has(name) ? name + "_" : name } - makeEnumEntity(enumEntity: EnumEntity, isExport: boolean): LanguageStatement { + makeEnumEntity(enumEntity: IDLEnum, isExport: boolean): LanguageStatement { return new CppEnumEntityStatement(enumEntity) } private decayTypeName(typeName: string) { diff --git a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts index 85ea45c3..da9d74a7 100644 --- a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts @@ -14,7 +14,6 @@ */ import { IndentedPrinter } from "../../../IndentedPrinter" -import { capitalize } from "../../../util" import { FieldModifier, LanguageExpression, @@ -28,12 +27,11 @@ import { } from "../LanguageWriter" import { TSLambdaExpression, TSLanguageWriter } from "./TsLanguageWriter" import { IDLEnum, IDLI32Type, IDLThisType, IDLType, IDLVoidType, toIDLType } from '../../../idl' -import { EnumEntity } from "../../PeerFile" import {AggregateConvertor, ArgConvertor, ArrayConvertor, BaseArgConvertor, CustomTypeConvertor, EnumConvertor, InterfaceConvertor, makeInterfaceTypeCheckerCall, RuntimeType} from "../../ArgConvertors" import { Language } from "../../../Language" import { ReferenceResolver } from "../../ReferenceResolver" import { EtsIDLNodeToStringConvertor } from "../convertors/ETSConvertors" -import {IdlPeerLibrary} from "../../idl/IdlPeerLibrary"; +import {PeerLibrary} from "../../PeerLibrary"; import {makeEnumTypeCheckerCall} from "../../printers/TypeCheckPrinter"; //////////////////////////////////////////////////////////////// @@ -65,16 +63,16 @@ class ArkTSMapForEachStatement implements LanguageStatement { } export class ArkTSEnumEntityStatement implements LanguageStatement { - constructor(private readonly enumEntity: EnumEntity, private readonly isExport: boolean) {} + constructor(private readonly enumEntity: IDLEnum, private readonly isExport: boolean) {} write(writer: LanguageWriter) { - writer.print(this.enumEntity.comment.length > 0 ? this.enumEntity.comment : undefined) + writer.print(this.enumEntity.comment) writer.writeClass(this.enumEntity.name, (writer) => { let isTypeString = true - this.enumEntity.members.forEach((member, index) => { - writer.print(member.comment.length > 0 ? member.comment : undefined) - const initText = member.initializerText?.replaceAll('"', '').replaceAll("'", "") ?? `${index}` - isTypeString &&= isNaN(Number(initText)) + this.enumEntity.elements.forEach((member, index) => { + writer.print(member.comment) + const initText = member.initializer ?? index + isTypeString &&= (typeof initText !== "number") const ctorArgs = [ isTypeString ? `"${initText}"` : initText, isTypeString ? index : undefined @@ -105,7 +103,7 @@ export class ArkTSEnumEntityStatement implements LanguageStatement { } writer.writeMethodImplementation(new Method("of", new MethodSignature(toIDLType(this.enumEntity.name), [argTypes[0]]), [MethodModifier.PUBLIC, MethodModifier.STATIC]), (writer)=> { - this.enumEntity.members.forEach((member) => { + this.enumEntity.elements.forEach(member => { const memberName = `${this.enumEntity.name}.${member.name}` writer.writeStatement( writer.makeCondition( @@ -212,7 +210,7 @@ export class ETSLanguageWriter extends TSLanguageWriter { makeCallIsResource(value: string): LanguageExpression { return this.makeString(`isResource(${value})`); } - makeEnumEntity(enumEntity: EnumEntity, isExport: boolean): LanguageStatement { + makeEnumEntity(enumEntity: IDLEnum, isExport: boolean): LanguageStatement { return new ArkTSEnumEntityStatement(enumEntity, isExport); } getObjectAccessor(convertor: ArgConvertor, value: string, args?: ObjectArgs): string { @@ -279,7 +277,7 @@ export class ETSLanguageWriter extends TSLanguageWriter { } if (convertor instanceof ArrayConvertor) { return makeArrayTypeCheckCall(value, - (this.resolver as IdlPeerLibrary).getTypeName(convertor.idlType), this) + (this.resolver as PeerLibrary).getTypeName(convertor.idlType), this) } if (convertor instanceof EnumConvertor) { return this.makeString(`${value} instanceof ${this.typeConvertor.convert(convertor.enumEntry)}`) diff --git a/src/peer-generation/Materialized.ts b/src/peer-generation/Materialized.ts index 76e91e65..ed0f8c39 100644 --- a/src/peer-generation/Materialized.ts +++ b/src/peer-generation/Materialized.ts @@ -18,9 +18,9 @@ import { Field, Method, MethodModifier } from "./LanguageWriters" import { capitalize } from "../util" import { ImportFeature, ImportsCollector } from "./ImportsCollector" import { IDLType } from "../idl" -import { IdlPeerMethod } from "./idl/IdlPeerMethod"; +import { PeerMethod } from "./PeerMethod"; import { PeerClassBase } from "./PeerClass"; -import { IdlPeerLibrary } from "./idl/IdlPeerLibrary" +import { PeerLibrary } from "./PeerLibrary" export class MaterializedField { constructor( @@ -31,7 +31,7 @@ export class MaterializedField { ) { } } -export class MaterializedMethod extends IdlPeerMethod { +export class MaterializedMethod extends PeerMethod { constructor( originalParentName: string, argConvertors: ArgConvertor[], @@ -129,7 +129,7 @@ export class MaterializedClass implements PeerClassBase { public readonly methods: MaterializedMethod[], public readonly needBeGenerated: boolean = true, ) { - IdlPeerMethod.markAndGroupOverloads(methods) + PeerMethod.markAndGroupOverloads(methods) } getComponentName(): string { @@ -145,7 +145,7 @@ export class MaterializedClass implements PeerClassBase { } } -export function collectMaterializedImports(imports: ImportsCollector, library: IdlPeerLibrary, level: string = "") { +export function collectMaterializedImports(imports: ImportsCollector, library: PeerLibrary, level: string = "") { for (const materialized of library.materializedClasses.keys()) { imports.addFeature(materialized, `${level}Ark${materialized}Materialized`) } diff --git a/src/peer-generation/OhosGenerator.ts b/src/peer-generation/OhosGenerator.ts index 5b55fac4..3b0cf026 100644 --- a/src/peer-generation/OhosGenerator.ts +++ b/src/peer-generation/OhosGenerator.ts @@ -17,6 +17,7 @@ import * as fs from 'fs' import * as path from 'path' import { createContainerType, createReferenceType, forceAsNamedNode, hasExtAttribute, IDLCallback, IDLConstructor, IDLEntry, IDLEnum, IDLExtendedAttributes, IDLI32Type, IDLInterface, IDLMethod, IDLNumberType, IDLParameter, IDLPointerType, IDLType, IDLU8Type, IDLVoidType, isCallback, isClass, isConstructor, isContainerType, isEnum, isInterface, isMethod, isReferenceType, isType, isUnionType, maybeOptional } from '../idl' import { IndentedPrinter } from "../IndentedPrinter" +import { PeerLibrary } from './PeerLibrary' import { Language } from '../Language' import { capitalize } from '../util' import { ArgConvertor, generateCallbackAPIArguments } from './ArgConvertors' @@ -24,8 +25,7 @@ import { PrimitiveType } from './ArkPrimitiveType' import { makeDeserializeAndCall, makeSerializerForOhos, readLangTemplate } from './FileGenerators' import { qualifiedName } from './idl/common' import { isMaterialized } from './idl/IdlPeerGeneratorVisitor' -import { IdlPeerLibrary } from './idl/IdlPeerLibrary' -import { StructPrinter } from './idl/StructPrinter' +import { StructPrinter } from './printers/StructPrinter' import { CppLanguageWriter, createLanguageWriter, ExpressionStatement, FieldModifier, LanguageExpression, LanguageWriter, Method, MethodSignature, NamedMethodSignature } from './LanguageWriters' import { printBridgeCcForOHOS } from './printers/BridgeCcPrinter' import { printCallbacksKinds, printManagedCaller } from './printers/CallbacksPrinter' @@ -58,7 +58,7 @@ class OHOSVisitor { callbacks = new Array() callbackInterfaces = new Array() - constructor(protected library: IdlPeerLibrary) { + constructor(protected library: PeerLibrary) { this.peerWriter = createLanguageWriter(this.library.language, this.library) this.nativeWriter = createLanguageWriter(this.library.language, this.library) } @@ -606,7 +606,7 @@ class OHOSVisitor { } } -export function generateOhos(outDir: string, peerLibrary: IdlPeerLibrary): void { +export function generateOhos(outDir: string, peerLibrary: PeerLibrary): void { const managedOutDir = path.join(outDir, peerLibrary.language.name.toLocaleLowerCase()) if (!fs.existsSync(outDir)) fs.mkdirSync(outDir) if (!fs.existsSync(managedOutDir)) fs.mkdirSync(managedOutDir) @@ -615,7 +615,7 @@ export function generateOhos(outDir: string, peerLibrary: IdlPeerLibrary): void visitor.execute(outDir, managedOutDir) } -function generateArgConvertor(library: IdlPeerLibrary, param: IDLParameter): ArgConvertor { +function generateArgConvertor(library: PeerLibrary, param: IDLParameter): ArgConvertor { if (!param.type) throw new Error("Type is needed") return library.typeConvertor(param.name, param.type, param.isOptional) } @@ -631,7 +631,7 @@ function generateCParameters(method: IDLMethod | IDLConstructor, argConvertors: return args.join(", ") } -function makePeerCallSignature(library: IdlPeerLibrary, parameters: IDLParameter[], returnType: IDLType, thisArg?: string) { +function makePeerCallSignature(library: PeerLibrary, parameters: IDLParameter[], returnType: IDLType, thisArg?: string) { // TODO remove duplicated code from NativeModuleVisitor::printPeerMethod (NativeModulePrinter.ts) const argConvertors = parameters.map(param => generateArgConvertor(library, param)) const args: ({name: string, type: IDLType})[] = thisArg ? [{ name: thisArg, type: IDLPointerType }] : [] diff --git a/src/peer-generation/PeerClass.ts b/src/peer-generation/PeerClass.ts index 3bac4752..882cf14a 100644 --- a/src/peer-generation/PeerClass.ts +++ b/src/peer-generation/PeerClass.ts @@ -13,6 +13,10 @@ * limitations under the License. */ +import { IDLProperty } from "../idl" +import { PeerMethod } from "./PeerMethod" +import { PeerFile } from "./PeerFile" + export interface PeerClassBase { setGenerationContext(context: string| undefined): void generatedName(isCallSignature: boolean): string @@ -20,3 +24,32 @@ export interface PeerClassBase { // TBD: update getComponentName(): string } + +export class PeerClass implements PeerClassBase { + constructor( + public readonly file: PeerFile, + public readonly componentName: string, + public readonly originalFilename: string, + ) { } + + setGenerationContext(context: string| undefined): void {} + + generatedName(isCallSignature: boolean): string{ + return isCallSignature ? this.originalInterfaceName! : this.originalClassName! + } + + getComponentName(): string { + return this.componentName + } + + methods: PeerMethod[] = [] + + originalClassName: string | undefined = undefined + originalInterfaceName: string | undefined = undefined + originalParentName: string | undefined = undefined + originalParentFilename: string | undefined = undefined + parentComponentName: string | undefined = undefined + attributesFields: IDLProperty[] = [] + attributesTypes: {typeName: string, content: string}[] = [] + hasGenericType: boolean = false +} \ No newline at end of file diff --git a/src/peer-generation/PeerFile.ts b/src/peer-generation/PeerFile.ts index 706f04f9..cfa3082e 100644 --- a/src/peer-generation/PeerFile.ts +++ b/src/peer-generation/PeerFile.ts @@ -13,21 +13,36 @@ * limitations under the License. */ -export class EnumEntity { +import * as idl from "../idl" +import { PeerClass } from "./PeerClass" +import { ImportFeature } from './ImportsCollector' + +export class PeerFile { + readonly peers: Map = new Map() + readonly declarations: Set = new Set() + readonly importFeatures: ImportFeature[] = [] + readonly serializeImportFeatures: ImportFeature[] = [] constructor( - public readonly name: string, - public readonly comment: string, - public readonly members: EnumMember[] = [], + public readonly originalFilename: string, + public readonly entries: idl.IDLEntry[], + private readonly componentsToGenerate: Set, + public readonly isPredefined: boolean = false ) {} - pushMember(name: string, comment: string, initializerText: string | undefined) { - this.members.push(new EnumMember(name, comment, initializerText)) + + + public packageName(): string { + let packageTag = this.entries.find(it => idl.isPackage(it)) as idl.IDLPackage + if (packageTag) return packageTag.name + return "" } -} -export class EnumMember { - constructor( - public readonly name: string, - public readonly comment: string, - public readonly initializerText: string | undefined, - ) {} + get enums(): idl.IDLEnum[] { + return this.entries.filter(it => idl.isEnum(it)) as idl.IDLEnum[] + } + get peersToGenerate(): PeerClass[] { + const peers = Array.from(this.peers.values()) + if (!this.componentsToGenerate.size) + return peers + return peers.filter(it => this.componentsToGenerate.has(it.componentName)) + } } diff --git a/src/peer-generation/idl/IdlPeerLibrary.ts b/src/peer-generation/PeerLibrary.ts similarity index 92% rename from src/peer-generation/idl/IdlPeerLibrary.ts rename to src/peer-generation/PeerLibrary.ts index e0b1ff67..f7a2f388 100644 --- a/src/peer-generation/idl/IdlPeerLibrary.ts +++ b/src/peer-generation/PeerLibrary.ts @@ -13,34 +13,32 @@ * limitations under the License. */ -import * as idl from '../../idl' -import { BuilderClass } from '../BuilderClass'; -import { MaterializedClass } from "../Materialized"; -import { IdlComponentDeclaration, isConflictingDeclaration, isMaterialized } from './IdlPeerGeneratorVisitor'; -import { IdlPeerFile } from "./IdlPeerFile"; -import { capitalize } from '../../util'; -import { AggregateConvertor, ArrayConvertor, CallbackConvertor, ClassConvertor, DateConvertor, EnumConvertor, FunctionConvertor, ImportTypeConvertor, InterfaceConvertor, MapConvertor, MaterializedClassConvertor, OptionConvertor, StringConvertor, TupleConvertor, TypeAliasConvertor, UnionConvertor } from '../ArgConvertors'; -import { PrimitiveType } from "../ArkPrimitiveType" -import { DependencySorter } from './DependencySorter'; -import { IndentedPrinter } from '../../IndentedPrinter'; -import { createLanguageWriter, createTypeNameConvertor, LanguageWriter, MethodSignature, TSLanguageWriter } from '../LanguageWriters'; -import { isImport, isStringEnum } from './common'; -import { StructPrinter } from './StructPrinter'; -import { PeerGeneratorConfig } from '../PeerGeneratorConfig'; -import { ArgConvertor, BooleanConvertor, CustomTypeConvertor, LengthConvertor, NullConvertor, NumberConvertor, UndefinedConvertor, VoidConvertor } from '../ArgConvertors'; -import { Language } from '../../Language'; -import { generateSyntheticFunctionName } from '../../IDLVisitor'; -import { collectUniqueCallbacks } from '../printers/CallbacksPrinter'; -import { IdlNameConvertor } from '../LanguageWriters/nameConvertor'; -import { LibraryInterface } from '../../LibraryInterface'; -import { IdlEntryManager } from './IdlEntryManager'; -import { IDLNodeToStringConvertor } from '../LanguageWriters/convertors/InteropConvertor'; - -export class IdlPeerLibrary implements LibraryInterface { +import * as idl from '../idl' +import { BuilderClass } from './BuilderClass'; +import { MaterializedClass } from "./Materialized"; +import { IdlComponentDeclaration, isConflictingDeclaration, isMaterialized } from './idl/IdlPeerGeneratorVisitor'; +import { PeerFile } from "./PeerFile"; +import { AggregateConvertor, ArrayConvertor, CallbackConvertor, ClassConvertor, DateConvertor, EnumConvertor, FunctionConvertor, ImportTypeConvertor, InterfaceConvertor, MapConvertor, MaterializedClassConvertor, OptionConvertor, StringConvertor, TupleConvertor, TypeAliasConvertor, UnionConvertor } from './ArgConvertors'; +import { PrimitiveType } from "./ArkPrimitiveType" +import { DependencySorter } from './idl/DependencySorter'; +import { IndentedPrinter } from '../IndentedPrinter'; +import { createTypeNameConvertor, LanguageWriter } from './LanguageWriters'; +import { isImport, isStringEnum } from './idl/common'; +import { StructPrinter } from './printers/StructPrinter'; +import { ArgConvertor, BooleanConvertor, CustomTypeConvertor, LengthConvertor, NullConvertor, NumberConvertor, UndefinedConvertor, VoidConvertor } from './ArgConvertors'; +import { Language } from '../Language'; +import { generateSyntheticFunctionName } from '../IDLVisitor'; +import { collectUniqueCallbacks } from './printers/CallbacksPrinter'; +import { IdlNameConvertor } from './LanguageWriters/nameConvertor'; +import { LibraryInterface } from '../LibraryInterface'; +import { IdlEntryManager } from './idl/IdlEntryManager'; +import { IDLNodeToStringConvertor } from './LanguageWriters/convertors/InteropConvertor'; + +export class PeerLibrary implements LibraryInterface { public readonly factory = new IdlEntryManager() - public readonly files: IdlPeerFile[] = [] + public readonly files: PeerFile[] = [] public readonly builderClasses: Map = new Map() public get buildersToGenerate(): BuilderClass[] { return Array.from(this.builderClasses.values()).filter(it => it.needBeGenerated) @@ -117,7 +115,7 @@ export class IdlPeerLibrary implements LibraryInterface { this.context = context } - findFileByOriginalFilename(filename: string): IdlPeerFile | undefined { + findFileByOriginalFilename(filename: string): PeerFile | undefined { return this.files.find(it => it.originalFilename === filename) } diff --git a/src/peer-generation/idl/IdlPeerMethod.ts b/src/peer-generation/PeerMethod.ts similarity index 84% rename from src/peer-generation/idl/IdlPeerMethod.ts rename to src/peer-generation/PeerMethod.ts index ed4537c7..272e6cd5 100644 --- a/src/peer-generation/idl/IdlPeerMethod.ts +++ b/src/peer-generation/PeerMethod.ts @@ -13,16 +13,14 @@ * limitations under the License. */ -import * as idl from "../../idl" -import { capitalize, isDefined } from "../../util" -import { ArgConvertor, RetConvertor } from "../ArgConvertors" -import { Method, MethodModifier } from "../LanguageWriters" -import { PrimitiveType } from "../ArkPrimitiveType" -import { IDLCallback, IDLEntry, IDLType } from "../../idl" -import { mangleMethodName } from "../LanguageWriters/LanguageWriter" -import { IdlNameConvertor } from "../LanguageWriters/nameConvertor" +import { capitalize, isDefined } from "../util" +import { ArgConvertor, RetConvertor } from "./ArgConvertors" +import { Method, MethodModifier } from "./LanguageWriters" +import { PrimitiveType } from "./ArkPrimitiveType" +import { mangleMethodName } from "./LanguageWriters/LanguageWriter" +import { IdlNameConvertor } from "./LanguageWriters/nameConvertor" -export class IdlPeerMethod { +export class PeerMethod { private overloadIndex?: number constructor( public originalParentName: string, @@ -98,8 +96,8 @@ export class IdlPeerMethod { } } - static markAndGroupOverloads(methods: IdlPeerMethod[]): IdlPeerMethod[] { - let groupedMethods: IdlPeerMethod[] = [] + static markAndGroupOverloads(methods: PeerMethod[]): PeerMethod[] { + let groupedMethods: PeerMethod[] = [] for (const peerMethod of methods) { if (isDefined(peerMethod.overloadIndex)) continue const sameNamedMethods = methods.filter(it => it.method.name === peerMethod.method.name) @@ -110,7 +108,7 @@ export class IdlPeerMethod { return groupedMethods } - setSameOverloadIndex(copyFrom: IdlPeerMethod) { + setSameOverloadIndex(copyFrom: PeerMethod) { this.overloadIndex = copyFrom.overloadIndex } } diff --git a/src/peer-generation/ReferenceResolver.ts b/src/peer-generation/ReferenceResolver.ts index 787b45cf..bc6076ef 100644 --- a/src/peer-generation/ReferenceResolver.ts +++ b/src/peer-generation/ReferenceResolver.ts @@ -14,7 +14,7 @@ */ import * as idl from "../idl"; -import { IdlPeerLibrary } from "./idl/IdlPeerLibrary"; +import { PeerLibrary } from "./PeerLibrary"; export interface ReferenceResolver { resolveTypeReference(type: idl.IDLReferenceType, entries?: idl.IDLEntry[]): idl.IDLEntry | undefined @@ -32,6 +32,6 @@ export function createEmptyReferenceResolver(): ReferenceResolver { } } -export function getReferenceResolver(library: IdlPeerLibrary): ReferenceResolver { +export function getReferenceResolver(library: PeerLibrary): ReferenceResolver { return library } diff --git a/src/peer-generation/Tracker.ts b/src/peer-generation/Tracker.ts index 557f2d04..620b9fdf 100644 --- a/src/peer-generation/Tracker.ts +++ b/src/peer-generation/Tracker.ts @@ -18,9 +18,9 @@ import * as path from 'path' import { IndentedPrinter } from "../IndentedPrinter"; import { MaterializedClass } from "./Materialized"; -import { EnumEntity } from './PeerFile'; -import { IdlPeerLibrary } from './idl/IdlPeerLibrary'; -import { IdlPeerClass } from './idl/IdlPeerClass'; +import { IDLEnum } from '../idl'; +import { PeerLibrary } from './PeerLibrary'; +import { PeerClass } from './PeerClass'; const STATUSES = ["Total", "In Progress", "Done", "Blocked"] @@ -28,7 +28,7 @@ class TrackerVisitor { out = new IndentedPrinter() constructor( - protected library: IdlPeerLibrary, + protected library: PeerLibrary, protected track: Map ) { } @@ -40,7 +40,7 @@ class TrackerVisitor { return '| |' } - printPeerClass(clazz: IdlPeerClass): void { + printPeerClass(clazz: PeerClass): void { let seen = new Set() this.out.print(`|*${clazz.componentName}*| *Component* | ${this.tracking(clazz.componentName, "Component")}`) clazz.methods.forEach(method => { @@ -62,7 +62,7 @@ class TrackerVisitor { }) } - printEnum(enam: EnumEntity) { + printEnum(enam: IDLEnum) { this.out.print(`## Enum ${enam.name}`) } @@ -162,7 +162,7 @@ function optionsFunction(component: string) { return `set${component}Options` } -export function generateTracker(outDir: string, peerLibrary: IdlPeerLibrary, trackerStatus: string, verbose: boolean = false): void { +export function generateTracker(outDir: string, peerLibrary: PeerLibrary, trackerStatus: string, verbose: boolean = false): void { if (!fs.existsSync(outDir)) fs.mkdirSync(outDir) let track = new Map() if (fs.existsSync(trackerStatus)) { diff --git a/src/peer-generation/arkoala.ts b/src/peer-generation/arkoala.ts index 3aa6a311..8f449ad7 100644 --- a/src/peer-generation/arkoala.ts +++ b/src/peer-generation/arkoala.ts @@ -51,16 +51,16 @@ import { printMesonBuild } from "./printers/MesonPrinter" import { printFakeDeclarations as printIdlFakeDeclarations, printInterfaces as printIdlInterfaces -} from "./idl/InterfacePrinter" +} from "./printers/InterfacePrinter" import { printBuilderClasses } from "./printers/BuilderClassPrinter" import { ARKOALA_PACKAGE_PATH, INTEROP_PACKAGE_PATH } from "./printers/lang/Java" import { TargetFile } from "./printers/TargetFile" import { printBridgeCcCustom, printBridgeCcGenerated } from "./printers/BridgeCcPrinter" import { Language } from "../Language" -import { IdlPeerLibrary } from "./idl/IdlPeerLibrary" +import { PeerLibrary } from "./PeerLibrary" import { PeerGeneratorConfig } from "./PeerGeneratorConfig" import { printDeclarations } from "./printers/DeclarationPrinter" -import { printConflictedDeclarationsIdl } from "./idl/ConflictedDeclarationsPrinterIdl"; +import { printConflictedDeclarations } from "./printers/ConflictedDeclarationsPrinter"; import { printNativeModuleRecorder } from "./printers/NativeModuleRecorderPrinter" import { IndentedPrinter } from "../IndentedPrinter" import { LanguageWriter } from "./LanguageWriters" @@ -70,7 +70,7 @@ export function generateLibaceFromIdl(config: { libaceDestination: string|undefined, apiVersion: number, outDir: string -}, peerLibrary: IdlPeerLibrary) { +}, peerLibrary: PeerLibrary) { const libace = config.libaceDestination ? new LibaceInstall(config.libaceDestination, false) : new LibaceInstall(config.outDir, true) @@ -160,7 +160,7 @@ export function generateArkoalaFromIdl(config: { callLog: boolean, verbose: boolean }, - peerLibrary: IdlPeerLibrary) { + peerLibrary: PeerLibrary) { const arkoala = config.arkoalaDestination ? new ArkoalaInstall(config.arkoalaDestination, config.lang, false) : new ArkoalaInstall(config.outDir, config.lang, true) @@ -334,7 +334,7 @@ export function generateArkoalaFromIdl(config: { ) writeFile( arkoala.arktsLib(new TargetFile('ConflictedDeclarations')), - printConflictedDeclarationsIdl(peerLibrary), + printConflictedDeclarations(peerLibrary), { onlyIntegrated: config.onlyIntegrated, integrated: true diff --git a/src/peer-generation/idl/DependencySorter.ts b/src/peer-generation/idl/DependencySorter.ts index 1974c134..5e4f0219 100644 --- a/src/peer-generation/idl/DependencySorter.ts +++ b/src/peer-generation/idl/DependencySorter.ts @@ -16,11 +16,11 @@ import * as idl from "../../idl"; import { convert } from "./common"; import { DeclarationDependenciesCollector, TypeDependenciesCollector } from "./IdlDependenciesCollector"; -import { IdlPeerLibrary } from "./IdlPeerLibrary"; -import { collectProperties } from "./StructPrinter"; +import { PeerLibrary } from "../PeerLibrary" +import { collectProperties } from "../printers/StructPrinter"; class TypeDependencies extends TypeDependenciesCollector { - constructor(library: IdlPeerLibrary) { + constructor(library: PeerLibrary) { super(library) } convertUnion(type: idl.IDLUnionType): idl.IDLNode[] { @@ -47,7 +47,7 @@ class TypeDependencies extends TypeDependenciesCollector { } class DeclDependencies extends DeclarationDependenciesCollector { - constructor (private library: IdlPeerLibrary, private typeDependencies: TypeDependencies) { + constructor (private library: PeerLibrary, private typeDependencies: TypeDependencies) { super(typeDependencies) } convertInterface(node: idl.IDLInterface): idl.IDLNode[] { @@ -70,7 +70,7 @@ export class DependencySorter { dependencies = new Set() adjMap = new Map() - constructor(private library: IdlPeerLibrary) { + constructor(private library: PeerLibrary) { this.typeConvertor = new TypeDependencies(library); this.declConvertor = new DeclDependencies(library, this.typeConvertor) } diff --git a/src/peer-generation/idl/IdlPeerClass.ts b/src/peer-generation/idl/IdlPeerClass.ts deleted file mode 100644 index 585d39c3..00000000 --- a/src/peer-generation/idl/IdlPeerClass.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2024 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 { IDLType } from "../../idl" -import { PeerClassBase } from "../PeerClass" -import { IdlPeerFile } from "./IdlPeerFile" -import { IdlPeerMethod } from "./IdlPeerMethod" - - -// actually field -class IdlPeerAttributeField { - constructor ( - public name:string, - public type:IDLType, - ) {} -} - -export class IdlPeerClass implements PeerClassBase { - constructor( - public readonly file: IdlPeerFile, - public readonly componentName: string, - public readonly originalFilename: string, - ) { } - - setGenerationContext(context: string| undefined): void {} - - generatedName(isCallSignature: boolean): string{ - return isCallSignature ? this.originalInterfaceName! : this.originalClassName! - } - - getComponentName(): string { - return this.componentName - } - - methods: IdlPeerMethod[] = [] - - originalClassName: string | undefined = undefined - originalInterfaceName: string | undefined = undefined - originalParentName: string | undefined = undefined - originalParentFilename: string | undefined = undefined - parentComponentName: string | undefined = undefined - attributesFields: IdlPeerAttributeField[] = [] - attributesTypes: {typeName: string, content: string}[] = [] - hasGenericType: boolean = false -} \ No newline at end of file diff --git a/src/peer-generation/idl/IdlPeerFile.ts b/src/peer-generation/idl/IdlPeerFile.ts deleted file mode 100644 index 2f2ca51c..00000000 --- a/src/peer-generation/idl/IdlPeerFile.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2024 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 * as idl from "../../idl" -import { IdlPeerClass } from "./IdlPeerClass" -import { ImportFeature } from '../ImportsCollector' - -export class IdlPeerFile { - readonly peers: Map = new Map() - readonly declarations: Set = new Set() - readonly importFeatures: ImportFeature[] = [] - readonly serializeImportFeatures: ImportFeature[] = [] - constructor( - public readonly originalFilename: string, - public readonly entries: idl.IDLEntry[], - private readonly componentsToGenerate: Set, - public readonly isPredefined: boolean = false - ) {} - - - public packageName(): string { - let packageTag = this.entries.find(it => idl.isPackage(it)) as idl.IDLPackage - if (packageTag) return packageTag.name - return "" - } - - get enums(): idl.IDLEnum[] { - return this.entries.filter(it => idl.isEnum(it)) as idl.IDLEnum[] - } - get peersToGenerate(): IdlPeerClass[] { - const peers = Array.from(this.peers.values()) - if (!this.componentsToGenerate.size) - return peers - return peers.filter(it => this.componentsToGenerate.has(it.componentName)) - } -} diff --git a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts index f373cef1..3fdbc376 100644 --- a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts +++ b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts @@ -27,10 +27,10 @@ import { import { GenericVisitor } from "../../options" import { ArgConvertor, RetConvertor } from "../ArgConvertors" import { PeerGeneratorConfig } from "../PeerGeneratorConfig"; -import { IdlPeerClass } from "./IdlPeerClass" -import { IdlPeerMethod } from "./IdlPeerMethod" -import { IdlPeerFile } from "./IdlPeerFile" -import { IdlPeerLibrary } from "./IdlPeerLibrary" +import { PeerClass } from "../PeerClass" +import { PeerMethod } from "../PeerMethod" +import { PeerFile } from "../PeerFile" +import { PeerLibrary } from "../PeerLibrary" import { MaterializedClass, MaterializedField, MaterializedMethod, SuperElement } from "../Materialized" import { Field, FieldModifier, Method, MethodModifier, NamedMethodSignature } from "../LanguageWriters"; import { convertDeclaration } from "../LanguageWriters/nameConvertor"; @@ -64,8 +64,8 @@ import { cjCustomTypeMapping } from "../printers/lang/Cangjie" type IdlPeerGeneratorVisitorOptions = { sourceFile: string - peerFile: IdlPeerFile - peerLibrary: IdlPeerLibrary + peerFile: PeerFile + peerLibrary: PeerLibrary } export class IdlComponentDeclaration { @@ -84,8 +84,8 @@ export class IdlPeerGeneratorVisitor implements GenericVisitor { static readonly serializerBaseMethods = serializerBaseMethods() - readonly peerLibrary: IdlPeerLibrary - readonly peerFile: IdlPeerFile + readonly peerLibrary: PeerLibrary + readonly peerFile: PeerFile constructor(options: IdlPeerGeneratorVisitorOptions) { this.sourceFile = options.sourceFile @@ -114,8 +114,8 @@ export class IdlPeerGeneratorVisitor implements GenericVisitor { } export class IdlPredefinedGeneratorVisitor implements GenericVisitor { - readonly peerLibrary: IdlPeerLibrary - readonly peerFile: IdlPeerFile + readonly peerLibrary: PeerLibrary + readonly peerFile: PeerFile private packageName?: string @@ -165,17 +165,17 @@ export class IdlPredefinedGeneratorVisitor implements GenericVisitor { this.peerLibrary.predefinedDeclarations.push(declaration) } - private isPredefinedPackage(file:IdlPeerFile): boolean { + private isPredefinedPackage(file:PeerFile): boolean { return this.packageName === PREDEFINED_PACKAGE } - private isPredefinedTypesPackage(file:IdlPeerFile): boolean { + private isPredefinedTypesPackage(file:PeerFile): boolean { return this.packageName === PREDEFINED_PACKAGE_TYPES } } -function generateArgConvertor(library: IdlPeerLibrary, param: idl.IDLParameter): ArgConvertor { +function generateArgConvertor(library: PeerLibrary, param: idl.IDLParameter): ArgConvertor { if (!param.type) throw new Error("Type is needed") return library.typeConvertor(param.name, param.type, param.isOptional) } @@ -232,7 +232,7 @@ class ImportsAggregateCollector extends TypeDependenciesCollector { private readonly declarationCollector: FilteredDeclarationCollector constructor( - protected readonly peerLibrary: IdlPeerLibrary, + protected readonly peerLibrary: PeerLibrary, private readonly expandAliases: boolean, ) { super(peerLibrary) @@ -276,7 +276,7 @@ class ImportsAggregateCollector extends TypeDependenciesCollector { export class FilteredDeclarationCollector extends DeclarationDependenciesCollector { constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, typeDepsCollector: TypeDependenciesCollector, ) { super(typeDepsCollector) @@ -322,7 +322,7 @@ class ArkTSDeclarationCollector extends DeclarationDependenciesCollector { class JavaTypeDependenciesCollector extends TypeDependenciesCollector { constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, private readonly expandAliases: boolean, ) { super(library) @@ -422,7 +422,7 @@ class JavaTypeDependenciesCollector extends TypeDependenciesCollector { class JavaDeclarationCollector extends DeclarationDependenciesCollector { constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, typeDepsCollector: TypeDependenciesCollector, ) { super(typeDepsCollector) @@ -460,7 +460,7 @@ class JavaDeclarationCollector extends DeclarationDependenciesCollector { class CJDeclarationCollector extends DeclarationDependenciesCollector { constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, typeDepsCollector: TypeDependenciesCollector, ) { super(typeDepsCollector) @@ -494,7 +494,7 @@ class CJDeclarationCollector extends DeclarationDependenciesCollector { class CJTypeDependenciesCollector extends TypeDependenciesCollector { constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, private readonly expandAliases: boolean, ) { super(library) @@ -605,7 +605,7 @@ class EmptyDependencyFilter implements DependencyFilter { class SyntheticDependencyConfigurableFilter implements DependencyFilter { constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, private readonly config: { skipAnonymousInterfaces?: boolean, skipCallbacks?: boolean, @@ -643,7 +643,7 @@ class ArkTSSyntheticDependencyConfigurableFilter extends SyntheticDependencyConf class ComponentsCompleter { constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, ) {} public process(): void { @@ -689,10 +689,10 @@ class ComponentsCompleter { class PeersGenerator { constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, ) {} - private processProperty(prop: idl.IDLProperty, peer: IdlPeerClass, parentName?: string): IdlPeerMethod | undefined { + private processProperty(prop: idl.IDLProperty, peer: PeerClass, parentName?: string): PeerMethod | undefined { if (PeerGeneratorConfig.ignorePeerMethod.includes(prop.name)) return if (prop.name === "onWillScroll" || prop.name === "onDidScroll") { @@ -708,7 +708,7 @@ class PeersGenerator { const originalParentName = parentName ?? peer.originalClassName! const argConvertor = this.library.typeConvertor("value", prop.type, prop.isOptional) const signature = new NamedMethodSignature(idl.IDLThisType, [maybeOptional(prop.type, prop.isOptional)], ["value"]) - return new IdlPeerMethod( + return new PeerMethod( originalParentName, [argConvertor], generateRetConvertor(idl.IDLVoidType), @@ -716,7 +716,7 @@ class PeersGenerator { new Method(prop.name, signature, [])) } - private processMethodOrCallable(method: idl.IDLMethod | idl.IDLCallable, peer: IdlPeerClass, parentName?: string): IdlPeerMethod | undefined { + private processMethodOrCallable(method: idl.IDLMethod | idl.IDLCallable, peer: PeerClass, parentName?: string): PeerMethod | undefined { if (PeerGeneratorConfig.ignorePeerMethod.includes(method.name!)) return // Some method have other parents as part of their names @@ -731,7 +731,7 @@ class PeersGenerator { this.library.requestType(param.type!, this.library.shouldGenerateComponent(peer.componentName)) }) const signature = generateSignature(method) - return new IdlPeerMethod( + return new PeerMethod( originalParentName, argConvertors, generateRetConvertor(method.returnType), @@ -739,7 +739,7 @@ class PeersGenerator { new Method(methodName!, signature, method.isStatic ? [MethodModifier.STATIC] : [])) } - private createComponentAttributesDeclaration(clazz: idl.IDLInterface, peer: IdlPeerClass) { + private createComponentAttributesDeclaration(clazz: idl.IDLInterface, peer: PeerClass) { if (PeerGeneratorConfig.invalidAttributes.includes(peer.componentName)) { return } @@ -749,7 +749,7 @@ class PeersGenerator { }) } - private processOptionAttribute(seenAttributes: Set, property: idl.IDLProperty, peer: IdlPeerClass) { + private processOptionAttribute(seenAttributes: Set, property: idl.IDLProperty, peer: PeerClass) { const propName = property.name if (seenAttributes.has(propName)) { console.log(`WARNING: ignore seen property: ${propName}`) @@ -757,17 +757,14 @@ class PeersGenerator { } seenAttributes.add(propName) // const type = this.fixTypeLiteral(propName, property.type, peer) - peer.attributesFields.push({ - name: propName, - type: property.type - }) + peer.attributesFields.push(property) } /** * Arkts needs a named type as its argument method, not an anonymous type * at which producing 'SyntaxError: Invalid Type' error */ - private fixTypeLiteral(name: string, type: idl.IDLType, peer: IdlPeerClass): string { + private fixTypeLiteral(name: string, type: idl.IDLType, peer: PeerClass): string { if (idl.isReferenceType(type)) { const decl = this.library.resolveTypeReference(type) if (decl && idl.isAnonymousInterface(decl)) { @@ -788,16 +785,16 @@ class PeersGenerator { return this.library.mapType(type) } - private fillInterface(peer: IdlPeerClass, iface: idl.IDLInterface) { + private fillInterface(peer: PeerClass, iface: idl.IDLInterface) { peer.originalInterfaceName = iface.name const peerMethods = iface.callables .map(it => this.processMethodOrCallable(it, peer, iface?.name)) .filter(isDefined) - const overloadedMethods = IdlPeerMethod.markAndGroupOverloads(peerMethods) + const overloadedMethods = PeerMethod.markAndGroupOverloads(peerMethods) peer.methods.push(...overloadedMethods) } - private fillClass(peer: IdlPeerClass, clazz: idl.IDLInterface) { + private fillClass(peer: PeerClass, clazz: idl.IDLInterface) { peer.originalClassName = clazz.name const parent = idl.getSuperType(clazz) if (parent) { @@ -811,7 +808,7 @@ class PeersGenerator { ...clazz.properties.map(it => this.processProperty(it, peer)), ...clazz.methods.map(it => this.processMethodOrCallable(it, peer)), ].filter(isDefined) - const overloadedMethods = IdlPeerMethod.markAndGroupOverloads(peerMethods) + const overloadedMethods = PeerMethod.markAndGroupOverloads(peerMethods) peer.methods.push(...overloadedMethods) this.createComponentAttributesDeclaration(clazz, peer) @@ -824,7 +821,7 @@ class PeersGenerator { const file = this.library.findFileByOriginalFilename(sourceFile) if (!file) throw new Error("Not found a file corresponding to attributes class") - const peer = new IdlPeerClass(file, component.name, sourceFile) + const peer = new PeerClass(file, component.name, sourceFile) if (component.interfaceDeclaration) this.fillInterface(peer, component.interfaceDeclaration) this.fillClass(peer, component.attributeDeclaration) @@ -840,7 +837,7 @@ export class IdlPeerProcessor { private readonly dependencyFilter: DependencyFilter constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, ) { this.typeDependenciesCollector = createTypeDependenciesCollector(this.library) this.declDependenciesCollector = createDeclDependenciesCollector(this.library, this.typeDependenciesCollector) @@ -1161,7 +1158,7 @@ export class IdlPeerProcessor { } } -export function convertDeclToFeature(library: IdlPeerLibrary, node: idl.IDLNode): ImportFeature { +export function convertDeclToFeature(library: PeerLibrary, node: idl.IDLNode): ImportFeature { if (!idl.isEntry(node)) throw "Expected to have an entry" if (isSyntheticDeclaration(node)) @@ -1198,7 +1195,7 @@ export function convertDeclToFeature(library: IdlPeerLibrary, node: idl.IDLNode) } } -export function createTypeDependenciesCollector(library: IdlPeerLibrary): TypeDependenciesCollector { +export function createTypeDependenciesCollector(library: PeerLibrary): TypeDependenciesCollector { switch (library.language) { case Language.TS: return new ImportsAggregateCollector(library, false) case Language.ARKTS: return new ArkTSImportsAggregateCollector(library, true) @@ -1209,7 +1206,7 @@ export function createTypeDependenciesCollector(library: IdlPeerLibrary): TypeDe return new ImportsAggregateCollector(library, false) } -export function createDeclDependenciesCollector(library: IdlPeerLibrary, +export function createDeclDependenciesCollector(library: PeerLibrary, typeDependenciesCollector: TypeDependenciesCollector ): DeclarationDependenciesCollector { switch (library.language) { @@ -1222,7 +1219,7 @@ export function createDeclDependenciesCollector(library: IdlPeerLibrary, return new FilteredDeclarationCollector(library, typeDependenciesCollector) } -function createSerializeDeclDependenciesCollector(library: IdlPeerLibrary): DeclarationDependenciesCollector { +function createSerializeDeclDependenciesCollector(library: PeerLibrary): DeclarationDependenciesCollector { const expandAliases = true switch (library.language) { case Language.TS: return new FilteredDeclarationCollector(library, new ImportsAggregateCollector(library, expandAliases)) @@ -1234,7 +1231,7 @@ function createSerializeDeclDependenciesCollector(library: IdlPeerLibrary): Decl return new FilteredDeclarationCollector(library, new ImportsAggregateCollector(library, expandAliases)) } -export function createDependencyFilter(library: IdlPeerLibrary): DependencyFilter { +export function createDependencyFilter(library: PeerLibrary): DependencyFilter { switch (library.language) { case Language.TS: return new SyntheticDependencyConfigurableFilter(library, @@ -1312,7 +1309,7 @@ export function isBuilderClass(declaration: idl.IDLInterface): boolean {/// stol */ } -export function isCommonMethodOrSubclass(library: IdlPeerLibrary, decl?: idl.IDLEntry): boolean { +export function isCommonMethodOrSubclass(library: PeerLibrary, decl?: idl.IDLEntry): boolean { if (!decl || !idl.isInterface(decl)) return false let isSubclass = isRoot(decl.name) @@ -1376,7 +1373,7 @@ export function checkTSDeclarationMaterialized(decl: idl.IDLNode): boolean { && isMaterialized(decl) } -export function convertTypeToFeature(library: IdlPeerLibrary, type: IDLType): ImportFeature | undefined { +export function convertTypeToFeature(library: PeerLibrary, type: IDLType): ImportFeature | undefined { const typeReference = idl.isReferenceType(type) ? library.resolveTypeReference(type) : undefined diff --git a/src/peer-generation/idl/IdlSyntheticDeclarations.ts b/src/peer-generation/idl/IdlSyntheticDeclarations.ts index beb84480..458977d8 100644 --- a/src/peer-generation/idl/IdlSyntheticDeclarations.ts +++ b/src/peer-generation/idl/IdlSyntheticDeclarations.ts @@ -16,13 +16,13 @@ import { ImportFeature } from '../ImportsCollector' import * as idl from '../../idl'; import { convertDeclToFeature, isSourceDecl } from "./IdlPeerGeneratorVisitor"; import { DeclarationDependenciesCollector } from "./IdlDependenciesCollector"; -import { IdlPeerLibrary } from "./IdlPeerLibrary"; +import { PeerLibrary } from "../PeerLibrary" const syntheticDeclarations: Map = new Map() export function makeSyntheticDeclCompletely(srcDecl: idl.IDLEntry, newDecl: idl.IDLEntry, - library: IdlPeerLibrary, + library: PeerLibrary, declConvertor: DeclarationDependenciesCollector, targetFilename: string) { const synthDecl = makeSyntheticDeclaration(targetFilename, srcDecl.name!, () => newDecl); diff --git a/src/peer-generation/plugin-api.ts b/src/peer-generation/plugin-api.ts index 2aa8ff0f..ad260531 100644 --- a/src/peer-generation/plugin-api.ts +++ b/src/peer-generation/plugin-api.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { IdlPeerLibrary } from "./idl/IdlPeerLibrary"; +import { PeerLibrary } from "./PeerLibrary"; export interface PluginHost { log(message: string): void @@ -28,7 +28,7 @@ class PluginHostImpl implements PluginHost { } export interface Plugin { - process(options: PluginOptions, idl: IdlPeerLibrary): void + process(options: PluginOptions, idl: PeerLibrary): void } export async function loadPlugin(path: string): Promise { diff --git a/src/peer-generation/printers/BridgeCcPrinter.ts b/src/peer-generation/printers/BridgeCcPrinter.ts index 44f0bd28..6ea667cf 100644 --- a/src/peer-generation/printers/BridgeCcPrinter.ts +++ b/src/peer-generation/printers/BridgeCcPrinter.ts @@ -18,8 +18,8 @@ import { ArgConvertor, RetConvertor } from "../ArgConvertors"; import { PrimitiveType } from "../ArkPrimitiveType" import { bridgeCcCustomDeclaration, bridgeCcGeneratedDeclaration } from "../FileGenerators"; import { createLanguageWriter, createTypeNameConvertor, ExpressionStatement, LanguageWriter } from "../LanguageWriters"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; -import { IdlPeerMethod } from "../idl/IdlPeerMethod"; +import { PeerLibrary } from "../PeerLibrary"; +import { PeerMethod } from "../PeerMethod"; import { Language } from "../../Language"; import { forceAsNamedNode, IDLBooleanType, IDLNumberType } from "../../idl"; import { getReferenceResolver } from "../ReferenceResolver"; @@ -29,11 +29,11 @@ class BridgeCcVisitor { readonly customApi = createLanguageWriter(Language.CPP, this.library) constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, protected readonly callLog: boolean, ) {} - protected generateApiCall(method: IdlPeerMethod, modifierName?: string): string { + protected generateApiCall(method: PeerMethod, modifierName?: string): string { // TODO: may be need some translation tables? let clazz = modifierName ?? dropSuffix(dropSuffix(dropSuffix(method.originalParentName, "Method"), "Attribute"), "Interface") return `get${capitalize(clazz)}${method.apiKind}()` @@ -53,11 +53,11 @@ class BridgeCcVisitor { return `${argConvertor.convertorArg(this.escapeKeyword(argConvertor.param), this.generatedApi)}` } - protected getApiCall(method: IdlPeerMethod): string { + protected getApiCall(method: PeerMethod): string { return method.apiCall } - protected printAPICall(method: IdlPeerMethod, modifierName?: string) { + protected printAPICall(method: PeerMethod, modifierName?: string) { const hasReceiver = method.hasReceiver() const argConvertors = method.argConvertors const isVoid = method.retConvertor.isVoid @@ -74,7 +74,7 @@ class BridgeCcVisitor { this.generatedApi.print(call) } - protected getApiCallResultField(method: IdlPeerMethod): string { + protected getApiCallResultField(method: PeerMethod): string { return "" } @@ -82,17 +82,17 @@ class BridgeCcVisitor { return "self" } - protected getPeerMethodName(method: IdlPeerMethod): string { + protected getPeerMethodName(method: PeerMethod): string { return method.peerMethodName } - protected printReceiverCastCall(method: IdlPeerMethod) { + protected printReceiverCastCall(method: PeerMethod) { const receiverType = method.receiverType; const self = this.getReceiverArgName(); this.generatedApi.print(`${receiverType} ${self} = reinterpret_cast<${receiverType}>(thisPtr);`) } - private printNativeBody(method: IdlPeerMethod, modifierName?: string) { + private printNativeBody(method: PeerMethod, modifierName?: string) { this.generatedApi.pushIndent() if (method.hasReceiver()) { this.printReceiverCastCall(method) @@ -118,7 +118,7 @@ class BridgeCcVisitor { private static varCnt : number = 0; - private printCallLog(method: IdlPeerMethod, api: string, modifier: string) { + private printCallLog(method: PeerMethod, api: string, modifier: string) { this.generatedApi.print(`if (needGroupedLog(2)) {`) this.generatedApi.pushIndent() this.generatedApi.print('std::string _logData;') @@ -177,7 +177,7 @@ class BridgeCcVisitor { return receiver } - private generateCMacroSuffix(method: IdlPeerMethod): string { + private generateCMacroSuffix(method: PeerMethod): string { let counter = method.hasReceiver() ? 1 : 0 let arrayAdded = false method.argConvertors.forEach(it => { @@ -193,7 +193,7 @@ class BridgeCcVisitor { return `${method.retConvertor.macroSuffixPart()}${counter}` } - private generateCParameters(method: IdlPeerMethod, argConvertors: ArgConvertor[]): string[] { + private generateCParameters(method: PeerMethod, argConvertors: ArgConvertor[]): string[] { let maybeReceiver = method.hasReceiver() ? [`${PrimitiveType.NativePointer.getText()} thisPtr`] : [] let ptrCreated = false; for (let i = 0; i < argConvertors.length; ++i) { @@ -219,7 +219,7 @@ class BridgeCcVisitor { return maybeReceiver } - private printMethod(method: IdlPeerMethod, modifierName?: string) { + private printMethod(method: PeerMethod, modifierName?: string) { const retConvertor = method.retConvertor const argConvertors = method.argConvertors @@ -239,7 +239,7 @@ class BridgeCcVisitor { this.generatedApi.print(` `) } - protected getRetValue(method: IdlPeerMethod, retConvertor: RetConvertor): string | undefined { + protected getRetValue(method: PeerMethod, retConvertor: RetConvertor): string | undefined { return retConvertor.interopType ? retConvertor.interopType() : retConvertor.nativeType(); @@ -309,13 +309,13 @@ class BridgeCcVisitor { // TODO commonize this piece of code class OhosBridgeCcVisitor extends BridgeCcVisitor { - protected generateApiCall(method: IdlPeerMethod, modifierName?: string): string { + protected generateApiCall(method: PeerMethod, modifierName?: string): string { // TODO: may be need some translation tables? let clazz = modifierName ?? dropSuffix(dropSuffix(dropSuffix(method.originalParentName, "Method"), "Attribute"), "Interface") return capitalize(clazz) + "()" } - protected getApiCall(method: IdlPeerMethod): string { + protected getApiCall(method: PeerMethod): string { const libName = this.library.name; return `Get${libName}APIImpl(${libName}_API_VERSION)` } @@ -325,11 +325,11 @@ class OhosBridgeCcVisitor extends BridgeCcVisitor { return "thisPtr" } - protected printReceiverCastCall(method: IdlPeerMethod) { + protected printReceiverCastCall(method: PeerMethod) { // OHOS API does not need to cast native pointer at this moment } - protected getPeerMethodName(method: IdlPeerMethod): string { + protected getPeerMethodName(method: PeerMethod): string { switch (method.peerMethodName) { case "ctor": return "construct" case "getFinalizer": return "destruct" @@ -337,7 +337,7 @@ class OhosBridgeCcVisitor extends BridgeCcVisitor { } } - protected printAPICall(method: IdlPeerMethod, modifierName?: string) { + protected printAPICall(method: PeerMethod, modifierName?: string) { if (method.peerMethodName == "getFinalizer") { const modifier = this.generateApiCall(method, modifierName) const peerMethod = this.getPeerMethodName(method) @@ -349,7 +349,7 @@ class OhosBridgeCcVisitor extends BridgeCcVisitor { } } - protected getApiCallResultField(method: IdlPeerMethod): string { + protected getApiCallResultField(method: PeerMethod): string { // TODO Remove this workaround for case when number is replaced with int32 if (method.method.signature.returnType === IDLNumberType) { return ".i32" @@ -365,24 +365,24 @@ type BridgeCcApi = { custom: LanguageWriter; }; -export function printBridgeCcForOHOS(peerLibrary: IdlPeerLibrary): BridgeCcApi { +export function printBridgeCcForOHOS(peerLibrary: PeerLibrary): BridgeCcApi { const visitor = new OhosBridgeCcVisitor(peerLibrary, false) visitor.print() return { generated: visitor.generatedApi, custom: visitor.customApi } } -export function printBridgeCc(peerLibrary: IdlPeerLibrary, callLog: boolean): BridgeCcApi { +export function printBridgeCc(peerLibrary: PeerLibrary, callLog: boolean): BridgeCcApi { const visitor = new BridgeCcVisitor(peerLibrary, callLog) visitor.print() return { generated: visitor.generatedApi, custom: visitor.customApi } } -export function printBridgeCcGenerated(peerLibrary: IdlPeerLibrary, callLog: boolean): string { +export function printBridgeCcGenerated(peerLibrary: PeerLibrary, callLog: boolean): string { const { generated } = printBridgeCc(peerLibrary, callLog) return bridgeCcGeneratedDeclaration(generated.getOutput()) } -export function printBridgeCcCustom(peerLibrary: IdlPeerLibrary, callLog: boolean): string { +export function printBridgeCcCustom(peerLibrary: PeerLibrary, callLog: boolean): string { const { custom } = printBridgeCc(peerLibrary, callLog) return bridgeCcCustomDeclaration(custom.getOutput()) } \ No newline at end of file diff --git a/src/peer-generation/printers/BuilderClassPrinter.ts b/src/peer-generation/printers/BuilderClassPrinter.ts index 92142b4e..043acad5 100644 --- a/src/peer-generation/printers/BuilderClassPrinter.ts +++ b/src/peer-generation/printers/BuilderClassPrinter.ts @@ -21,7 +21,7 @@ import { TargetFile } from "./TargetFile"; import { PrinterContext } from "./PrinterContext"; import { ImportsCollector } from "../ImportsCollector"; import { ARKOALA_PACKAGE, ARKOALA_PACKAGE_PATH } from "./lang/Java"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; +import { PeerLibrary } from "../PeerLibrary"; import { Language } from "../../Language"; import { forceAsNamedNode, IDLType, IDLVoidType, isOptionalType, maybeOptional, toIDLType } from "../../idl"; @@ -39,7 +39,7 @@ class TSBuilderClassFileVisitor implements BuilderClassFileVisitor { private readonly language: Language, private readonly builderClass: BuilderClass, private readonly dumpSerialized: boolean, - private readonly peerLibrary: IdlPeerLibrary) { } + private readonly peerLibrary: PeerLibrary) { } private printBuilderClass(builderClass: BuilderClass) { const writer = this.printer @@ -118,7 +118,7 @@ class JavaBuilderClassFileVisitor implements BuilderClassFileVisitor { private readonly printer: LanguageWriter = createLanguageWriter(this.printerContext.language, this.library) constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, private readonly printerContext: PrinterContext, private readonly builderClass: BuilderClass, private readonly dumpSerialized: boolean, @@ -303,7 +303,7 @@ class BuilderClassVisitor { readonly builderClasses: Map = new Map() constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, private printerContext: PrinterContext, private readonly dumpSerialized: boolean, ) { } @@ -339,7 +339,7 @@ class BuilderClassVisitor { } } -export function printBuilderClasses(peerLibrary: IdlPeerLibrary, printerContext: PrinterContext, dumpSerialized: boolean): Map { +export function printBuilderClasses(peerLibrary: PeerLibrary, printerContext: PrinterContext, dumpSerialized: boolean): Map { // TODO: support other output languages if (printerContext.language != Language.TS && printerContext.language != Language.ARKTS && printerContext.language != Language.JAVA) { return new Map() diff --git a/src/peer-generation/printers/CallbacksPrinter.ts b/src/peer-generation/printers/CallbacksPrinter.ts index 0603a5e6..e5ae9824 100644 --- a/src/peer-generation/printers/CallbacksPrinter.ts +++ b/src/peer-generation/printers/CallbacksPrinter.ts @@ -14,10 +14,8 @@ */ import * as idl from "../../idl" -import { cStyleCopyright } from "../FileGenerators"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; +import { PeerLibrary } from "../PeerLibrary"; import { CppLanguageWriter, LanguageWriter, NamedMethodSignature } from "../LanguageWriters"; -import { EnumEntity, EnumMember } from "../PeerFile"; import { PeerGeneratorConfig } from "../PeerGeneratorConfig"; import { ImportsCollector } from "../ImportsCollector"; import { Language } from "../../Language"; @@ -27,7 +25,7 @@ import { collectMaterializedImports } from "../Materialized"; import { CppSourceFile, SourceFile, TsSourceFile } from "./SourceFile"; import { PrimitiveType } from "../ArkPrimitiveType"; -function collectEntryCallbacks(library: IdlPeerLibrary, entry: idl.IDLEntry): idl.IDLCallback[] { +function collectEntryCallbacks(library: PeerLibrary, entry: idl.IDLEntry): idl.IDLCallback[] { let res: idl.IDLCallback[] = [] if (idl.isCallback(entry)) { res.push(entry) @@ -54,7 +52,7 @@ function collectEntryCallbacks(library: IdlPeerLibrary, entry: idl.IDLEntry): id return res } -export function collectUniqueCallbacks(library: IdlPeerLibrary) { +export function collectUniqueCallbacks(library: PeerLibrary) { const foundCallbacksNames = new Set() const foundCallbacks: idl.IDLCallback[] = [] for (const file of library.files) { @@ -107,18 +105,15 @@ export function printCallbacksKindsImports(language: Language, writer: LanguageW } } -export function printCallbacksKinds(library: IdlPeerLibrary, writer: LanguageWriter): void { - writer.writeStatement(writer.makeEnumEntity(new EnumEntity( - CallbackKind, - "", - collectUniqueCallbacks(library).map((it, index) => { - return new EnumMember(generateCallbackKindName(it), "", index.toString()) - }) - ), true)) +export function printCallbacksKinds(library: PeerLibrary, writer: LanguageWriter): void { + const kindsEnum = idl.createEnum(CallbackKind, [], {}) + kindsEnum.elements = collectUniqueCallbacks(library).map((it, index) => + idl.createEnumMember(generateCallbackKindName(it), kindsEnum, idl.IDLNumberType, index)) + writer.writeStatement(writer.makeEnumEntity(kindsEnum, true)) } class DeserializeCallbacksVisitor { - constructor(private readonly library: IdlPeerLibrary, private readonly destFile: SourceFile) {} + constructor(private readonly library: PeerLibrary, private readonly destFile: SourceFile) {} private get writer(): LanguageWriter { return this.destFile.content @@ -251,7 +246,7 @@ class DeserializeCallbacksVisitor { } class ManagedCallCallbackVisitor { - constructor(private readonly library: IdlPeerLibrary, private readonly dest: CppSourceFile) {} + constructor(private readonly library: PeerLibrary, private readonly dest: CppSourceFile) {} private get writer(): CppLanguageWriter { return this.dest.content @@ -323,12 +318,12 @@ class ManagedCallCallbackVisitor { } } -export function printDeserializeAndCall(library: IdlPeerLibrary, destination: SourceFile): void { +export function printDeserializeAndCall(library: PeerLibrary, destination: SourceFile): void { const visitor = new DeserializeCallbacksVisitor(library, destination) visitor.visit() } -export function printManagedCaller(library: IdlPeerLibrary): SourceFile { +export function printManagedCaller(library: PeerLibrary): SourceFile { const destFile = new CppSourceFile('callback_managed_caller.cc', library) // TODO combine with TargetFile const visitor = new ManagedCallCallbackVisitor(library, destFile) visitor.visit() diff --git a/src/peer-generation/printers/ComponentsPrinter.ts b/src/peer-generation/printers/ComponentsPrinter.ts index 8ba34d08..fb6a1e6c 100644 --- a/src/peer-generation/printers/ComponentsPrinter.ts +++ b/src/peer-generation/printers/ComponentsPrinter.ts @@ -33,9 +33,9 @@ import { PeerGeneratorConfig } from "../PeerGeneratorConfig"; import { TargetFile } from "./TargetFile"; import { PrinterContext } from "./PrinterContext"; import { ARKOALA_PACKAGE, ARKOALA_PACKAGE_PATH, COMPONENT_BASE } from "./lang/Java"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; -import { IdlPeerFile } from "../idl/IdlPeerFile"; -import { IdlPeerClass } from "../idl/IdlPeerClass"; +import { PeerLibrary } from "../PeerLibrary"; +import { PeerFile } from "../PeerFile"; +import { PeerClass } from "../PeerClass"; import { collectJavaImports } from "./lang/JavaIdlUtils"; import { printJavaImports } from "./lang/JavaPrinters"; import { Language } from "../../Language"; @@ -59,12 +59,12 @@ interface ComponentFileVisitor { class TSComponentFileVisitor implements ComponentFileVisitor { private readonly language = this.library.language - private readonly printer = createLanguageWriter(this.language, this.library instanceof IdlPeerLibrary ? this.library : createEmptyReferenceResolver()) + private readonly printer = createLanguageWriter(this.language, this.library instanceof PeerLibrary ? this.library : createEmptyReferenceResolver()) private readonly overloadsPrinter = new OverloadsPrinter(getReferenceResolver(this.library), this.printer, this.library.language) constructor( - private readonly library: IdlPeerLibrary, - private readonly file: IdlPeerFile, + private readonly library: PeerLibrary, + private readonly file: PeerFile, ) { } visit(): void { @@ -125,7 +125,7 @@ class TSComponentFileVisitor implements ComponentFileVisitor { imports.addFeature('unsafeCast', './shared/generated-utils') } - private printComponent(peer: IdlPeerClass) { + private printComponent(peer: PeerClass) { const callableMethods = peer.methods.filter(it => it.isCallSignature).map(it => it.method) const callableMethod = callableMethods.length ? collapseSameNamedMethods(callableMethods) : undefined const mappedCallableParams = callableMethod?.signature.args.map((it, index) => `${callableMethod.signature.argName(index)}${isOptionalType(it) ? "?" : ""}: ${this.printer.stringifyType(it)}`) @@ -218,8 +218,8 @@ class JavaComponentFileVisitor implements ComponentFileVisitor { private readonly results: ComponentPrintResult[] = [] constructor( - private readonly library: IdlPeerLibrary, - private readonly file: IdlPeerFile, + private readonly library: PeerLibrary, + private readonly file: PeerFile, private readonly printerContext: PrinterContext, ) { } @@ -231,7 +231,7 @@ class JavaComponentFileVisitor implements ComponentFileVisitor { return this.results } - private printComponent(peer: IdlPeerClass) { + private printComponent(peer: PeerClass) { const componentClassName = generateArkComponentName(peer.componentName) const componentType = toIDLType(componentClassName) const parentComponentClassName = peer.parentComponentName ? generateArkComponentName(peer.parentComponentName!) : COMPONENT_BASE @@ -276,7 +276,7 @@ class ComponentsVisitor { private readonly language = this.printerContext.language constructor( - private readonly peerLibrary: IdlPeerLibrary, + private readonly peerLibrary: PeerLibrary, private readonly printerContext: PrinterContext, ) { } @@ -303,7 +303,7 @@ class ComponentsVisitor { } } -export function printComponents(peerLibrary: IdlPeerLibrary, printerContext: PrinterContext): Map { +export function printComponents(peerLibrary: PeerLibrary, printerContext: PrinterContext): Map { // TODO: support other output languages if (![Language.TS, Language.ARKTS, Language.JAVA].includes(peerLibrary.language)) return new Map() diff --git a/src/peer-generation/idl/ConflictedDeclarationsPrinterIdl.ts b/src/peer-generation/printers/ConflictedDeclarationsPrinter.ts similarity index 86% rename from src/peer-generation/idl/ConflictedDeclarationsPrinterIdl.ts rename to src/peer-generation/printers/ConflictedDeclarationsPrinter.ts index 1727fbbe..9a141067 100644 --- a/src/peer-generation/idl/ConflictedDeclarationsPrinterIdl.ts +++ b/src/peer-generation/printers/ConflictedDeclarationsPrinter.ts @@ -14,7 +14,7 @@ */ import { createLanguageWriter, LanguageWriter } from "../LanguageWriters"; -import { IdlPeerLibrary } from "./IdlPeerLibrary"; +import { PeerLibrary } from "../PeerLibrary" import { convertDeclaration } from "../LanguageWriters/nameConvertor"; import * as idl from "../../idl"; import { Language } from "../../Language"; @@ -23,15 +23,15 @@ import { convertDeclToFeature, createDeclDependenciesCollector, createTypeDependenciesCollector, -} from "./IdlPeerGeneratorVisitor"; +} from "../idl/IdlPeerGeneratorVisitor"; import { ImportsCollector } from "../ImportsCollector"; -import { DeclarationNameConvertor } from "./IdlNameConvertor"; +import { DeclarationNameConvertor } from "../idl/IdlNameConvertor"; -class ConflictedDeclarationsVisitorIdl { +class ConflictedDeclarationsVisitor { readonly writer = createLanguageWriter(this.library.language, this.library) constructor( - protected readonly library: IdlPeerLibrary + protected readonly library: PeerLibrary ) {} print() { @@ -57,7 +57,7 @@ class ConflictedDeclarationsVisitorIdl { } } -class ArkTSConflictedDeclarationsVisitorIdl extends ConflictedDeclarationsVisitorIdl { +class ArkTSConflictedDeclarationsVisitor extends ConflictedDeclarationsVisitor { protected convertDeclaration(name: string, decl: idl.IDLEntry, writer: LanguageWriter) { const declConvertor = new ArkTSDeclConvertor(writer, this.library) convertDeclaration(declConvertor, decl) @@ -89,11 +89,11 @@ class ArkTSConflictedDeclarationsVisitorIdl extends ConflictedDeclarationsVisito } } -export function printConflictedDeclarationsIdl(library: IdlPeerLibrary): string { +export function printConflictedDeclarations(library: PeerLibrary): string { let visitor visitor = library.language == Language.ARKTS - ? new ArkTSConflictedDeclarationsVisitorIdl(library) - : new ConflictedDeclarationsVisitorIdl(library) + ? new ArkTSConflictedDeclarationsVisitor(library) + : new ConflictedDeclarationsVisitor(library) visitor.print() return visitor.writer.getOutput().join('\n') } \ No newline at end of file diff --git a/src/peer-generation/printers/ConvertorsPrinter.ts b/src/peer-generation/printers/ConvertorsPrinter.ts index 6d2e6db8..cafd2354 100644 --- a/src/peer-generation/printers/ConvertorsPrinter.ts +++ b/src/peer-generation/printers/ConvertorsPrinter.ts @@ -14,14 +14,14 @@ */ import { PrimitiveType } from "../ArkPrimitiveType" -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; +import { PeerLibrary } from "../PeerLibrary"; import { LanguageWriter } from "../LanguageWriters"; export const SELECTOR_ID_PREFIX = "SELECTOR_ID_" class ConvertorsPrinter { constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, private readonly writer: LanguageWriter, ) {} @@ -127,7 +127,7 @@ class ConvertorsPrinter { } } -export function writeConvertors(library: IdlPeerLibrary, writer: LanguageWriter) { +export function writeConvertors(library: PeerLibrary, writer: LanguageWriter) { const printer = new ConvertorsPrinter(library, writer) printer.print() } diff --git a/src/peer-generation/printers/DeclarationPrinter.ts b/src/peer-generation/printers/DeclarationPrinter.ts index 29f69fd9..7ef2b0de 100644 --- a/src/peer-generation/printers/DeclarationPrinter.ts +++ b/src/peer-generation/printers/DeclarationPrinter.ts @@ -16,10 +16,9 @@ import * as idl from "../../idl" import { CustomPrintVisitor as DtsPrintVisitor} from "../../from-idl/DtsPrinter" import { isMaterialized } from "../idl/IdlPeerGeneratorVisitor" -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary" -import { IndentedPrinter } from "../../IndentedPrinter" +import { PeerLibrary } from "../PeerLibrary" -export function printDeclarations(peerLibrary: IdlPeerLibrary): Array { +export function printDeclarations(peerLibrary: PeerLibrary): Array { const result = [] for (const decl of peerLibrary.declarations) { const visitor = new DtsPrintVisitor(type => peerLibrary.resolveTypeReference(type), peerLibrary.language) diff --git a/src/peer-generation/printers/EventsPrinter.ts b/src/peer-generation/printers/EventsPrinter.ts index 3d5c67f8..3863fb03 100644 --- a/src/peer-generation/printers/EventsPrinter.ts +++ b/src/peer-generation/printers/EventsPrinter.ts @@ -30,10 +30,10 @@ import { PeerClassBase } from "../PeerClass" import { makeCEventsArkoalaImpl, makeCEventsLibaceImpl } from "../FileGenerators" import { generateEventReceiverName } from "./HeaderPrinter" import { PeerGeneratorConfig } from "../PeerGeneratorConfig" -import { IdlPeerMethod } from "../idl/IdlPeerMethod" -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary" +import { PeerMethod } from "../PeerMethod" +import { PeerLibrary } from "../PeerLibrary" import { ArgConvertor } from "../ArgConvertors" -import { IdlPeerClass } from "../idl/IdlPeerClass" +import { PeerClass } from "../PeerClass" import { collapseIdlPeerMethods, groupOverloads } from "./OverloadsPrinter" import { Language } from "../../Language" import { ImportsCollector } from "../ImportsCollector"; @@ -73,7 +73,7 @@ export function groupCallbacks(callbacks: IdlCallbackInfo[]): Map { constructor(protected readonly writer: LanguageWriter, - readonly peerLibrary: IdlPeerLibrary) { + readonly peerLibrary: PeerLibrary) { } convertCallback(node: idl.IDLCallback): void { } @@ -123,7 +122,7 @@ export class TSDeclConvertor implements DeclarationConvertor { } class TSInterfacesVisitor extends DefaultInterfacesVisitor { - constructor(protected readonly peerLibrary: IdlPeerLibrary) { + constructor(protected readonly peerLibrary: PeerLibrary) { super() } @@ -131,14 +130,14 @@ class TSInterfacesVisitor extends DefaultInterfacesVisitor { return renameDtsToInterfaces(path.basename(originalFilename), this.peerLibrary.language) } - private printImports(writer: LanguageWriter, file: IdlPeerFile) { + private printImports(writer: LanguageWriter, file: PeerFile) { const imports = new ImportsCollector() file.importFeatures.forEach(it => imports.addFeature(it.feature, it.module)) getCommonImports(writer.language).forEach(it => imports.addFeature(it.feature, it.module)) imports.print(writer, removeExt(this.generateFileBasename(file.originalFilename))) } - protected printAssignEnumsToGlobalScope(writer: LanguageWriter, peerFile: IdlPeerFile) { + protected printAssignEnumsToGlobalScope(writer: LanguageWriter, peerFile: PeerFile) { if (peerFile.enums.length != 0) { writer.print(`Object.assign(globalThis, {`) writer.pushIndent() @@ -150,12 +149,11 @@ class TSInterfacesVisitor extends DefaultInterfacesVisitor { } } - protected toEnumEntity(enumDecl: idl.IDLEnum): EnumEntity { - const entity = new EnumEntity(enumDecl.name, enumDecl.documentation ?? "") - for (let elem of enumDecl.elements) { - entity.pushMember(elem.name, elem.documentation ?? "", elem.initializer?.toString()) - } - return entity + protected toEnumEntity(enumDecl: idl.IDLEnum): idl.IDLEnum { + const namespace = idl.getExtAttribute(enumDecl, idl.IDLExtendedAttributes.Namespace) ?? "" + return idl.createEnum(`${namespace}${enumDecl.name}`, enumDecl.elements, { + documentation: enumDecl.documentation + }) } printInterfaces() { @@ -184,7 +182,7 @@ class JavaDeclaration { } class JavaDeclarationConvertor implements DeclarationConvertor { - constructor(private readonly peerLibrary: IdlPeerLibrary, private readonly onNewDeclaration: (declaration: JavaDeclaration) => void) {} + constructor(private readonly peerLibrary: PeerLibrary, private readonly onNewDeclaration: (declaration: JavaDeclaration) => void) {} convertCallback(node: idl.IDLCallback): void { } convertEnum(node: idl.IDLEnum): void { @@ -414,7 +412,7 @@ class JavaDeclarationConvertor implements DeclarationConvertor { } class JavaInterfacesVisitor extends DefaultInterfacesVisitor { - constructor(protected readonly peerLibrary: IdlPeerLibrary) { + constructor(protected readonly peerLibrary: PeerLibrary) { super() } @@ -601,19 +599,10 @@ export class ArkTSDeclConvertor extends TSDeclConvertor { } class ArkTSInterfacesVisitor extends TSInterfacesVisitor { - protected printAssignEnumsToGlobalScope(writer_: LanguageWriter, peerFile_: IdlPeerFile) { + protected printAssignEnumsToGlobalScope(writer_: LanguageWriter, peerFile_: PeerFile) { // Not supported } - protected toEnumEntity(enumDecl: idl.IDLEnum): EnumEntity { - const namespace = idl.getExtAttribute(enumDecl, IDLExtendedAttributes.Namespace) ?? "" - const entity = new EnumEntity(`${namespace}${enumDecl.name}`, enumDecl.documentation ?? "") - for (let elem of enumDecl.elements) { - entity.pushMember(elem.name, elem.documentation ?? "", elem.initializer?.toString()) - } - return entity - } - protected createDeclarationConvertor(writer: LanguageWriter): DeclarationConvertor { return new ArkTSDeclConvertor(writer, this.peerLibrary) } @@ -626,7 +615,7 @@ class CJDeclaration { } class CJInterfacesVisitor extends DefaultInterfacesVisitor { - constructor(protected readonly peerLibrary: IdlPeerLibrary) { + constructor(protected readonly peerLibrary: PeerLibrary) { super() } @@ -642,7 +631,7 @@ class CJInterfacesVisitor extends DefaultInterfacesVisitor { } class CJDeclarationConvertor implements DeclarationConvertor { - constructor(private readonly peerLibrary: IdlPeerLibrary, private readonly onNewDeclaration: (declaration: CJDeclaration) => void) {} + constructor(private readonly peerLibrary: PeerLibrary, private readonly onNewDeclaration: (declaration: CJDeclaration) => void) {} convertCallback(node: idl.IDLCallback): void { } convertEnum(node: idl.IDLEnum): void { @@ -889,7 +878,7 @@ class CJDeclarationConvertor implements DeclarationConvertor { } -function getVisitor(peerLibrary: IdlPeerLibrary, context: PrinterContext): InterfacesVisitor | undefined { +function getVisitor(peerLibrary: PeerLibrary, context: PrinterContext): InterfacesVisitor | undefined { if (context.language == Language.TS) { return new TSInterfacesVisitor(peerLibrary) } @@ -905,7 +894,7 @@ function getVisitor(peerLibrary: IdlPeerLibrary, context: PrinterContext): Inter throwException(`Need to implement InterfacesVisitor for ${context.language} language`) } -export function printInterfaces(peerLibrary: IdlPeerLibrary, context: PrinterContext): Map { +export function printInterfaces(peerLibrary: PeerLibrary, context: PrinterContext): Map { const visitor = getVisitor(peerLibrary, context) if (!visitor) { return new Map() @@ -920,7 +909,7 @@ export function printInterfaces(peerLibrary: IdlPeerLibrary, context: PrinterCon return result } -export function createDeclarationConvertor(writer: LanguageWriter, peerLibrary: IdlPeerLibrary) { +export function createDeclarationConvertor(writer: LanguageWriter, peerLibrary: PeerLibrary) { if (writer.language === Language.TS) { return new TSDeclConvertor(writer, peerLibrary) } @@ -956,7 +945,7 @@ export function getCommonImports(language: Language) { return imports } -export function printFakeDeclarations(library: IdlPeerLibrary): Map {///copied from FakeDeclarationsPrinter +export function printFakeDeclarations(library: PeerLibrary): Map {///copied from FakeDeclarationsPrinter const lang = library.language const result = new Map() for (const [filename, {dependencies, declarations}] of makeSyntheticDeclarationsFiles()) { diff --git a/src/peer-generation/printers/MaterializedPrinter.ts b/src/peer-generation/printers/MaterializedPrinter.ts index bbe5d02e..48047665 100644 --- a/src/peer-generation/printers/MaterializedPrinter.ts +++ b/src/peer-generation/printers/MaterializedPrinter.ts @@ -40,7 +40,7 @@ import { ARKOALA_PACKAGE_PATH } from "./lang/Java"; import { createInterfaceDeclName } from "../TypeNodeNameConvertor"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; +import { PeerLibrary } from "../PeerLibrary"; import { printJavaImports } from "./lang/JavaPrinters"; import { Language } from "../../Language"; import { copyMethod } from "../LanguageWriters/LanguageWriter"; @@ -57,7 +57,7 @@ abstract class MaterializedFileVisitorBase implements MaterializedFileVisitor { protected readonly printer: LanguageWriter = createLanguageWriter(this.printerContext.language, getReferenceResolver(this.library)) constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, protected readonly printerContext: PrinterContext, protected readonly clazz: MaterializedClass, ) {} @@ -77,7 +77,7 @@ class TSMaterializedFileVisitor extends MaterializedFileVisitorBase { private overloadsPrinter = new OverloadsPrinter(getReferenceResolver(this.library), this.printer, this.library.language, false) constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, protected readonly printerContext: PrinterContext, protected readonly clazz: MaterializedClass, protected readonly dumpSerialized: boolean, @@ -276,7 +276,7 @@ class TSMaterializedFileVisitor extends MaterializedFileVisitorBase { class JavaMaterializedFileVisitor extends MaterializedFileVisitorBase { constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, protected readonly printerContext: PrinterContext, protected readonly clazz: MaterializedClass, protected readonly dumpSerialized: boolean, @@ -404,7 +404,7 @@ class ArkTSMaterializedFileVisitor extends TSMaterializedFileVisitor { class CJMaterializedFileVisitor extends MaterializedFileVisitorBase { constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, protected readonly printerContext: PrinterContext, protected readonly clazz: MaterializedClass, protected readonly dumpSerialized: boolean, @@ -490,7 +490,7 @@ class MaterializedVisitor { readonly materialized: Map = new Map() constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, private readonly printerContext: PrinterContext, private readonly dumpSerialized: boolean, ) {} @@ -521,7 +521,7 @@ class MaterializedVisitor { } } -export function printMaterialized(peerLibrary: IdlPeerLibrary, printerContext: PrinterContext, dumpSerialized: boolean): Map { +export function printMaterialized(peerLibrary: PeerLibrary, printerContext: PrinterContext, dumpSerialized: boolean): Map { const visitor = new MaterializedVisitor(peerLibrary, printerContext, dumpSerialized) visitor.printMaterialized() const result = new Map() diff --git a/src/peer-generation/printers/MesonPrinter.ts b/src/peer-generation/printers/MesonPrinter.ts index c8fdc724..7d1a8bb8 100644 --- a/src/peer-generation/printers/MesonPrinter.ts +++ b/src/peer-generation/printers/MesonPrinter.ts @@ -15,18 +15,18 @@ import { IndentedPrinter } from "../../IndentedPrinter" import { makeFileNameFromClassName } from "../FileGenerators" -import { IdlPeerClass } from "../idl/IdlPeerClass" -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary" +import { PeerClass } from "../PeerClass" +import { PeerLibrary } from "../PeerLibrary" import { MaterializedClass } from "../Materialized" export class MesonVisitor { printer = new IndentedPrinter() constructor( - protected library: IdlPeerLibrary + protected library: PeerLibrary ) { } - printPeerClassSourcePaths(clazz: IdlPeerClass): void { + printPeerClassSourcePaths(clazz: PeerClass): void { const className = makeFileNameFromClassName(clazz.componentName) // TODO use names from Libace; this.printer.print(`'implementation/${className}_delegate.cpp',`) @@ -60,7 +60,7 @@ export class MesonVisitor { } } -export function printMesonBuild(peerLibrary: IdlPeerLibrary): string { +export function printMesonBuild(peerLibrary: PeerLibrary): string { const visitor = new MesonVisitor(peerLibrary) visitor.printMesonBuildContent() return visitor.printer.getOutput().join("\n") diff --git a/src/peer-generation/printers/ModifierPrinter.ts b/src/peer-generation/printers/ModifierPrinter.ts index 19a606c7..d3177112 100644 --- a/src/peer-generation/printers/ModifierPrinter.ts +++ b/src/peer-generation/printers/ModifierPrinter.ts @@ -30,9 +30,9 @@ import { MaterializedClass, MaterializedMethod } from "../Materialized"; import { groupBy, throwException } from "../../util"; import { CppLanguageWriter, createLanguageWriter, createTypeNameConvertor, LanguageWriter, printMethodDeclaration } from "../LanguageWriters"; import { LibaceInstall } from "../../Install"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; -import { IdlPeerClass } from "../idl/IdlPeerClass"; -import { IdlPeerMethod } from "../idl/IdlPeerMethod"; +import { PeerLibrary } from "../PeerLibrary"; +import { PeerClass } from "../PeerClass"; +import { PeerMethod } from "../PeerMethod"; import { Language } from "../../Language"; import { createEmptyReferenceResolver, getReferenceResolver } from "../ReferenceResolver"; import { IDLBooleanType, IDLFunctionType, IDLStringType, isOptionalType } from "../../idl"; @@ -45,11 +45,11 @@ export class ModifierVisitor { modifierList = createLanguageWriter(Language.CPP, getReferenceResolver(this.library)) constructor( - protected library: IdlPeerLibrary, + protected library: PeerLibrary, private isDummy: boolean = false ) { } - printDummyImplFunctionBody(method: IdlPeerMethod) { + printDummyImplFunctionBody(method: PeerMethod) { let _ = this.dummy _.writeStatement( _.makeCondition( @@ -70,21 +70,21 @@ export class ModifierVisitor { this.printReturnStatement(this.dummy, method, retVal) } - printModifierImplFunctionBody(method: IdlPeerMethod, clazz: IdlPeerClass | undefined = undefined) { + printModifierImplFunctionBody(method: PeerMethod, clazz: PeerClass | undefined = undefined) { if (!this.isDummy) { this.printBodyImplementation(this.real, method, clazz) } this.printReturnStatement(this.real, method) } - private printReturnStatement(printer: LanguageWriter, method: IdlPeerMethod, returnValue: string | undefined = undefined) { + private printReturnStatement(printer: LanguageWriter, method: PeerMethod, returnValue: string | undefined = undefined) { if (!method.retConvertor.isVoid) { printer.print(`return ${returnValue ?? "0"};`) } } - private printBodyImplementation(printer: LanguageWriter, method: IdlPeerMethod, - clazz: IdlPeerClass | undefined = undefined) { + private printBodyImplementation(printer: LanguageWriter, method: PeerMethod, + clazz: PeerClass | undefined = undefined) { const apiParameters = method.generateAPIParameters( createTypeNameConvertor(Language.CPP, getReferenceResolver(this.library)) ) @@ -132,7 +132,7 @@ export class ModifierVisitor { } } - printMethodProlog(printer: LanguageWriter, method: IdlPeerMethod) { + printMethodProlog(printer: LanguageWriter, method: PeerMethod) { const apiParameters = method.generateAPIParameters( createTypeNameConvertor(Language.CPP, getReferenceResolver(this.library)) ) @@ -146,7 +146,7 @@ export class ModifierVisitor { printer.print(`}`) } - printRealAndDummyModifier(method: IdlPeerMethod, clazz: IdlPeerClass) { + printRealAndDummyModifier(method: PeerMethod, clazz: PeerClass) { this.printMethodProlog(this.dummy, method) this.printMethodProlog(this.real, method) this.printDummyImplFunctionBody(method) @@ -157,7 +157,7 @@ export class ModifierVisitor { this.modifiers.print(`${method.implNamespaceName}::${method.implName},`) } - printClassProlog(clazz: IdlPeerClass) { + printClassProlog(clazz: PeerClass) { const component = clazz.componentName const modifierStructImpl = `ArkUI${component}ModifierImpl` @@ -170,7 +170,7 @@ export class ModifierVisitor { this.modifierList.print(`Get${component}Modifier,`) } - printClassEpilog(clazz: IdlPeerClass) { + printClassEpilog(clazz: PeerClass) { const name = clazz.componentName const modifierStructImpl = `ArkUI${name}ModifierImpl` @@ -201,10 +201,10 @@ export class ModifierVisitor { this.dummy.print(`} // ${namespaceName}`) } - printPeerClassModifiers(clazz: IdlPeerClass) { + printPeerClassModifiers(clazz: PeerClass) { this.printClassProlog(clazz) // TODO: move to Object.groupBy when move to nodejs 21 - const namespaces: Map = groupBy(clazz.methods, it => it.implNamespaceName) + const namespaces: Map = groupBy(clazz.methods, it => it.implNamespaceName) Array.from(namespaces.keys()).forEach (namespaceName => { this.pushNamespace(namespaceName, false) namespaces.get(namespaceName)?.forEach( @@ -227,7 +227,7 @@ class AccessorVisitor extends ModifierVisitor { accessors = createLanguageWriter(Language.CPP, getReferenceResolver(this.library)) accessorList = createLanguageWriter(Language.CPP, getReferenceResolver(this.library)) - constructor(library: IdlPeerLibrary) { + constructor(library: PeerLibrary) { super(library) } @@ -295,7 +295,7 @@ class MultiFileModifiersVisitor extends AccessorVisitor { private hasModifiers = false private hasAccessors = false - printPeerClassModifiers(clazz: IdlPeerClass): void { + printPeerClassModifiers(clazz: PeerClass): void { this.onFileStart(clazz.componentName) this.hasModifiers = true super.printPeerClassModifiers(clazz) @@ -334,7 +334,7 @@ class MultiFileModifiersVisitor extends AccessorVisitor { this.onFileEnd(clazz.className) } - emitRealSync(library: IdlPeerLibrary, libace: LibaceInstall, options: ModifierFileOptions): void { + emitRealSync(library: PeerLibrary, libace: LibaceInstall, options: ModifierFileOptions): void { const modifierList = createLanguageWriter(Language.CPP, getReferenceResolver(library)) const accessorList = createLanguageWriter(Language.CPP, getReferenceResolver(library)) const getterDeclarations = createLanguageWriter(Language.CPP, getReferenceResolver(library)) @@ -359,7 +359,7 @@ class MultiFileModifiersVisitor extends AccessorVisitor { } } -export function printRealAndDummyModifiers(peerLibrary: IdlPeerLibrary, isDummy: boolean = false): {dummy: LanguageWriter, real: LanguageWriter} { +export function printRealAndDummyModifiers(peerLibrary: PeerLibrary, isDummy: boolean = false): {dummy: LanguageWriter, real: LanguageWriter} { const visitor = new ModifierVisitor(peerLibrary, isDummy) visitor.printRealAndDummyModifiers() const dummy = @@ -369,7 +369,7 @@ export function printRealAndDummyModifiers(peerLibrary: IdlPeerLibrary, isDummy: return {dummy, real} } -export function printRealAndDummyAccessors(peerLibrary: IdlPeerLibrary): {dummy: LanguageWriter, real: LanguageWriter} { +export function printRealAndDummyAccessors(peerLibrary: PeerLibrary): {dummy: LanguageWriter, real: LanguageWriter} { const visitor = new AccessorVisitor(peerLibrary) peerLibrary.materializedClasses.forEach(c => visitor.printRealAndDummyAccessor(c)) @@ -394,7 +394,7 @@ export interface ModifierFileOptions { namespaces?: Namespaces } -export function printRealModifiersAsMultipleFiles(library: IdlPeerLibrary, libace: LibaceInstall, options: ModifierFileOptions) { +export function printRealModifiersAsMultipleFiles(library: PeerLibrary, libace: LibaceInstall, options: ModifierFileOptions) { const visitor = new MultiFileModifiersVisitor(library) visitor.printRealAndDummyModifiers() visitor.emitRealSync(library, libace, options) @@ -461,7 +461,7 @@ function printModifiersCommonImplFile(filePath: string, content: LanguageWriter, writer.printTo(filePath) } -function printApiImplFile(library: IdlPeerLibrary, filePath: string, options: ModifierFileOptions) { +function printApiImplFile(library: PeerLibrary, filePath: string, options: ModifierFileOptions) { const writer = new CppLanguageWriter(new IndentedPrinter(), getReferenceResolver(library)) writer.writeLines(cStyleCopyright) writer.writeMultilineCommentBlock(warning) diff --git a/src/peer-generation/printers/NativeModulePrinter.ts b/src/peer-generation/printers/NativeModulePrinter.ts index eecdb622..a4fe2c99 100644 --- a/src/peer-generation/printers/NativeModulePrinter.ts +++ b/src/peer-generation/printers/NativeModulePrinter.ts @@ -16,9 +16,9 @@ import { nativeModuleDeclaration, nativeModuleEmptyDeclaration } from "../FileGenerators"; import { FunctionCallExpression, LanguageWriter, Method, MethodModifier, NamedMethodSignature, StringExpression, createLanguageWriter } from "../LanguageWriters"; import { PeerClassBase } from "../PeerClass"; -import { IdlPeerClass } from "../idl/IdlPeerClass"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; -import { IdlPeerMethod } from "../idl/IdlPeerMethod"; +import { PeerClass } from "../PeerClass"; +import { PeerLibrary } from "../PeerLibrary"; +import { PeerMethod } from "../PeerMethod"; import { Language } from "../../Language"; import * as idl from '../../idl' import { getReferenceResolver } from "../ReferenceResolver"; @@ -40,14 +40,14 @@ class NativeModuleVisitor { ]) constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, ) { this.nativeModule = createLanguageWriter(library.language, getReferenceResolver(library)) this.nativeModuleEmpty = createLanguageWriter(library.language, getReferenceResolver(library)) this.nativeModulePredefined = new Map() } - protected printPeerMethods(peer: IdlPeerClass) { + protected printPeerMethods(peer: PeerClass) { peer.methods.forEach(it => this.printPeerMethod(peer, it, this.nativeModule, this.nativeModuleEmpty, undefined, this.nativeFunctions)) } @@ -63,7 +63,7 @@ class NativeModuleVisitor { }) } - printPeerMethod(clazz: PeerClassBase, method: IdlPeerMethod, nativeModule: LanguageWriter, nativeModuleEmpty: LanguageWriter, + printPeerMethod(clazz: PeerClassBase, method: PeerMethod, nativeModule: LanguageWriter, nativeModuleEmpty: LanguageWriter, returnType?: idl.IDLType, nativeFunctions?: LanguageWriter ) { @@ -188,13 +188,13 @@ class CJNativeModuleVisitor extends NativeModuleVisitor { private stringLikeTypes = new Set(['String', 'KString', 'KStringPtr', 'string']) constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, ) { super(library) this.nativeFunctions = createLanguageWriter(library.language, getReferenceResolver(library)) } - override printPeerMethod(clazz: PeerClassBase, method: IdlPeerMethod, nativeModule: LanguageWriter, nativeModuleEmpty: LanguageWriter, + override printPeerMethod(clazz: PeerClassBase, method: PeerMethod, nativeModule: LanguageWriter, nativeModuleEmpty: LanguageWriter, returnType?: idl.IDLType, nativeFunctions?: LanguageWriter ) { @@ -384,14 +384,14 @@ class CJNativeModuleVisitor extends NativeModuleVisitor { } -export function printNativeModule(peerLibrary: IdlPeerLibrary, nativeBridgePath: string): string { +export function printNativeModule(peerLibrary: PeerLibrary, nativeBridgePath: string): string { const lang = peerLibrary.language const visitor = (lang == Language.CJ) ? new CJNativeModuleVisitor(peerLibrary) : new NativeModuleVisitor(peerLibrary) visitor.print() return nativeModuleDeclaration(visitor.nativeModule, visitor.nativeModulePredefined, nativeBridgePath, false, lang, visitor.nativeFunctions) } -export function printNativeModuleEmpty(peerLibrary: IdlPeerLibrary): string { +export function printNativeModuleEmpty(peerLibrary: PeerLibrary): string { const visitor = new NativeModuleVisitor(peerLibrary) visitor.print() return nativeModuleEmptyDeclaration(visitor.nativeModuleEmpty.getOutput()) diff --git a/src/peer-generation/printers/NativeModuleRecorderPrinter.ts b/src/peer-generation/printers/NativeModuleRecorderPrinter.ts index 4f7bbfde..1a65a66d 100644 --- a/src/peer-generation/printers/NativeModuleRecorderPrinter.ts +++ b/src/peer-generation/printers/NativeModuleRecorderPrinter.ts @@ -15,21 +15,20 @@ import { createLanguageWriter, LanguageWriter, Method, NamedMethodSignature } from "../LanguageWriters"; import { PeerClassBase } from "../PeerClass"; -import { IdlPeerClass } from "../idl/IdlPeerClass"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; -import { IdlPeerMethod } from "../idl/IdlPeerMethod"; +import { PeerClass } from "../PeerClass"; +import { PeerLibrary } from "../PeerLibrary"; +import { PeerMethod } from "../PeerMethod"; import { ImportsCollector } from "../ImportsCollector"; import { makeSyntheticDeclarationsFiles } from "../idl/IdlSyntheticDeclarations"; import { Language } from "../../Language"; -import { createCallback, createContainerType, createParameter, createReferenceType, createUnionType, IDLBigintType, IDLI32Type, IDLNullType, IDLNumberType, IDLObjectType, IDLPointerType, IDLStringType, IDLType, IDLU8Type, IDLUint8ArrayType, IDLVoidType, toIDLType } from "../../idl"; -import { generateSyntheticFunctionName } from "../../IDLVisitor"; +import { createParameter, createReferenceType, createUnionType, IDLI32Type, IDLNullType, IDLNumberType, IDLObjectType, IDLPointerType, IDLStringType, IDLType, IDLUint8ArrayType, IDLVoidType, toIDLType } from "../../idl"; import { collectMaterializedImports } from "../Materialized"; class NativeModuleRecorderVisitor { readonly nativeModuleRecorder: LanguageWriter constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, ) { this.nativeModuleRecorder = createLanguageWriter(library.language, this.library) } @@ -58,11 +57,11 @@ class NativeModuleRecorderVisitor { }) } - private printPeerMethods(peer: IdlPeerClass) { + private printPeerMethods(peer: PeerClass) { peer.methods.forEach(it => this.printPeerMethod(peer, it, this.nativeModuleRecorder, undefined)) } - private printInterface(clazz: IdlPeerClass) { + private printInterface(clazz: PeerClass) { this.nativeModuleRecorder.writeInterface(`${clazz.componentName}Interface`, w => { for (const method of clazz.methods) { for (const arg of method.argConvertors) { @@ -72,7 +71,7 @@ class NativeModuleRecorderVisitor { }, clazz.parentComponentName ? [`${clazz.parentComponentName}Interface`, `UIElement`] : undefined) } - private printPeerMethod(clazz: PeerClassBase, method: IdlPeerMethod, nativeModuleRecorder: LanguageWriter, returnType?: IDLType) { + private printPeerMethod(clazz: PeerClassBase, method: PeerMethod, nativeModuleRecorder: LanguageWriter, returnType?: IDLType) { const component = clazz.generatedName(method.isCallSignature) const interfaceName = clazz.getComponentName() clazz.setGenerationContext(`${method.isCallSignature ? "" : method.overloadedName}()`) @@ -360,7 +359,7 @@ class NativeModuleRecorderVisitor { } } -export function printNativeModuleRecorder(library: IdlPeerLibrary): string { +export function printNativeModuleRecorder(library: PeerLibrary): string { let visitor switch (library.language) { case Language.TS: diff --git a/src/peer-generation/printers/NodeTypesPrinter.ts b/src/peer-generation/printers/NodeTypesPrinter.ts index cadf0299..3db969d5 100644 --- a/src/peer-generation/printers/NodeTypesPrinter.ts +++ b/src/peer-generation/printers/NodeTypesPrinter.ts @@ -15,13 +15,13 @@ import { IndentedPrinter } from "../../IndentedPrinter"; import { getNodeTypes, makeNodeTypes } from "../FileGenerators"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; +import { PeerLibrary } from "../PeerLibrary"; class NodeTypesVisitor { readonly nodeTypes: IndentedPrinter = new IndentedPrinter() constructor( - private library: IdlPeerLibrary, + private library: PeerLibrary, ) {} print(): void { @@ -31,7 +31,7 @@ class NodeTypesVisitor { } } -export function printNodeTypes(peerLibrary: IdlPeerLibrary): string { +export function printNodeTypes(peerLibrary: PeerLibrary): string { const visitor = new NodeTypesVisitor(peerLibrary) visitor.print() return makeNodeTypes(visitor.nodeTypes.getOutput()) diff --git a/src/peer-generation/printers/OverloadsPrinter.ts b/src/peer-generation/printers/OverloadsPrinter.ts index 47d6e53a..8887513b 100644 --- a/src/peer-generation/printers/OverloadsPrinter.ts +++ b/src/peer-generation/printers/OverloadsPrinter.ts @@ -25,8 +25,8 @@ import { import { PeerClassBase } from "../PeerClass"; import { isDefined } from "../../util"; import { callbackIdByInfo, canProcessCallback, convertIdlToCallback } from "./EventsPrinter"; -import { IdlPeerMethod } from "../idl/IdlPeerMethod"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; +import { PeerMethod } from "../PeerMethod"; +import { PeerLibrary } from "../PeerLibrary"; import { typeOrUnion } from "../idl/common"; import { ArgConvertor, UndefinedConvertor, UnionRuntimeTypeChecker } from '../ArgConvertors'; import { Language } from "../../Language"; @@ -62,7 +62,7 @@ export function collapseSameNamedMethods(methods: Method[], selectMaxMethodArgs? ) } -export function collapseIdlPeerMethods(library: IdlPeerLibrary, overloads: IdlPeerMethod[], selectMaxMethodArgs?: number[]): IdlPeerMethod { +export function collapseIdlPeerMethods(library: PeerLibrary, overloads: PeerMethod[], selectMaxMethodArgs?: number[]): PeerMethod { const method = collapseSameNamedMethods(overloads.map(it => it.method), selectMaxMethodArgs) const maxArgsLength = Math.max(...overloads.map(it => it.method.signature.args.length)) const maxMethod = overloads.find(it => it.method.signature.args.length === maxArgsLength)! @@ -90,7 +90,7 @@ export function collapseIdlPeerMethods(library: IdlPeerLibrary, overloads: IdlPe idl.isOptionalType(method.signature.args[index]) ) }) - return new IdlPeerMethod( + return new PeerMethod( overloads[0].originalParentName, typeConvertors, overloads[0].retConvertor, @@ -99,7 +99,7 @@ export function collapseIdlPeerMethods(library: IdlPeerLibrary, overloads: IdlPe ) } -export function groupOverloads(peerMethods: T[]): T[][] { +export function groupOverloads(peerMethods: T[]): T[][] { const seenNames = new Set() const groups: T[][] = [] for (const method of peerMethods) { @@ -121,7 +121,7 @@ export class OverloadsPrinter { } } - printGroupedComponentOverloads(peer: PeerClassBase, peerMethods: (IdlPeerMethod)[]) { + printGroupedComponentOverloads(peer: PeerClassBase, peerMethods: (PeerMethod)[]) { const orderedMethods = Array.from(peerMethods) .sort((a, b) => b.argConvertors.length - a.argConvertors.length) const collapsedMethod = collapseSameNamedMethods(orderedMethods.map(it => it.method)) @@ -154,7 +154,7 @@ export class OverloadsPrinter { }) } - printComponentOverloadSelector(peer: PeerClassBase, collapsedMethod: Method, peerMethod: IdlPeerMethod, methodIndex: number, runtimeTypeCheckers: UnionRuntimeTypeChecker[]) { + printComponentOverloadSelector(peer: PeerClassBase, collapsedMethod: Method, peerMethod: PeerMethod, methodIndex: number, runtimeTypeCheckers: UnionRuntimeTypeChecker[]) { const argsConditions = collapsedMethod.signature.args.map((_, argIndex) => runtimeTypeCheckers[argIndex].makeDiscriminator(collapsedMethod.signature.argName(argIndex), methodIndex, this.printer)) this.printer.print(`if (${this.printer.makeNaryOp("&&", argsConditions).asString()}) {`) @@ -164,7 +164,7 @@ export class OverloadsPrinter { this.printer.print('}') } - private printPeerCallAndReturn(peer: PeerClassBase, collapsedMethod: Method, peerMethod: IdlPeerMethod) { + private printPeerCallAndReturn(peer: PeerClassBase, collapsedMethod: Method, peerMethod: PeerMethod) { const argsNames = peerMethod.argConvertors.map((conv, index) => { const argName = collapsedMethod.signature.argName(index) const castedArgName = `${argName}_casted` diff --git a/src/peer-generation/printers/PeersPrinter.ts b/src/peer-generation/printers/PeersPrinter.ts index b9e283ae..a738c229 100644 --- a/src/peer-generation/printers/PeersPrinter.ts +++ b/src/peer-generation/printers/PeersPrinter.ts @@ -35,10 +35,10 @@ import { ARKOALA_PACKAGE, ARKOALA_PACKAGE_PATH } from "./lang/Java"; import { TargetFile } from "./TargetFile"; import { PrinterContext } from "./PrinterContext"; import { PeerGeneratorConfig } from "../PeerGeneratorConfig"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; -import { IdlPeerFile } from "../idl/IdlPeerFile"; -import { IdlPeerClass } from "../idl/IdlPeerClass"; -import { IdlPeerMethod } from "../idl/IdlPeerMethod"; +import { PeerLibrary } from "../PeerLibrary"; +import { PeerFile } from "../PeerFile"; +import { PeerClass } from "../PeerClass"; +import { PeerMethod } from "../PeerMethod"; import { collectJavaImports } from "./lang/JavaIdlUtils"; import { printJavaImports } from "./lang/JavaPrinters"; import { Language } from "../../Language"; @@ -59,13 +59,13 @@ class PeerFileVisitor { //TODO: Ignore until bugs are fixed in https://rnd-gitlab-msc.huawei.com/rus-os-team/virtual-machines-and-tools/panda/-/issues/17850 constructor( - protected readonly library: IdlPeerLibrary, - protected readonly file: IdlPeerFile, + protected readonly library: PeerLibrary, + protected readonly file: PeerFile, protected readonly printerContext: PrinterContext, protected readonly dumpSerialized: boolean, ) { } - protected generatePeerParentName(peer: IdlPeerClass): string { + protected generatePeerParentName(peer: PeerClass): string { if (!peer.originalClassName) throw new Error(`${peer.componentName} is not supported, use 'uselessConstructorInterfaces' for now`) const parentRole = determineParentRole(peer.originalClassName, peer.parentComponentName) @@ -76,7 +76,7 @@ class PeerFileVisitor { return componentToPeerClass(parent) } - protected generateAttributesParentClass(peer: IdlPeerClass): string | undefined { + protected generateAttributesParentClass(peer: PeerClass): string | undefined { if (!isHeir(peer.originalClassName!)) return undefined return componentToAttributesClass(peer.parentComponentName!) } @@ -131,7 +131,7 @@ class PeerFileVisitor { imports.print(printer, `./peers/${targetBasename}`) } - protected printAttributes(peer: IdlPeerClass, printer: LanguageWriter) { + protected printAttributes(peer: PeerClass, printer: LanguageWriter) { for (const attributeType of peer.attributesTypes) printer.print(attributeType.content) @@ -148,7 +148,7 @@ class PeerFileVisitor { }, parent ? [parent] : undefined) } - protected printPeerConstructor(peer: IdlPeerClass, printer: LanguageWriter): void { + protected printPeerConstructor(peer: PeerClass, printer: LanguageWriter): void { // TODO: fully switch to writer! const parentRole = determineParentRole(peer.originalClassName, peer.originalParentName) const isNode = parentRole !== InheritanceRole.Finalizable @@ -167,7 +167,7 @@ class PeerFileVisitor { }, undefined, [MethodModifier.PROTECTED]) } - protected printCreateMethod(peer: IdlPeerClass, writer: LanguageWriter): void { + protected printCreateMethod(peer: PeerClass, writer: LanguageWriter): void { const peerClass = componentToPeerClass(peer.componentName) const signature = new NamedMethodSignature( toIDLType(peerClass), @@ -184,13 +184,13 @@ class PeerFileVisitor { }) } - protected printPeerMethod(method: IdlPeerMethod, printer: LanguageWriter) { + protected printPeerMethod(method: PeerMethod, printer: LanguageWriter) { this.library.setCurrentContext(`${method.originalParentName}.${method.overloadedName}`) writePeerMethod(printer, method, true, this.printerContext, this.dumpSerialized, "Attribute", "this.peer.ptr") this.library.setCurrentContext(undefined) } - protected printApplyMethod(peer: IdlPeerClass, printer: LanguageWriter) { + protected printApplyMethod(peer: PeerClass, printer: LanguageWriter) { const name = peer.originalClassName! const typeParam = componentToAttributesClass(peer.componentName) if (isRoot(name)) { @@ -204,7 +204,7 @@ class PeerFileVisitor { printer.print(`}`) } - protected printPeer(peer: IdlPeerClass, printer: LanguageWriter) { + protected printPeer(peer: PeerClass, printer: LanguageWriter) { printer.writeClass(componentToPeerClass(peer.componentName), (writer) => { this.printPeerConstructor(peer, writer) this.printCreateMethod(peer, writer); @@ -254,8 +254,8 @@ class PeerFileVisitor { class JavaPeerFileVisitor extends PeerFileVisitor { constructor( - protected readonly library: IdlPeerLibrary, - protected readonly file: IdlPeerFile, + protected readonly library: PeerLibrary, + protected readonly file: PeerFile, printerContext: PrinterContext, dumpSerialized: boolean, ) { @@ -268,7 +268,7 @@ class JavaPeerFileVisitor extends PeerFileVisitor { } } - protected printApplyMethod(peer: IdlPeerClass, printer: LanguageWriter) { + protected printApplyMethod(peer: PeerClass, printer: LanguageWriter) { // TODO: attributes // const name = peer.originalClassName! // const typeParam = componentToAttributesClass(peer.componentName) @@ -292,7 +292,7 @@ class JavaPeerFileVisitor extends PeerFileVisitor { this.printPackage(printer) - const idlPeer = peer as IdlPeerClass + const idlPeer = peer as PeerClass const imports = collectJavaImports(idlPeer.methods.flatMap(method => method.method.signature.args)) printJavaImports(printer, imports) @@ -312,8 +312,8 @@ class JavaPeerFileVisitor extends PeerFileVisitor { class CJPeerFileVisitor extends PeerFileVisitor { constructor( - protected readonly library: IdlPeerLibrary, - protected readonly file: IdlPeerFile, + protected readonly library: PeerLibrary, + protected readonly file: PeerFile, printerContext: PrinterContext, dumpSerialized: boolean, ) { @@ -326,7 +326,7 @@ class CJPeerFileVisitor extends PeerFileVisitor { } } - protected printApplyMethod(peer: IdlPeerClass, printer: LanguageWriter) { + protected printApplyMethod(peer: PeerClass, printer: LanguageWriter) { } printFile(): void { @@ -339,7 +339,7 @@ class CJPeerFileVisitor extends PeerFileVisitor { this.printPackage(printer) if (isIDL) { - const idlPeer = peer as IdlPeerClass + const idlPeer = peer as PeerClass const imports = collectJavaImports(idlPeer.methods.flatMap(method => method.method.signature.args)) printJavaImports(printer, imports) } @@ -352,7 +352,7 @@ class PeersVisitor { readonly peers: Map = new Map() constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, private readonly printerContext: PrinterContext, private readonly dumpSerialized: boolean, ) { } @@ -376,7 +376,7 @@ class PeersVisitor { const returnValName = "retval" // make sure this doesn't collide with parameter names! -export function printPeers(peerLibrary: IdlPeerLibrary, printerContext: PrinterContext, dumpSerialized: boolean): Map { +export function printPeers(peerLibrary: PeerLibrary, printerContext: PrinterContext, dumpSerialized: boolean): Map { const visitor = new PeersVisitor(peerLibrary, printerContext, dumpSerialized) visitor.printPeers() const result = new Map() @@ -402,7 +402,7 @@ export function printPeerFinalizer(peerClassBase: PeerClassBase, writer: Languag }) } -export function writePeerMethod(printer: LanguageWriter, method: IdlPeerMethod, isIDL: boolean, printerContext: PrinterContext, dumpSerialized: boolean, +export function writePeerMethod(printer: LanguageWriter, method: PeerMethod, isIDL: boolean, printerContext: PrinterContext, dumpSerialized: boolean, methodPostfix: string, ptr: string, returnType: IDLType = IDLVoidType, generics?: string[] ) { const signature = method.method.signature as NamedMethodSignature @@ -504,7 +504,7 @@ export function writePeerMethod(printer: LanguageWriter, method: IdlPeerMethod, }) } -function returnsThis(method: IdlPeerMethod, returnType: IDLType) { +function returnsThis(method: PeerMethod, returnType: IDLType) { return method.hasReceiver() && returnType === IDLThisType } diff --git a/src/peer-generation/printers/SerializerPrinter.ts b/src/peer-generation/printers/SerializerPrinter.ts index a584da34..46911190 100644 --- a/src/peer-generation/printers/SerializerPrinter.ts +++ b/src/peer-generation/printers/SerializerPrinter.ts @@ -19,7 +19,7 @@ import { PrimitiveType } from "../ArkPrimitiveType" import { ExpressionStatement, LanguageStatement, LanguageWriter, Method, MethodSignature, NamedMethodSignature } from "../LanguageWriters"; import { PeerGeneratorConfig } from '../PeerGeneratorConfig'; import { ImportsCollector } from '../ImportsCollector'; -import { IdlPeerLibrary } from '../idl/IdlPeerLibrary'; +import { PeerLibrary } from '../PeerLibrary'; import { ArkTSBuiltTypesDependencyFilter, convertDeclToFeature, @@ -27,7 +27,7 @@ import { isMaterialized, } from '../idl/IdlPeerGeneratorVisitor'; import { isSyntheticDeclaration, makeSyntheticDeclarationsFiles } from '../idl/IdlSyntheticDeclarations'; -import { collectProperties } from '../idl/StructPrinter'; +import { collectProperties } from '../printers/StructPrinter'; import { MakeAssignOptions, MethodArgPrintHint } from '../LanguageWriters/LanguageWriter'; import { FieldModifier, IfStatement, MethodModifier, ProxyStatement, ReturnStatement } from '../LanguageWriters/LanguageWriter'; import { DeclarationNameConvertor } from '../idl/IdlNameConvertor'; @@ -42,7 +42,7 @@ import { ModifierFlags } from 'typescript'; class IdlSerializerPrinter { constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, private readonly writer: LanguageWriter, ) {} @@ -194,7 +194,7 @@ class IdlSerializerPrinter { class IdlDeserializerPrinter {///converge w/ IdlSerP? constructor( - private readonly library: IdlPeerLibrary, + private readonly library: PeerLibrary, private readonly writer: LanguageWriter, ) {} @@ -395,16 +395,16 @@ class IdlDeserializerPrinter {///converge w/ IdlSerP? } } -export function writeSerializer(library: IdlPeerLibrary, writer: LanguageWriter, prefix: string, declarationPath?: string) { +export function writeSerializer(library: PeerLibrary, writer: LanguageWriter, prefix: string, declarationPath?: string) { new IdlSerializerPrinter(library, writer).print(prefix, declarationPath) } -export function writeDeserializer(library: IdlPeerLibrary, writer: LanguageWriter, prefix = "", declarationPath?: string) { +export function writeDeserializer(library: PeerLibrary, writer: LanguageWriter, prefix = "", declarationPath?: string) { const printer = new IdlDeserializerPrinter(library, writer) printer.print(prefix, declarationPath) } -function getSerializers(library: IdlPeerLibrary, dependencyFilter: DependencyFilter): SerializableTarget[] { +function getSerializers(library: PeerLibrary, dependencyFilter: DependencyFilter): SerializableTarget[] { const seenNames = new Set() return library.orderedDependenciesToGenerate .filter((it): it is SerializableTarget => dependencyFilter.shouldAdd(it)) @@ -415,7 +415,7 @@ function getSerializers(library: IdlPeerLibrary, dependencyFilter: DependencyFil }) } -function printIdlImports(library: IdlPeerLibrary, serializerDeclarations: SerializableTarget[], writer: LanguageWriter, declarationPath?: string) { +function printIdlImports(library: PeerLibrary, serializerDeclarations: SerializableTarget[], writer: LanguageWriter, declarationPath?: string) { const collector = new ImportsCollector() if (writer.language === Language.TS) { diff --git a/src/peer-generation/idl/StructPrinter.ts b/src/peer-generation/printers/StructPrinter.ts similarity index 97% rename from src/peer-generation/idl/StructPrinter.ts rename to src/peer-generation/printers/StructPrinter.ts index 91cae360..d4c939d4 100644 --- a/src/peer-generation/idl/StructPrinter.ts +++ b/src/peer-generation/printers/StructPrinter.ts @@ -13,25 +13,23 @@ * limitations under the License. */ -import { LibraryInterface } from "../../LibraryInterface" import * as idl from "../../idl" -import { IDLEntry, IDLType } from "../../idl" +import { IDLType } from "../../idl" import { IndentedPrinter } from "../../IndentedPrinter" import { Language } from "../../Language" -import { camelCaseToUpperSnakeCase, throwException } from "../../util" +import { camelCaseToUpperSnakeCase } from "../../util" import { RuntimeType } from "../ArgConvertors" -// import { ArkPrimitiveType } from "../DeclarationTable" import { PrimitiveType } from "../ArkPrimitiveType" import { createLanguageWriter, LanguageExpression, LanguageWriter, Method, MethodModifier, NamedMethodSignature } from "../LanguageWriters" import { PeerGeneratorConfig } from "../PeerGeneratorConfig" -import { isImport, isStringEnum } from "./common" +import { isImport, isStringEnum } from "../idl/common" import { generateCallbackAPIArguments } from "../ArgConvertors" -import { isBuilderClass, isMaterialized } from "./IdlPeerGeneratorVisitor" -import { cleanPrefix, IdlPeerLibrary } from "./IdlPeerLibrary" +import { isBuilderClass, isMaterialized } from "../idl/IdlPeerGeneratorVisitor" +import { cleanPrefix, PeerLibrary } from "../PeerLibrary" import { MethodArgPrintHint } from "../LanguageWriters/LanguageWriter" export class StructPrinter { - constructor(private library: IdlPeerLibrary) {} + constructor(private library: PeerLibrary) {} private isPointerDeclaration(target: idl.IDLNode, isOptional: boolean = false): boolean { if (isOptional) return true @@ -465,7 +463,7 @@ inline void WriteToString(std::string* result, const ${name}* value) { } } -export function collectProperties(decl: idl.IDLInterface, library: IdlPeerLibrary): idl.IDLProperty[] { +export function collectProperties(decl: idl.IDLInterface, library: PeerLibrary): idl.IDLProperty[] { const superType = idl.getSuperType(decl) const superDecl = superType ? library.resolveTypeReference(/* FIX */ superType as idl.IDLReferenceType) : undefined return [ @@ -496,7 +494,7 @@ function groupProps(properties: NameWithType[]): NameWithType[] { return result } -function collectBuilderProperties(decl: idl.IDLInterface, library: IdlPeerLibrary): idl.IDLProperty[] { +function collectBuilderProperties(decl: idl.IDLInterface, library: PeerLibrary): idl.IDLProperty[] { if (!isBuilderClass(decl)) { return [] } diff --git a/src/peer-generation/printers/TypeCheckPrinter.ts b/src/peer-generation/printers/TypeCheckPrinter.ts index 46084a39..b0700266 100644 --- a/src/peer-generation/printers/TypeCheckPrinter.ts +++ b/src/peer-generation/printers/TypeCheckPrinter.ts @@ -10,7 +10,7 @@ import { NamedMethodSignature } from "../LanguageWriters"; import { throwException } from "../../util"; -import { IdlPeerLibrary } from "../idl/IdlPeerLibrary"; +import { PeerLibrary } from "../PeerLibrary"; import { convertDeclToFeature, createDeclDependenciesCollector, createTypeDependenciesCollector, @@ -35,7 +35,7 @@ const builtInInterfaceTypes = new Map writer.makeCallIsResource(value)], ]) -export function importTypeChecker(library: IdlPeerLibrary, imports: ImportsCollector): void { +export function importTypeChecker(library: PeerLibrary, imports: ImportsCollector): void { imports.addFeature("TypeChecker", "#components") } @@ -65,7 +65,7 @@ class StructDescriptor { } } -function collectFields(library: IdlPeerLibrary, target: idl.IDLInterface, struct: StructDescriptor): void { +function collectFields(library: PeerLibrary, target: idl.IDLInterface, struct: StructDescriptor): void { const superType = idl.getSuperType(target) if (superType && idl.isReferenceType(superType)) { const decl = library.resolveTypeReference(superType) ?? throwException(`Wrong type reference ${idl.IDLKind[superType.kind]}`) @@ -79,7 +79,7 @@ function collectFields(library: IdlPeerLibrary, target: idl.IDLInterface, struct }) } -function makeStructDescriptor(library: IdlPeerLibrary, target: idl.IDLEntry): StructDescriptor { +function makeStructDescriptor(library: PeerLibrary, target: idl.IDLEntry): StructDescriptor { const result = new StructDescriptor() if (idl.isInterface(target) || idl.isAnonymousInterface(target) @@ -92,7 +92,7 @@ function makeStructDescriptor(library: IdlPeerLibrary, target: idl.IDLEntry): St abstract class TypeCheckerPrinter { constructor( - protected readonly library: IdlPeerLibrary, + protected readonly library: PeerLibrary, public readonly writer: LanguageWriter, ) {} @@ -182,7 +182,7 @@ abstract class TypeCheckerPrinter { class ARKTSTypeCheckerPrinter extends TypeCheckerPrinter { constructor( - library: IdlPeerLibrary + library: PeerLibrary ) { super(library, createLanguageWriter(Language.ARKTS, getReferenceResolver(library))) } @@ -214,7 +214,7 @@ class ARKTSTypeCheckerPrinter extends TypeCheckerPrinter { class TSTypeCheckerPrinter extends TypeCheckerPrinter { constructor( - library: IdlPeerLibrary + library: PeerLibrary ) { super(library, createLanguageWriter(Language.TS, getReferenceResolver(library))) } @@ -261,13 +261,13 @@ class TSTypeCheckerPrinter extends TypeCheckerPrinter { } } -export function writeARKTSTypeCheckers(library: IdlPeerLibrary, printer: LanguageWriter) { +export function writeARKTSTypeCheckers(library: PeerLibrary, printer: LanguageWriter) { const checker = new ARKTSTypeCheckerPrinter(library) checker.print() printer.concat(checker.writer) } -export function writeTSTypeCheckers(library: IdlPeerLibrary, printer: LanguageWriter) { +export function writeTSTypeCheckers(library: PeerLibrary, printer: LanguageWriter) { const checker = new TSTypeCheckerPrinter(library) checker.print() printer.concat(checker.writer) diff --git a/src/peer-generation/printers/lang/CJPrinters.ts b/src/peer-generation/printers/lang/CJPrinters.ts index 4b1c99e7..4f26f265 100644 --- a/src/peer-generation/printers/lang/CJPrinters.ts +++ b/src/peer-generation/printers/lang/CJPrinters.ts @@ -14,7 +14,7 @@ */ import { IDLI32Type, IDLType, IDLVoidType } from "../../../idl" -import { IdlPeerLibrary } from "../../idl/IdlPeerLibrary" +import { PeerLibrary } from "../../PeerLibrary" import { ImportFeature } from "../../ImportsCollector" import { createLanguageWriter, @@ -28,14 +28,14 @@ import { TargetFile } from "../TargetFile" import { ARK_OBJECTBASE, ARK_UI_NODE_TYPE, ARKOALA_PACKAGE, ARKOALA_PACKAGE_PATH } from "./Cangjie" import { IdlSyntheticTypeBase } from "./CommonUtils" -export function makeCJSerializer(library: IdlPeerLibrary): { targetFile: TargetFile, writer: LanguageWriter } { +export function makeCJSerializer(library: PeerLibrary): { targetFile: TargetFile, writer: LanguageWriter } { let writer = createLanguageWriter(library.language, getReferenceResolver(library)) writer.print(`package idlize\n`) writeSerializer(library, writer, "") return { targetFile: new TargetFile('Serializer', ARKOALA_PACKAGE_PATH), writer: writer } } -export function makeCJNodeTypes(library: IdlPeerLibrary): { targetFile: TargetFile, writer: LanguageWriter } { +export function makeCJNodeTypes(library: PeerLibrary): { targetFile: TargetFile, writer: LanguageWriter } { const componentNames = library.files.flatMap(file => { return Array.from(file.peers.values()).map(peer => peer.componentName) }) diff --git a/src/peer-generation/printers/lang/JavaPrinters.ts b/src/peer-generation/printers/lang/JavaPrinters.ts index 200c5653..caa8f0c2 100644 --- a/src/peer-generation/printers/lang/JavaPrinters.ts +++ b/src/peer-generation/printers/lang/JavaPrinters.ts @@ -14,8 +14,8 @@ */ import { IDLI32Type, IDLType, IDLVoidType, toIDLType } from "../../../idl" -import { IdlPeerLibrary } from "../../idl/IdlPeerLibrary" -import { IdlPeerMethod } from "../../idl/IdlPeerMethod" +import { PeerLibrary } from "../../PeerLibrary" +import { PeerMethod } from "../../PeerMethod" import { ImportFeature } from "../../ImportsCollector" import { LanguageWriter, createLanguageWriter, NamedMethodSignature, Method, MethodModifier, MethodSignature, FieldModifier } from "../../LanguageWriters" import { getReferenceResolver } from "../../ReferenceResolver" @@ -28,7 +28,7 @@ import { IdlSyntheticTypeBase } from "./CommonUtils" import { ARKOALA_PACKAGE, ARKOALA_PACKAGE_PATH, ARK_UI_NODE_TYPE, ARK_BASE, ARK_OBJECTBASE, INT_VALUE_GETTER } from "./Java" import { collectJavaImports } from "./JavaIdlUtils" -export function makeJavaSerializer(library: IdlPeerLibrary): { targetFile: TargetFile, writer: LanguageWriter } { +export function makeJavaSerializer(library: PeerLibrary): { targetFile: TargetFile, writer: LanguageWriter } { let writer = createLanguageWriter(library.language, getReferenceResolver(library)) writer.print(`package ${ARKOALA_PACKAGE};\n`) writeSerializer(library, writer, "") @@ -45,7 +45,7 @@ export function printJavaImports(printer: LanguageWriter, imports: ImportFeature printer.print('') } -export function makeJavaNodeTypes(library: IdlPeerLibrary): { targetFile: TargetFile, writer: LanguageWriter } { +export function makeJavaNodeTypes(library: PeerLibrary): { targetFile: TargetFile, writer: LanguageWriter } { const componentNames = library.files.flatMap(file => { return Array.from(file.peers.values()).map(peer => peer.componentName) }) @@ -58,7 +58,7 @@ export function makeJavaNodeTypes(library: IdlPeerLibrary): { targetFile: Target return { targetFile: new TargetFile(ARK_UI_NODE_TYPE, ARKOALA_PACKAGE_PATH), writer: writer } } -export function makeJavaArkComponents(library: IdlPeerLibrary, printerContext: PrinterContext): { targetFile: TargetFile, writer: LanguageWriter } { +export function makeJavaArkComponents(library: PeerLibrary, printerContext: PrinterContext): { targetFile: TargetFile, writer: LanguageWriter } { const ark = 'Ark' const receiver = 'receiver' const create = 'create' @@ -80,7 +80,7 @@ export function makeJavaArkComponents(library: IdlPeerLibrary, printerContext: P const paramTypes = [toIDLType(`Consumer<${arkComponent}>`), toIDLType('Runnable')] const paramNames = ['style', 'content'] const callableMethods = peer.methods.filter(it => it.isCallSignature) - let callableMethod: IdlPeerMethod | undefined + let callableMethod: PeerMethod | undefined if (callableMethods.length > 1) { throw new Error(`More than 1 method with callSignature in ${peer.componentName}`) } diff --git a/src/skoala-generation/idl/idlSkoalaLibrary.ts b/src/skoala-generation/idl/idlSkoalaLibrary.ts index 38b48cac..8ea09eee 100644 --- a/src/skoala-generation/idl/idlSkoalaLibrary.ts +++ b/src/skoala-generation/idl/idlSkoalaLibrary.ts @@ -21,7 +21,7 @@ import { DeclarationDependenciesCollector, TypeDependenciesCollector } from '../ import { ImportsCollector } from "../../peer-generation/ImportsCollector"; import { capitalize, isDefined, throwException } from "../../util"; import { PrimitiveType } from "../../peer-generation/ArkPrimitiveType"; -import { cleanPrefix } from "../../peer-generation/idl/IdlPeerLibrary"; +import { cleanPrefix } from "../../peer-generation/PeerLibrary"; import { WrapperClass, WrapperField, WrapperMethod } from "../WrapperClass"; import { Skoala } from "../utils"; import { Field, FieldModifier, LanguageExpression, LanguageStatement, LanguageWriter, Method, MethodModifier, NamedMethodSignature } from "../../peer-generation/LanguageWriters"; -- Gitee From 66762e74876434bd80fa5e41de218b3ade44ff11 Mon Sep 17 00:00:00 2001 From: scherbatiyalexander Date: Fri, 15 Nov 2024 10:12:29 +0000 Subject: [PATCH 05/53] update doc/CUSTOMOBJECT.md. Remove [Namespace=text] from the custom object doc. Signed-off-by: scherbatiyalexander --- doc/CUSTOMOBJECT.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/CUSTOMOBJECT.md b/doc/CUSTOMOBJECT.md index 84745e9e..3d1b941d 100644 --- a/doc/CUSTOMOBJECT.md +++ b/doc/CUSTOMOBJECT.md @@ -33,7 +33,6 @@ node . --dts2idl --input-dir ./interface_sdk-js/api,./interface_sdk-js/api/\@int - find an idl declaration for necessary CustomObject in the `full-idl` dir. For example `RectWidthStyle` declaration is placed in the file `@ohos.graphics.text.idl`: ``` -[Namespace=text] dictionary RectWidthStyle { number TIGHT; number MAX; -- Gitee From 2016d2618e03041e32ba90ea62ad71bdc83b61de Mon Sep 17 00:00:00 2001 From: scherbatiyalexander Date: Fri, 15 Nov 2024 12:11:03 +0000 Subject: [PATCH 06/53] !970 Fix bindSheet() test * Fix bindSheet() test --- peer_lib/sig/arkoala-arkts/arkui/src/generated/main.ts | 9 +++++++++ peer_lib/sig/arkoala/arkui/src/main.ts | 2 +- tests/arkts-subset/ets/common.d.ts | 1 + tests/subset/ets/common.d.ts | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/peer_lib/sig/arkoala-arkts/arkui/src/generated/main.ts b/peer_lib/sig/arkoala-arkts/arkui/src/generated/main.ts index d4a14114..da22bb46 100644 --- a/peer_lib/sig/arkoala-arkts/arkui/src/generated/main.ts +++ b/peer_lib/sig/arkoala-arkts/arkui/src/generated/main.ts @@ -41,6 +41,7 @@ import { BlurOptions, EdgeStyles, UIContext, ScrollSizeMode, + Position, SheetKeyboardAvoidMode } from "@arkoala/arkui/ArkCommonInterfaces" import { Dimension, Length, @@ -208,6 +209,7 @@ class SheetOptionsImpl implements SheetOptions { _onWillAppear: (() => void) | undefined _onWillDisappear: (() => void) | undefined _keyboardAvoidMode: SheetKeyboardAvoidMode | undefined + _offset: Position | undefined constructor(title?: SheetTitleOptions) { this._title = title @@ -422,6 +424,13 @@ class SheetOptionsImpl implements SheetOptions { set keyboardAvoidMode(arg: SheetKeyboardAvoidMode | undefined) { this._keyboardAvoidMode = arg } + + get offset(): Position | undefined { + return this._offset + } + set offset(arg: Position | undefined) { + this._offset = arg + } } class BlurOptionsImpl implements BlurOptions { diff --git a/peer_lib/sig/arkoala/arkui/src/main.ts b/peer_lib/sig/arkoala/arkui/src/main.ts index 77d9b148..19b22736 100644 --- a/peer_lib/sig/arkoala/arkui/src/main.ts +++ b/peer_lib/sig/arkoala/arkui/src/main.ts @@ -312,7 +312,7 @@ function checkButton() { title: { id: 43, type: 2000, bundleName: "MyApp", moduleName: "MyApp", params: ["param1", "param2"] } } }), - `bindSheet({.selector=0, .value0=false}, {.resource={.resourceId=201, .hold=0, .release=0}, .call=0}, {.tag=ARK_TAG_OBJECT, .value={.backgroundColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .onAppear={.tag=ARK_TAG_UNDEFINED, .value={}}, .onDisappear={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillAppear={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillDisappear={.tag=ARK_TAG_UNDEFINED, .value={}}, .height={.tag=ARK_TAG_UNDEFINED, .value={}}, .dragBar={.tag=ARK_TAG_UNDEFINED, .value={}}, .maskColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .detents={.tag=ARK_TAG_UNDEFINED, .value={}}, .blurStyle={.tag=ARK_TAG_UNDEFINED, .value={}}, .showClose={.tag=ARK_TAG_UNDEFINED, .value={}}, .preferType={.tag=ARK_TAG_UNDEFINED, .value={}}, .title={.tag=ARK_TAG_OBJECT, .value={.selector=0, .value0={.title={.selector=1, .value1={.bundleName={.chars="MyApp", .length=5}, .moduleName={.chars="MyApp", .length=5}, .id={.tag=102, .i32=43}, .params={.tag=ARK_TAG_OBJECT, .value={.array=allocArray({{{.chars="param1", .length=6}, {.chars="param2", .length=6}}}), .length=2}}, .type={.tag=ARK_TAG_OBJECT, .value={.tag=102, .i32=2000}}}}, .subtitle={.tag=ARK_TAG_UNDEFINED, .value={}}}}}, .shouldDismiss={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillDismiss={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillSpringBackWhenDismiss={.tag=ARK_TAG_UNDEFINED, .value={}}, .enableOutsideInteractive={.tag=ARK_TAG_UNDEFINED, .value={}}, .width={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderWidth={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderStyle={.tag=ARK_TAG_UNDEFINED, .value={}}, .shadow={.tag=ARK_TAG_UNDEFINED, .value={}}, .onHeightDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .mode={.tag=ARK_TAG_UNDEFINED, .value={}}, .scrollSizeMode={.tag=ARK_TAG_UNDEFINED, .value={}}, .onDetentsDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWidthDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .onTypeDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .uiContext={.tag=ARK_TAG_UNDEFINED, .value={}}, .keyboardAvoidMode={.tag=ARK_TAG_UNDEFINED, .value={}}, .enableHoverMode={.tag=ARK_TAG_UNDEFINED, .value={}}, .hoverModeArea={.tag=ARK_TAG_UNDEFINED, .value={}}}})` + `bindSheet({.selector=0, .value0=false}, {.resource={.resourceId=201, .hold=0, .release=0}, .call=0}, {.tag=ARK_TAG_OBJECT, .value={.backgroundColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .onAppear={.tag=ARK_TAG_UNDEFINED, .value={}}, .onDisappear={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillAppear={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillDisappear={.tag=ARK_TAG_UNDEFINED, .value={}}, .height={.tag=ARK_TAG_UNDEFINED, .value={}}, .dragBar={.tag=ARK_TAG_UNDEFINED, .value={}}, .maskColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .detents={.tag=ARK_TAG_UNDEFINED, .value={}}, .blurStyle={.tag=ARK_TAG_UNDEFINED, .value={}}, .showClose={.tag=ARK_TAG_UNDEFINED, .value={}}, .preferType={.tag=ARK_TAG_UNDEFINED, .value={}}, .title={.tag=ARK_TAG_OBJECT, .value={.selector=0, .value0={.title={.selector=1, .value1={.bundleName={.chars="MyApp", .length=5}, .moduleName={.chars="MyApp", .length=5}, .id={.tag=102, .i32=43}, .params={.tag=ARK_TAG_OBJECT, .value={.array=allocArray({{{.chars="param1", .length=6}, {.chars="param2", .length=6}}}), .length=2}}, .type={.tag=ARK_TAG_OBJECT, .value={.tag=102, .i32=2000}}}}, .subtitle={.tag=ARK_TAG_UNDEFINED, .value={}}}}}, .shouldDismiss={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillDismiss={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillSpringBackWhenDismiss={.tag=ARK_TAG_UNDEFINED, .value={}}, .enableOutsideInteractive={.tag=ARK_TAG_UNDEFINED, .value={}}, .width={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderWidth={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderStyle={.tag=ARK_TAG_UNDEFINED, .value={}}, .shadow={.tag=ARK_TAG_UNDEFINED, .value={}}, .onHeightDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .mode={.tag=ARK_TAG_UNDEFINED, .value={}}, .scrollSizeMode={.tag=ARK_TAG_UNDEFINED, .value={}}, .onDetentsDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWidthDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .onTypeDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .uiContext={.tag=ARK_TAG_UNDEFINED, .value={}}, .keyboardAvoidMode={.tag=ARK_TAG_UNDEFINED, .value={}}, .enableHoverMode={.tag=ARK_TAG_UNDEFINED, .value={}}, .hoverModeArea={.tag=ARK_TAG_UNDEFINED, .value={}}, .offset={.tag=ARK_TAG_UNDEFINED, .value={}}}})` ) checkResult("type", () => peer.typeAttribute(1), "type(Ark_ButtonType(1))") checkResult("labelStyle", () => peer.labelStyleAttribute({ maxLines: 3 }), diff --git a/tests/arkts-subset/ets/common.d.ts b/tests/arkts-subset/ets/common.d.ts index 99e9d725..4176b0c9 100644 --- a/tests/arkts-subset/ets/common.d.ts +++ b/tests/arkts-subset/ets/common.d.ts @@ -173,6 +173,7 @@ declare interface SheetOptions extends BindOptions { onTypeDidChange?: Callback; uiContext?: UIContext; keyboardAvoidMode?: SheetKeyboardAvoidMode; + offset?: Position; } declare enum BlurStyle { diff --git a/tests/subset/ets/common.d.ts b/tests/subset/ets/common.d.ts index 4730a2eb..24da282f 100644 --- a/tests/subset/ets/common.d.ts +++ b/tests/subset/ets/common.d.ts @@ -196,6 +196,7 @@ declare interface SheetOptions extends BindOptions { keyboardAvoidMode?: SheetKeyboardAvoidMode; enableHoverMode?: boolean; hoverModeArea?: HoverModeAreaType; + offset?: Position; } declare enum BlurStyle { -- Gitee From 035bc73c57eefcd13058ddfd4a47e2bfff73dc83 Mon Sep 17 00:00:00 2001 From: Peter Z Date: Fri, 15 Nov 2024 13:37:35 +0000 Subject: [PATCH 07/53] !972 Fixed `bindSheet` test Changed `bindSheet()` -> `background()` in `checkButton` testcase --- peer_lib/sig/arkoala/arkui/src/main.ts | 11 ++--------- tests/subset/ets/common.d.ts | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/peer_lib/sig/arkoala/arkui/src/main.ts b/peer_lib/sig/arkoala/arkui/src/main.ts index 19b22736..9cad1f9d 100644 --- a/peer_lib/sig/arkoala/arkui/src/main.ts +++ b/peer_lib/sig/arkoala/arkui/src/main.ts @@ -305,15 +305,8 @@ function checkButton() { "width({.type=1, .value=42, .unit=3, .resource=0})") checkResult("height", () => peer.heightAttribute({ id: 43, bundleName: "MyApp", moduleName: "MyApp" }), "height({.type=2, .value=0, .unit=1, .resource=43})") - - checkResult("bindSheet", () => - peer.bindSheetAttribute(false, () => { }, { - title: { - title: { id: 43, type: 2000, bundleName: "MyApp", moduleName: "MyApp", params: ["param1", "param2"] } - } - }), - `bindSheet({.selector=0, .value0=false}, {.resource={.resourceId=201, .hold=0, .release=0}, .call=0}, {.tag=ARK_TAG_OBJECT, .value={.backgroundColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .onAppear={.tag=ARK_TAG_UNDEFINED, .value={}}, .onDisappear={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillAppear={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillDisappear={.tag=ARK_TAG_UNDEFINED, .value={}}, .height={.tag=ARK_TAG_UNDEFINED, .value={}}, .dragBar={.tag=ARK_TAG_UNDEFINED, .value={}}, .maskColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .detents={.tag=ARK_TAG_UNDEFINED, .value={}}, .blurStyle={.tag=ARK_TAG_UNDEFINED, .value={}}, .showClose={.tag=ARK_TAG_UNDEFINED, .value={}}, .preferType={.tag=ARK_TAG_UNDEFINED, .value={}}, .title={.tag=ARK_TAG_OBJECT, .value={.selector=0, .value0={.title={.selector=1, .value1={.bundleName={.chars="MyApp", .length=5}, .moduleName={.chars="MyApp", .length=5}, .id={.tag=102, .i32=43}, .params={.tag=ARK_TAG_OBJECT, .value={.array=allocArray({{{.chars="param1", .length=6}, {.chars="param2", .length=6}}}), .length=2}}, .type={.tag=ARK_TAG_OBJECT, .value={.tag=102, .i32=2000}}}}, .subtitle={.tag=ARK_TAG_UNDEFINED, .value={}}}}}, .shouldDismiss={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillDismiss={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWillSpringBackWhenDismiss={.tag=ARK_TAG_UNDEFINED, .value={}}, .enableOutsideInteractive={.tag=ARK_TAG_UNDEFINED, .value={}}, .width={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderWidth={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderStyle={.tag=ARK_TAG_UNDEFINED, .value={}}, .shadow={.tag=ARK_TAG_UNDEFINED, .value={}}, .onHeightDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .mode={.tag=ARK_TAG_UNDEFINED, .value={}}, .scrollSizeMode={.tag=ARK_TAG_UNDEFINED, .value={}}, .onDetentsDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .onWidthDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .onTypeDidChange={.tag=ARK_TAG_UNDEFINED, .value={}}, .uiContext={.tag=ARK_TAG_UNDEFINED, .value={}}, .keyboardAvoidMode={.tag=ARK_TAG_UNDEFINED, .value={}}, .enableHoverMode={.tag=ARK_TAG_UNDEFINED, .value={}}, .hoverModeArea={.tag=ARK_TAG_UNDEFINED, .value={}}, .offset={.tag=ARK_TAG_UNDEFINED, .value={}}}})` - ) + checkResult("background", () => peer.backgroundAttribute(() => {}, {align: 4}), + "background({.resource={.resourceId=201, .hold=0, .release=0}, .call=0}, {.tag=ARK_TAG_OBJECT, .value={.align={.tag=ARK_TAG_OBJECT, .value=Ark_Alignment(4)}}})") checkResult("type", () => peer.typeAttribute(1), "type(Ark_ButtonType(1))") checkResult("labelStyle", () => peer.labelStyleAttribute({ maxLines: 3 }), "labelStyle({.overflow={.tag=ARK_TAG_UNDEFINED, .value={}}, .maxLines={.tag=ARK_TAG_OBJECT, .value={.tag=102, .i32=3}}, .minFontSize={.tag=ARK_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=ARK_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=ARK_TAG_UNDEFINED, .value={}}, .font={.tag=ARK_TAG_UNDEFINED, .value={}}})") diff --git a/tests/subset/ets/common.d.ts b/tests/subset/ets/common.d.ts index 24da282f..7f2488f6 100644 --- a/tests/subset/ets/common.d.ts +++ b/tests/subset/ets/common.d.ts @@ -394,6 +394,18 @@ declare enum GradientDirection { None, } +declare enum Alignment { + TopStart, + Top, + TopEnd, + Start, + Center, + End, + BottomStart, + Bottom, + BottomEnd, +} + declare interface LinearGradient { angle?: number | string; direction?: GradientDirection; @@ -421,6 +433,8 @@ declare class CommonMethod { padding(value: Padding | Dimension): T; + background(builder: CustomBuilder, options?: { align?: Alignment }): T; + bindSheet(isShow: Optional, builder: CustomBuilder, options?: SheetOptions): T; backgroundBlurStyle(value: BlurStyle, options?: BackgroundBlurStyleOptions): T; -- Gitee From 55a62e7e972ae0c5c31e652db22a43615a439f75 Mon Sep 17 00:00:00 2001 From: naumovdmitrii Date: Fri, 15 Nov 2024 13:53:22 +0000 Subject: [PATCH 08/53] !961 [unmemoize arkts] integration ci task --- .gitlab-ci.yml | 28 +++++--- package.json | 6 +- .../arkui/src/generated/Declarations.ts | 10 +-- .../arkui/src/generated/ts/arkts-stdlib.ts | 7 ++ src/peer-generation/arkoala.ts | 1 + .../ets/ui_extension_component.d.ts | 72 +++++++++---------- 6 files changed, 71 insertions(+), 53 deletions(-) create mode 100644 peer_lib/sig/arkoala-arkts/arkui/src/generated/ts/arkts-stdlib.ts diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 36f6e517..348b693d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,16 +52,26 @@ compile arkts subset: script: - npm run compile:all:arkts:idl +arkts subset tsc: + stage: test + tags: + - idlize-ci + - koala-ci + before_script: + - !reference [.setup, script] + script: + - npm run check:arkts:subset:tsc -# arkts subset tsc: -# stage: test -# tags: -# - idlize-ci -# - koala-ci -# before_script: -# - !reference [.setup, script] -# script: -# - npm run check:arkts:subset:tsc +arkts subset sig integration: + stage: test + tags: + - idlize-ci + - koala-ci + before_script: + - !reference [.setup, script] + - PANDA_SDK_VERSION=1.5.0-dev.7123 npm run panda:sdk:install + script: + - npm run sig:arkts:subset:all build arkoala-ts: stage: test diff --git a/package.json b/package.json index f6af3b92..ef4195e6 100644 --- a/package.json +++ b/package.json @@ -150,6 +150,10 @@ "arkoala:ts:native:arm32": "npm run generate:ts && npm run compile:native-hzvm-ohos-arm32 --prefix external/arkoala/framework", "arkoala:ts:native:arm64": "npm run generate:ts && npm run compile:native-hzvm-ohos-arm64 --prefix external/arkoala/framework", "arkoala:har": "npm run generate:ts && cd external && npm run arkoala:har", - "arkoala:har-arm32": "npm run generate:ts && cd external && npm run arkoala:har-arm32" + "arkoala:har-arm32": "npm run generate:ts && cd external && npm run arkoala:har-arm32", + "sig:arkts:subset:clean": "cd ./external/arkoala-arkts/arkui && rm -rf src/generated/ && rm -rf build/ && rm -rf unmemoized/", + "sig:arkts:subset:copy": "npm run make:arkts:idl && cp -r ./out/arkts-subset/generated/sig/arkoala-arkts/arkui/src/generated/ ./external/arkoala-arkts/arkui/src/", + "sig:arkts:subset:compile": "cd external/arkoala-arkts/arkui && npm run compile:arkts:unmemoized", + "sig:arkts:subset:all": "npm run sig:arkts:subset:clean && npm run sig:arkts:subset:copy && npm run sig:arkts:subset:compile" } } diff --git a/peer_lib/sig/arkoala-arkts/arkui/src/generated/Declarations.ts b/peer_lib/sig/arkoala-arkts/arkui/src/generated/Declarations.ts index 032ee7cb..f11277b2 100644 --- a/peer_lib/sig/arkoala-arkts/arkui/src/generated/Declarations.ts +++ b/peer_lib/sig/arkoala-arkts/arkui/src/generated/Declarations.ts @@ -14,11 +14,7 @@ */ import { NativeModule } from "#components" - -export interface ArkoalaHost { - waitForVSync(): Promise | undefined - nativeModule: NativeModule | undefined -} +import { int32 } from "@koalaui/common" export interface ArkoalaControl { sendMessage(topic: string, event: Object): void @@ -26,7 +22,7 @@ export interface ArkoalaControl { } export interface UIElement { - id: int + id: int32 kind: string children: Array | undefined width: string | undefined @@ -39,6 +35,6 @@ export interface UIElement { } export interface WaitFramesEvent { - skipFrames: int + skipFrames: int32 callback: () => void } diff --git a/peer_lib/sig/arkoala-arkts/arkui/src/generated/ts/arkts-stdlib.ts b/peer_lib/sig/arkoala-arkts/arkui/src/generated/ts/arkts-stdlib.ts new file mode 100644 index 00000000..80c8718b --- /dev/null +++ b/peer_lib/sig/arkoala-arkts/arkui/src/generated/ts/arkts-stdlib.ts @@ -0,0 +1,7 @@ +declare type Function0 = () => R +declare type Function1 = (arg1: T1) => R +declare type Function2 = (arg1: T1, arg2: T2) => R +declare type Function3 = (arg1: T1, arg2: T2, arg3: T3) => R +declare type Function4 = (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => R +declare type Function5 = (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => R +declare type Function6 = (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg: T6) => R diff --git a/src/peer-generation/arkoala.ts b/src/peer-generation/arkoala.ts index 8f449ad7..89b26172 100644 --- a/src/peer-generation/arkoala.ts +++ b/src/peer-generation/arkoala.ts @@ -141,6 +141,7 @@ function copyArkoalaFiles(config: { 'sig/arkoala-arkts/arkui/src/generated/NativePeerNode.ts', 'sig/arkoala-arkts/arkui/src/generated/arkts/index.ts', 'sig/arkoala-arkts/arkui/src/generated/ts/index.ts', + 'sig/arkoala-arkts/arkui/src/generated/ts/arkts-stdlib.ts', 'sig/arkoala-arkts/arkui/src/generated/ts/NativeModule.ts', 'sig/arkoala-arkts/arkui/src/generated/peers/SerializerBase.ts', 'sig/arkoala-arkts/arkui/src/generated/shared/ArkResource.ts', diff --git a/tests/arkts-subset/ets/ui_extension_component.d.ts b/tests/arkts-subset/ets/ui_extension_component.d.ts index 55ea5d2b..dd23e3e4 100644 --- a/tests/arkts-subset/ets/ui_extension_component.d.ts +++ b/tests/arkts-subset/ets/ui_extension_component.d.ts @@ -24,10 +24,10 @@ declare interface UIExtensionOptions { dpiFollowStrategy?: DpiFollowStrategy; } -declare interface TerminationInfo { - code: number; - want?: import('../api/@ohos.app.ability.Want').default; -} +// declare interface TerminationInfo { +// code: number; +// want?: import('../api/@ohos.app.ability.Want').default; +// } declare interface UIExtensionProxy { send(data: Record): void; @@ -38,35 +38,35 @@ declare interface UIExtensionProxy { off(type: 'syncReceiverRegister', callback?: (proxy: UIExtensionProxy) => void): void; } -interface UIExtensionComponentInterface { - ( - want: import('../api/@ohos.app.ability.Want').default, - options?: UIExtensionOptions - ): UIExtensionComponentAttribute; -} - -declare class UIExtensionComponentAttribute extends CommonMethod { - onRemoteReady( - callback: import('../api/@ohos.base').Callback - ): UIExtensionComponentAttribute; - onReceive( - callback: import('../api/@ohos.base').Callback<{ [key: string]: Object }> - ): UIExtensionComponentAttribute; - onResult( - callback: import('../api/@ohos.base').Callback<{ - code: number; - want?: import('../api/@ohos.app.ability.Want').default; - }> - ): UIExtensionComponentAttribute; - onRelease( - callback: import('../api/@ohos.base').Callback - ): UIExtensionComponentAttribute; - onError( - callback: import('../api/@ohos.base').ErrorCallback - ): UIExtensionComponentAttribute; - onTerminated(callback: Callback): UIExtensionComponentAttribute; -} - -declare const UIExtensionComponent: UIExtensionComponentInterface; - -declare const UIExtensionComponentInstance: UIExtensionComponentAttribute; +// interface UIExtensionComponentInterface { +// ( +// want: import('../api/@ohos.app.ability.Want').default, +// options?: UIExtensionOptions +// ): UIExtensionComponentAttribute; +// } +// +// declare class UIExtensionComponentAttribute extends CommonMethod { +// onRemoteReady( +// callback: import('../api/@ohos.base').Callback +// ): UIExtensionComponentAttribute; +// onReceive( +// callback: import('../api/@ohos.base').Callback<{ [key: string]: Object }> +// ): UIExtensionComponentAttribute; +// onResult( +// callback: import('../api/@ohos.base').Callback<{ +// code: number; +// want?: import('../api/@ohos.app.ability.Want').default; +// }> +// ): UIExtensionComponentAttribute; +// onRelease( +// callback: import('../api/@ohos.base').Callback +// ): UIExtensionComponentAttribute; +// onError( +// callback: import('../api/@ohos.base').ErrorCallback +// ): UIExtensionComponentAttribute; +// onTerminated(callback: Callback): UIExtensionComponentAttribute; +// } +// +// declare const UIExtensionComponent: UIExtensionComponentInterface; +// +// declare const UIExtensionComponentInstance: UIExtensionComponentAttribute; -- Gitee From e86e0b21f142c8fb1aba5e671f17ad6988b03da6 Mon Sep 17 00:00:00 2001 From: tsvetkovaelena Date: Fri, 15 Nov 2024 14:24:24 +0000 Subject: [PATCH 09/53] !958 Edited enum members generation --- external | 2 +- src/IDLVisitor.ts | 10 ++-- src/from-idl/DtsPrinter.ts | 5 +- src/idl.ts | 1 + .../LanguageWriters/LanguageWriter.ts | 49 ++++++++++++++++--- .../convertors/ETSConvertors.ts | 13 +++-- .../writers/CppLanguageWriter.ts | 16 +----- .../writers/ETSLanguageWriter.ts | 29 ++++++++--- .../writers/TsLanguageWriter.ts | 5 ++ src/peer-generation/Tracker.ts | 1 + src/peer-generation/arkoala.ts | 10 +++- src/peer-generation/idl/IdlNameConvertor.ts | 46 +++++++++++++++++ .../idl/IdlPeerGeneratorVisitor.ts | 9 ++-- .../printers/CallbacksPrinter.ts | 11 +++-- .../printers/DeclarationPrinter.ts | 13 +++++ .../printers/InterfacePrinter.ts | 37 +++++++++----- .../printers/TypeCheckPrinter.ts | 19 ++++--- src/util.ts | 2 + 18 files changed, 207 insertions(+), 71 deletions(-) diff --git a/external b/external index 8e83109a..c61d429e 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit 8e83109a2eccf8456828cad82689a562349dfd7b +Subproject commit c61d429e81c81f40a6a4890ed799a8abefc0ba62 diff --git a/src/IDLVisitor.ts b/src/IDLVisitor.ts index 554d31c6..f01468a5 100644 --- a/src/IDLVisitor.ts +++ b/src/IDLVisitor.ts @@ -602,12 +602,16 @@ export class IDLVisitor implements GenericVisitor { }) result.elements = node.members .filter(ts.isEnumMember) - .map((it, index) => this.serializeEnumMember(it, result, names[index])) + .map((it, index) => this.serializeEnumMember(it, result, names[index], identName(it.name)!)) return result } - serializeEnumMember(node: ts.EnumMember, parent: idl.IDLEnum, name: string): idl.IDLEnumMember { + serializeEnumMember(node: ts.EnumMember, parent: idl.IDLEnum, name: string, originalName: string): idl.IDLEnumMember { const initializer = this.typeChecker.getConstantValue(node) + let extendedAttributes = this.computeDeprecatedExtendAttributes(node) + if (originalName != name) { + extendedAttributes.push({ name: idl.IDLExtendedAttributes.OriginalEnumMemberName, value: originalName }) + } return idl.createEnumMember( name, parent, @@ -615,7 +619,7 @@ export class IDLVisitor implements GenericVisitor { initializer, { fileName: node.getSourceFile().fileName, documentation: getDocumentation(this.sourceFile, node, this.options.docs), - extendedAttributes: this.computeDeprecatedExtendAttributes(node), + extendedAttributes: extendedAttributes }) } diff --git a/src/from-idl/DtsPrinter.ts b/src/from-idl/DtsPrinter.ts index dd384f48..933325e1 100644 --- a/src/from-idl/DtsPrinter.ts +++ b/src/from-idl/DtsPrinter.ts @@ -41,17 +41,18 @@ import { IDLCallback, IDLConstructor, IDLEntity, IDLEntry, IDLEnum, IDLInterface IDLConstant, createReferenceType, transformMethodsAsync2ReturnPromise, - forceAsNamedNode, isNamedNode, IDLNode, IDLThisType,} from "../idl" import * as webidl2 from "webidl2" import { resolveSyntheticType, toIDLNode } from "./deserialize" import { Language } from "../Language" +import { IndentedPrinter } from "../IndentedPrinter" export class CustomPrintVisitor { - constructor(private resolver: (type: IDLReferenceType) => IDLEntry | undefined, private language: Language) {} output: string[] = [] + constructor(private resolver: (type: IDLReferenceType) => IDLEntry | undefined, private language: Language) {} + currentInterface?: IDLInterface visit(node: IDLEntry) { diff --git a/src/idl.ts b/src/idl.ts index 53b47a37..696c53f9 100644 --- a/src/idl.ts +++ b/src/idl.ts @@ -74,6 +74,7 @@ export enum IDLExtendedAttributes { Namespace = "Namespace", NativeModule = "NativeModule", Optional = "Optional", + OriginalEnumMemberName = "OriginalEnumMemberName", Protected = "Protected", Synthetic = "Synthetic", TSType = "TSType", diff --git a/src/peer-generation/LanguageWriters/LanguageWriter.ts b/src/peer-generation/LanguageWriters/LanguageWriter.ts index bfa25551..f57a17f6 100644 --- a/src/peer-generation/LanguageWriters/LanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/LanguageWriter.ts @@ -226,21 +226,38 @@ export class CheckOptionalStatement implements LanguageStatement { // maybe rename or move of fix export class TsEnumEntityStatement implements LanguageStatement { constructor(private readonly enumEntity: idl.IDLEnum, private readonly isExport: boolean) {} - - write(writer: LanguageWriter) { - writer.print(this.enumEntity.comment) + write(writer: LanguageWriter): void { + // writer.print(this.enumEntity.comment) + const namespace = idl.getExtAttribute(this.enumEntity, idl.IDLExtendedAttributes.Namespace) + if (namespace) writer.pushNamespace(namespace) + writer.print(`${this.isExport ? "export " : ""}enum ${this.enumEntity.name} {`) writer.pushIndent() this.enumEntity.elements.forEach((member, index) => { - writer.print(member.comment) - const commaOp = index < this.enumEntity.elements.length - 1 ? ',' : '' - const initValue = member.initializer ? ` = ${member.initializer}` : `` - writer.print(`${member.name}${initValue}${commaOp}`) + // writer.print(member.comment) + const initValue = member.initializer + ? ` = ${this.maybeQuoted(member.initializer)}` : `` + writer.print(`${member.name}${initValue},`) + + let originalName = idl.getExtAttribute(member, idl.IDLExtendedAttributes.OriginalEnumMemberName) + if (originalName) { + const initValue = ` = ${member.name}` + writer.print(`${originalName}${initValue},`) + } }) writer.popIndent() writer.print(`}`) + + if (namespace) writer.popNamespace() } -} + + private maybeQuoted(value: string|number): string { + if (typeof value == "string") + return `"${value}"` + else + return `${value}` + } + } export class ReturnStatement implements LanguageStatement { constructor(public expression?: LanguageExpression) { } @@ -714,6 +731,22 @@ export abstract class LanguageWriter { if (type === undefined) return "" return this.stringifyType(type) } + /** + * Writes `namespace {` and adds extra indent + * @param namespace Namespace to begin + */ + pushNamespace(namespace: string, ident: boolean = true) { + this.print(`namespace ${namespace} {`) + if (ident) this.pushIndent() + } + + /** + * Writes closing brace of namespace block and removes one level of indent + */ + popNamespace(ident: boolean = true) { + if (ident) this.popIndent() + this.print(`}`) + } } export function mangleMethodName(method: Method, id?: number): string { diff --git a/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts b/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts index ea37d925..10f7402f 100644 --- a/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts +++ b/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts @@ -16,18 +16,25 @@ import * as idl from "../../../idl"; import { TsIDLNodeToStringConverter } from "./TSConvertors"; import {createReferenceType, IDLReferenceType, IDLType} from "../../../idl"; -import { DeclarationNameConvertor } from "../../idl/IdlNameConvertor"; +import { createDeclarationNameConvertor, DeclarationNameConvertor } from "../../idl/IdlNameConvertor"; import { convertDeclaration } from "../nameConvertor"; +import { Language } from "../../../Language"; export class EtsIDLNodeToStringConvertor extends TsIDLNodeToStringConverter { convertTypeReference(type: IDLReferenceType): string { - //TODO: Needs to be implemented properly + // Only to deal with namespaces. TODO: remove later + const decl = this.resolver.resolveTypeReference(type) + if (decl && idl.isEnum(decl)) { + return convertDeclaration(createDeclarationNameConvertor(Language.ARKTS), decl) + } + + // TODO: Needs to be implemented properly const types = type.name.split(".") if (types.length > 1) { // Takes only name without the namespace prefix const decl = this.resolver.resolveTypeReference(createReferenceType(types.slice(-1).join())) if (decl !== undefined) { - return convertDeclaration(DeclarationNameConvertor.I, decl) + return convertDeclaration(createDeclarationNameConvertor(Language.ARKTS), decl) } } return super.convertTypeReference(type); diff --git a/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts index af5b03db..12a07f11 100644 --- a/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts @@ -135,6 +135,7 @@ class CppMapForEachStatement implements LanguageStatement { } } +// todo: class CppEnumEntityStatement implements LanguageStatement { constructor(private _enum: IDLEnum) {} write(writer: LanguageWriter): void { @@ -236,22 +237,7 @@ export class CppLanguageWriter extends CLikeLanguageWriter { this.print(`#include <${path}>`) } - /** - * Writes `namespace {` and adds extra indent - * @param namespace Namespace to begin - */ - pushNamespace(namespace: string, ident: boolean = true) { - this.print(`namespace ${namespace} {`) - if (ident) this.pushIndent() - } - /** - * Writes closing brace of namespace block and removes one level of indent - */ - popNamespace(ident: boolean = true) { - if (ident) this.popIndent() - this.print(`}`) - } override makeTag(tag: string): string { return PrimitiveType.Prefix.toLocaleUpperCase() + "TAG_" + tag diff --git a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts index da9d74a7..0681f950 100644 --- a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts @@ -26,13 +26,16 @@ import { ObjectArgs } from "../LanguageWriter" import { TSLambdaExpression, TSLanguageWriter } from "./TsLanguageWriter" -import { IDLEnum, IDLI32Type, IDLThisType, IDLType, IDLVoidType, toIDLType } from '../../../idl' +import { getExtAttribute, IDLEnum, IDLI32Type, IDLThisType, IDLType, IDLVoidType, toIDLType } from '../../../idl' import {AggregateConvertor, ArgConvertor, ArrayConvertor, BaseArgConvertor, CustomTypeConvertor, EnumConvertor, InterfaceConvertor, makeInterfaceTypeCheckerCall, RuntimeType} from "../../ArgConvertors" import { Language } from "../../../Language" import { ReferenceResolver } from "../../ReferenceResolver" import { EtsIDLNodeToStringConvertor } from "../convertors/ETSConvertors" import {PeerLibrary} from "../../PeerLibrary"; import {makeEnumTypeCheckerCall} from "../../printers/TypeCheckPrinter"; +import * as idl from "../../../idl" +import { convertDeclaration } from "../nameConvertor" +import { createDeclarationNameConvertor } from "../../idl/IdlNameConvertor" //////////////////////////////////////////////////////////////// // STATEMENTS // @@ -66,11 +69,12 @@ export class ArkTSEnumEntityStatement implements LanguageStatement { constructor(private readonly enumEntity: IDLEnum, private readonly isExport: boolean) {} write(writer: LanguageWriter) { - writer.print(this.enumEntity.comment) - writer.writeClass(this.enumEntity.name, (writer) => { + // writer.print(this.enumEntity.comment) + const className = convertDeclaration(createDeclarationNameConvertor(Language.ARKTS), this.enumEntity) + writer.writeClass(className, (writer) => { let isTypeString = true this.enumEntity.elements.forEach((member, index) => { - writer.print(member.comment) + // writer.print(member.comment) const initText = member.initializer ?? index isTypeString &&= (typeof initText !== "number") const ctorArgs = [ @@ -81,7 +85,15 @@ export class ArkTSEnumEntityStatement implements LanguageStatement { toIDLType(this.enumEntity.name), [FieldModifier.STATIC, FieldModifier.READONLY], false, - writer.makeString(`new ${this.enumEntity.name}(${ctorArgs.join(",")})`)) + writer.makeString(`new ${className}(${ctorArgs.join(",")})`)) + let originalName = getExtAttribute(member, idl.IDLExtendedAttributes.OriginalEnumMemberName) + if (originalName) { + writer.writeFieldDeclaration(originalName, + toIDLType(this.enumEntity.name), + [FieldModifier.STATIC, FieldModifier.READONLY], + false, + writer.makeString(`${className}.${member.name}`)) + } }) const typeName = isTypeString ? "string" : "KInt" let argTypes = [toIDLType(typeName)] @@ -90,7 +102,7 @@ export class ArkTSEnumEntityStatement implements LanguageStatement { argTypes.push(toIDLType("KInt")) argNames.push("ordinal") } - writer.writeConstructorImplementation(this.enumEntity.name, + writer.writeConstructorImplementation(className, new NamedMethodSignature(IDLVoidType, argTypes, argNames), (writer) => { writer.writeStatement(writer.makeAssign("this.value", undefined, writer.makeString("value"), false)) if (isTypeString) { @@ -103,8 +115,8 @@ export class ArkTSEnumEntityStatement implements LanguageStatement { } writer.writeMethodImplementation(new Method("of", new MethodSignature(toIDLType(this.enumEntity.name), [argTypes[0]]), [MethodModifier.PUBLIC, MethodModifier.STATIC]), (writer)=> { - this.enumEntity.elements.forEach(member => { - const memberName = `${this.enumEntity.name}.${member.name}` + this.enumEntity.elements.forEach((member) => { + const memberName = `${className}.${member.name}` writer.writeStatement( writer.makeCondition( writer.makeEquals([writer.makeString('arg0'), writer.makeString(`${memberName}.value`)]), @@ -123,6 +135,7 @@ export class ArkTSEnumEntityStatement implements LanguageStatement { export function generateTypeCheckerName(typeName: string): string { typeName = typeName.replaceAll('[]', 'BracketsArray') + .replaceAll('.', '') // Todo: hack for namespaces return `is${typeName.replaceAll('[]', 'Brackets')}` } diff --git a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts index 1159ab06..37c85a8f 100644 --- a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts @@ -185,6 +185,11 @@ export class TSLanguageWriter extends LanguageWriter { this.typeConvertor = new TsIDLNodeToStringConverter(this.resolver) } + pushNamespace(namespace: string, ident: boolean = true): void { + this.print(`export namespace ${namespace} {`) + if (ident) this.pushIndent() + } + fork(): LanguageWriter { return new TSLanguageWriter(new IndentedPrinter(), this.resolver, this.language) } diff --git a/src/peer-generation/Tracker.ts b/src/peer-generation/Tracker.ts index 620b9fdf..2ae6cca8 100644 --- a/src/peer-generation/Tracker.ts +++ b/src/peer-generation/Tracker.ts @@ -15,6 +15,7 @@ import * as fs from 'fs' import * as path from 'path' +import * as idl from "../idl" import { IndentedPrinter } from "../IndentedPrinter"; import { MaterializedClass } from "./Materialized"; diff --git a/src/peer-generation/arkoala.ts b/src/peer-generation/arkoala.ts index 89b26172..f63c5bea 100644 --- a/src/peer-generation/arkoala.ts +++ b/src/peer-generation/arkoala.ts @@ -59,11 +59,11 @@ import { printBridgeCcCustom, printBridgeCcGenerated } from "./printers/BridgeCc import { Language } from "../Language" import { PeerLibrary } from "./PeerLibrary" import { PeerGeneratorConfig } from "./PeerGeneratorConfig" -import { printDeclarations } from "./printers/DeclarationPrinter" +import { printDeclarations, printEnumsImpl } from "./printers/DeclarationPrinter" import { printConflictedDeclarations } from "./printers/ConflictedDeclarationsPrinter"; import { printNativeModuleRecorder } from "./printers/NativeModuleRecorderPrinter" import { IndentedPrinter } from "../IndentedPrinter" -import { LanguageWriter } from "./LanguageWriters" +import { createLanguageWriter, LanguageWriter } from "./LanguageWriters" import { printManagedCaller } from "./printers/CallbacksPrinter" export function generateLibaceFromIdl(config: { @@ -238,6 +238,12 @@ export function generateArkoalaFromIdl(config: { arkuiComponentsFiles.push(outComponentFile) } + if (peerLibrary.language == Language.TS || peerLibrary.language == Language.ARKTS) { + let enumImpls = createLanguageWriter(peerLibrary.language, peerLibrary) + printEnumsImpl(peerLibrary, enumImpls) + enumImpls.printTo(arkoala.tsArkoalaLib(new TargetFile('EnumsImpl')),) + } + if (peerLibrary.language == Language.TS) { const declarations = printDeclarations(peerLibrary) const index = new IndentedPrinter() diff --git a/src/peer-generation/idl/IdlNameConvertor.ts b/src/peer-generation/idl/IdlNameConvertor.ts index d16a41e2..f4cdabed 100644 --- a/src/peer-generation/idl/IdlNameConvertor.ts +++ b/src/peer-generation/idl/IdlNameConvertor.ts @@ -14,6 +14,7 @@ */ import * as idl from '../../idl' +import { Language } from '../../Language' import { DeclarationConvertor } from '../LanguageWriters/nameConvertor' export class DeclarationNameConvertor implements DeclarationConvertor { @@ -32,3 +33,48 @@ export class DeclarationNameConvertor implements DeclarationConvertor { static readonly I = new DeclarationNameConvertor() } + +export class TSFeatureNameConvertor extends DeclarationNameConvertor { + override convertEnum(decl: idl.IDLEnum): string { + return `${idl.getExtAttribute(decl, idl.IDLExtendedAttributes.Namespace) ?? decl.name}` + } + static readonly I = new TSFeatureNameConvertor() +} + +export class ETSDeclarationNameConvertor extends DeclarationNameConvertor { + override convertEnum(decl: idl.IDLEnum): string { + const namespace = idl.getExtAttribute(decl, idl.IDLExtendedAttributes.Namespace) + return `${namespace ? `${namespace}_` : ``}${decl.name}` + } + static readonly I = new ETSDeclarationNameConvertor() +} + +export class ETSFeatureNameConvertor extends DeclarationNameConvertor { + override convertEnum(decl: idl.IDLEnum): string { + const namespace = idl.getExtAttribute(decl, idl.IDLExtendedAttributes.Namespace) + return `${namespace ? `${namespace}_` : ``}${decl.name}` + } + static readonly I = new ETSFeatureNameConvertor() +} + +export function createDeclarationNameConvertor(language: Language): DeclarationNameConvertor { + switch (language) { + case Language.ARKTS: return ETSDeclarationNameConvertor.I + case Language.JAVA: + case Language.CPP: + case Language.CJ: + case Language.TS: return DeclarationNameConvertor.I + default: throw new Error(`Language ${language.toString()} is not supported`) + } +} + +export function createFeatureNameConvertor(language: Language): DeclarationNameConvertor { + switch (language) { + case Language.ARKTS: return ETSFeatureNameConvertor.I + case Language.JAVA: + case Language.CPP: + case Language.CJ: + case Language.TS: return TSFeatureNameConvertor.I + default: throw new Error(`Language ${language.toString()} is not supported`) + } +} diff --git a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts index 3fdbc376..bf590532 100644 --- a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts +++ b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts @@ -44,7 +44,7 @@ import { import { BuilderClass, initCustomBuilderClasses, isCustomBuilderClass } from "../BuilderClass"; import { isRoot } from "../inheritance"; import { ImportFeature } from "../ImportsCollector"; -import { DeclarationNameConvertor } from "./IdlNameConvertor"; +import { createFeatureNameConvertor, DeclarationNameConvertor } from "./IdlNameConvertor"; import { PrimitiveType } from "../ArkPrimitiveType" import { collapseIdlEventsOverloads } from "../printers/EventsPrinter" import { convert } from "./common" @@ -1159,18 +1159,19 @@ export class IdlPeerProcessor { } export function convertDeclToFeature(library: PeerLibrary, node: idl.IDLNode): ImportFeature { + const featureNameConvertor = createFeatureNameConvertor(library.language) if (!idl.isEntry(node)) throw "Expected to have an entry" if (isSyntheticDeclaration(node)) return { - feature: convertDeclaration(DeclarationNameConvertor.I, node), + feature: convertDeclaration(featureNameConvertor, node), module: `./${syntheticDeclarationFilename(node)}` } if (isConflictingDeclaration(node)) { // const parent = node.parent let feature = /*ts.isModuleBlock(parent) ? parent.parent.name.text - : */convertDeclaration(DeclarationNameConvertor.I, node) + : */convertDeclaration(featureNameConvertor, node) return { feature: feature, module: './ConflictedDeclarations' @@ -1190,7 +1191,7 @@ export function convertDeclToFeature(library: PeerLibrary, node: idl.IDLNode): I const basename = path.basename(fileName) const basenameNoExt = basename.replaceAll(path.extname(basename), '') return { - feature: convertDeclaration(DeclarationNameConvertor.I, node), + feature: convertDeclaration(featureNameConvertor, node), module: `./${basenameNoExt}`, } } diff --git a/src/peer-generation/printers/CallbacksPrinter.ts b/src/peer-generation/printers/CallbacksPrinter.ts index e5ae9824..690c582f 100644 --- a/src/peer-generation/printers/CallbacksPrinter.ts +++ b/src/peer-generation/printers/CallbacksPrinter.ts @@ -106,10 +106,13 @@ export function printCallbacksKindsImports(language: Language, writer: LanguageW } export function printCallbacksKinds(library: PeerLibrary, writer: LanguageWriter): void { - const kindsEnum = idl.createEnum(CallbackKind, [], {}) - kindsEnum.elements = collectUniqueCallbacks(library).map((it, index) => - idl.createEnumMember(generateCallbackKindName(it), kindsEnum, idl.IDLNumberType, index)) - writer.writeStatement(writer.makeEnumEntity(kindsEnum, true)) + let callbacksKindsEnum = idl.createEnum( + CallbackKind, [], {} + ) + callbacksKindsEnum.elements = collectUniqueCallbacks(library).map((it, index) => + idl.createEnumMember(generateCallbackKindName(it), callbacksKindsEnum, idl.IDLNumberType, index) + ) + writer.writeStatement(writer.makeEnumEntity(callbacksKindsEnum, true)) } class DeserializeCallbacksVisitor { diff --git a/src/peer-generation/printers/DeclarationPrinter.ts b/src/peer-generation/printers/DeclarationPrinter.ts index 7ef2b0de..7f4976e6 100644 --- a/src/peer-generation/printers/DeclarationPrinter.ts +++ b/src/peer-generation/printers/DeclarationPrinter.ts @@ -17,6 +17,7 @@ import * as idl from "../../idl" import { CustomPrintVisitor as DtsPrintVisitor} from "../../from-idl/DtsPrinter" import { isMaterialized } from "../idl/IdlPeerGeneratorVisitor" import { PeerLibrary } from "../PeerLibrary" +import { LanguageWriter } from "../LanguageWriters" export function printDeclarations(peerLibrary: PeerLibrary): Array { const result = [] @@ -36,3 +37,15 @@ export function printDeclarations(peerLibrary: PeerLibrary): Array { } return result } + +export function printEnumsImpl(peerLibrary: PeerLibrary, writer: LanguageWriter) { + const seenNames = new Set() + for (const decl of peerLibrary.declarations) { + if (idl.isEnum(decl)) { + // An ugly hack to avoid double definition of ContentType enum. + if (seenNames.has(decl.name) && decl.name == "ContentType") continue + seenNames.add(decl.name) + writer.writeStatement(writer.makeEnumEntity(decl, true)) + } + } +} diff --git a/src/peer-generation/printers/InterfacePrinter.ts b/src/peer-generation/printers/InterfacePrinter.ts index e245df6d..2a7b38ce 100644 --- a/src/peer-generation/printers/InterfacePrinter.ts +++ b/src/peer-generation/printers/InterfacePrinter.ts @@ -48,6 +48,7 @@ import { Language } from '../../Language' import { escapeKeyword, IDLKind } from "../../idl"; import { ETSLanguageWriter } from '../LanguageWriters/writers/ETSLanguageWriter' import { collectProperties } from './StructPrinter' +import { CustomPrintVisitor } from "../../from-idl/DtsPrinter" interface InterfacesVisitor { getInterfaces(): Map @@ -63,8 +64,10 @@ abstract class DefaultInterfacesVisitor implements InterfacesVisitor { } export class TSDeclConvertor implements DeclarationConvertor { + private printer: CustomPrintVisitor constructor(protected readonly writer: LanguageWriter, readonly peerLibrary: PeerLibrary) { + this.printer = new CustomPrintVisitor(type => peerLibrary.resolveTypeReference(type), writer.language) } convertCallback(node: idl.IDLCallback): void { } @@ -97,7 +100,9 @@ export class TSDeclConvertor implements DeclarationConvertor { convertInterface(node: idl.IDLInterface): void { if (!this.peerLibrary.isComponentDeclaration((node))) { - this.writer.print('export ' + this.replaceImportTypeNodes(idl.printInterface(node).join("\n"))) + this.printer.output = [] + this.printer.printInterface(node) + this.writer.print('export ' + this.replaceImportTypeNodes(this.printer.output.join("\n"))) return } let printer = new IndentedPrinter() @@ -142,32 +147,33 @@ class TSInterfacesVisitor extends DefaultInterfacesVisitor { writer.print(`Object.assign(globalThis, {`) writer.pushIndent() for (const e of peerFile.enums) { - writer.print(`${e.name}: ${e.name},`) + const usageTypeName = this.peerLibrary.mapType(idl.createReferenceType(e.name)) + writer.print(`${e.name}: ${usageTypeName},`) } writer.popIndent() writer.print(`})`) } } - protected toEnumEntity(enumDecl: idl.IDLEnum): idl.IDLEnum { - const namespace = idl.getExtAttribute(enumDecl, idl.IDLExtendedAttributes.Namespace) ?? "" - return idl.createEnum(`${namespace}${enumDecl.name}`, enumDecl.elements, { - documentation: enumDecl.documentation - }) - } - printInterfaces() { for (const file of this.peerLibrary.files.values()) { const writer = createLanguageWriter(this.peerLibrary.language, this.peerLibrary) this.printImports(writer, file) const typeConvertor = this.createDeclarationConvertor(writer) file.declarations.forEach(it => convertDeclaration(typeConvertor, it)) - file.enums.forEach(it => writer.writeStatement(writer.makeEnumEntity(this.toEnumEntity(it), true))) + file.enums.forEach(it => { + it.name = this.enumName(it) + writer.writeStatement(writer.makeEnumEntity(it, true)) + }) this.printAssignEnumsToGlobalScope(writer, file) this.interfaces.set(new TargetFile(this.generateFileBasename(file.originalFilename)), writer) } } + protected enumName(enumEntry: idl.IDLEnum): string { + return enumEntry.name + } + protected createDeclarationConvertor(writer: LanguageWriter): DeclarationConvertor { return new TSDeclConvertor(writer, this.peerLibrary) } @@ -603,6 +609,11 @@ class ArkTSInterfacesVisitor extends TSInterfacesVisitor { // Not supported } + // override enumName(enumEntry: idl.IDLEnum): string { + // const namespace = idl.getExtAttribute(enumEntry, IDLExtendedAttributes.Namespace) ?? "" + // return `${namespace}${enumEntry.name}` + // } + protected createDeclarationConvertor(writer: LanguageWriter): DeclarationConvertor { return new ArkTSDeclConvertor(writer, this.peerLibrary) } @@ -623,7 +634,7 @@ class CJInterfacesVisitor extends DefaultInterfacesVisitor { const declarationConverter = new CJDeclarationConvertor(this.peerLibrary, (declaration: CJDeclaration) => { this.interfaces.set(declaration.targetFile, declaration.writer) }) - + for (const file of this.peerLibrary.files.values()) { file.declarations.forEach(it => convertDeclaration(declarationConverter, it)) } @@ -855,9 +866,9 @@ class CJDeclarationConvertor implements DeclarationConvertor { writer.writeProperty(it.name, it.type, true) }) writer.writeConstructorImplementation(alias, - new NamedMethodSignature(idl.IDLVoidType, + new NamedMethodSignature(idl.IDLVoidType, constructorMembers.map(it => - idl.maybeOptional(it.type, it.isOptional) + idl.maybeOptional(it.type, it.isOptional) ), constructorMembers.map(it => writer.escapeKeyword(it.name) diff --git a/src/peer-generation/printers/TypeCheckPrinter.ts b/src/peer-generation/printers/TypeCheckPrinter.ts index b0700266..86146e57 100644 --- a/src/peer-generation/printers/TypeCheckPrinter.ts +++ b/src/peer-generation/printers/TypeCheckPrinter.ts @@ -18,7 +18,7 @@ import { isMaterialized, } from "../idl/IdlPeerGeneratorVisitor"; import { getSyntheticDeclarationList } from "../idl/IdlSyntheticDeclarations"; -import { DeclarationNameConvertor } from "../idl/IdlNameConvertor"; +import { createDeclarationNameConvertor, DeclarationNameConvertor } from "../idl/IdlNameConvertor"; import { Language } from "../../Language"; import {IDLBooleanType, toIDLType} from "../../idl"; import { getReferenceResolver } from '../ReferenceResolver'; @@ -108,15 +108,16 @@ abstract class TypeCheckerPrinter { imports.addFeature(feature.feature, feature.module) imports.print(this.writer, 'arkts/type_check') } - protected abstract writeInterfaceChecker(name: string, descriptor: StructDescriptor): void + protected abstract writeInterfaceChecker(name: string, descriptor: StructDescriptor, type?: idl.IDLType): void protected abstract writeArrayChecker(typeName: string, type: idl.IDLType): void print() { const importFeatures: ImportFeature[] = [] - const interfaces: { name: string, descriptor: StructDescriptor }[] = [] + const interfaces: { name: string, type?: idl.IDLType, descriptor: StructDescriptor }[] = [] const seenNames = new Set() const declDependenciesCollector = createDeclDependenciesCollector(this.library, createTypeDependenciesCollector(this.library)) + const declNameConvertor = createDeclarationNameConvertor(this.library.language) for (const file of this.library.files) { const declarations: idl.IDLEntry[] = [...Array.from(file.declarations), ...file.enums] @@ -139,7 +140,8 @@ abstract class TypeCheckerPrinter { importFeatures.push(convertDeclToFeature(this.library, decl)) } interfaces.push({ - name: convertDeclaration(DeclarationNameConvertor.I, decl), + name: convertDeclaration(declNameConvertor, decl), + type: idl.createReferenceType(decl.name), descriptor: makeStructDescriptor(this.library, decl) }) } @@ -152,7 +154,7 @@ abstract class TypeCheckerPrinter { .forEach(it => { importFeatures.push(convertDeclToFeature(this.library, it)) interfaces.push({ - name: convertDeclaration(DeclarationNameConvertor.I, it), + name: convertDeclaration(declNameConvertor, it), descriptor: makeStructDescriptor(this.library, it) }) }) @@ -164,7 +166,7 @@ abstract class TypeCheckerPrinter { this.writeImports(importFeatures) this.writer.writeClass("TypeChecker", writer => { for (const struct of interfaces) - this.writeInterfaceChecker(struct.name, struct.descriptor) + this.writeInterfaceChecker(struct.name, struct.descriptor, struct.type) const arrayTypes = Array.from(this.library.seenArrayTypes) .sort((a, b) => a[0].localeCompare(b[0])) @@ -219,7 +221,8 @@ class TSTypeCheckerPrinter extends TypeCheckerPrinter { super(library, createLanguageWriter(Language.TS, getReferenceResolver(library))) } - protected writeInterfaceChecker(name: string, descriptor: StructDescriptor): void { + protected writeInterfaceChecker(name: string, descriptor: StructDescriptor, type: idl.IDLType): void { + const typeName = this.library.mapType(type) if (descriptor.getFields().length === 0) { return } @@ -244,7 +247,7 @@ class TSTypeCheckerPrinter extends TypeCheckerPrinter { ]), stmt: writer.makeReturn(writer.makeString('true')) } - }), writer.makeThrowError(`Can not discriminate value typeof ${name}`)) + }), writer.makeThrowError(`Can not discriminate value typeof ${typeName}`)) writer.writeStatement(statement) }) } diff --git a/src/util.ts b/src/util.ts index 53cad72f..310df4dc 100644 --- a/src/util.ts +++ b/src/util.ts @@ -481,6 +481,7 @@ export function renameDtsToComponent(fileName: string, language: Language, withF const renamed = "Ark" .concat(snakeCaseToCamelCase(fileName)) .replace(".d.ts", "") + .replace(".idl", "") if (withFileExtension) { return renamed.concat(language.extension) @@ -492,6 +493,7 @@ export function renameDtsToInterfaces(fileName: string, language: Language, with const renamed = "Ark" .concat(snakeCaseToCamelCase(fileName), "Interfaces") .replace(".d.ts", "") + .replace(".idl", "") if (withFileExtension) { return renamed.concat(language.extension) -- Gitee From 6196ad8f60be35c17eddb695144b3f710f8781eb Mon Sep 17 00:00:00 2001 From: pavelmironchik Date: Fri, 15 Nov 2024 14:37:43 +0000 Subject: [PATCH 10/53] !974 Fix ci --- external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external b/external index c61d429e..babc2e8e 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit c61d429e81c81f40a6a4890ed799a8abefc0ba62 +Subproject commit babc2e8ea96f60ef0dd713b84f6061cb146c6658 -- Gitee From e3222826a7a781e554045f04d2f870f75099edb5 Mon Sep 17 00:00:00 2001 From: zakalyukinalexander_ac40 Date: Fri, 15 Nov 2024 14:58:40 +0000 Subject: [PATCH 11/53] update doc/COMPONENTS_STATUS.md. Signed-off-by: zakalyukinalexander_ac40 --- doc/COMPONENTS_STATUS.md | 1371 +++++++++++++++++++++++--------------- 1 file changed, 827 insertions(+), 544 deletions(-) diff --git a/doc/COMPONENTS_STATUS.md b/doc/COMPONENTS_STATUS.md index 52618b0a..07b26dcc 100755 --- a/doc/COMPONENTS_STATUS.md +++ b/doc/COMPONENTS_STATUS.md @@ -1,7 +1,7 @@ | Component | Function | Owner | Status (done=merged **with** UT, blocked UT=merged **without** UT, blocked=blocked by IDL)|issue/comment| | --------- | -------- | ----- | ------ |------| |*AbilityComponent*| *Component* | Tuzhilkin Ivan | in progress| | -|`setAbilityComponentOptions`| Function | Tuzhilkin Ivan | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`setAbilityComponentOptions`| Function | Tuzhilkin Ivan | in progress| https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |`onConnect`| Function | Tuzhilkin Ivan | in progress| | |`onDisconnect`| Function | Tuzhilkin Ivan | in progress| | |*AlphabetIndexer*| *Component* |Ekaterina Stepanova| blocked | | @@ -68,41 +68,26 @@ |`fontFamily`| Function |Evstigneev Roman | done | | |`contentModifier`| Function |Evstigneev Roman | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SG | |`labelStyle`| Function |Evstigneev Roman | done | | -|*CalendarPicker*| *Component* |Politov Mikhail | in progress | | -|`setCalendarPickerOptions`| Function |Politov Mikhail | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`textStyle`| Function |Politov Mikhail | done | | -|`onChange`| Function |Politov Mikhail | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`edgeAlign`| Function |Politov Mikhail | done | | |*Calendar*| *Component* | Maksimov Nikita | in progress| | -|`setCalendarOptions`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | -|`showLunar`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | -|`showHoliday`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | +|`setCalendarOptions`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | +|`showLunar`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | +|`showHoliday`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | |`needSlide`| Function | Maksimov Nikita | done | | -|`startOfWeek`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | -|`offDays`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | -|`direction`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB1N99 | -|`currentDayStyle`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | -|`nonCurrentDayStyle`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | -|`todayStyle`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | -|`weekStyle`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | -|`workStateStyle`| Function | Maksimov Nikita | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | +|`startOfWeek`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | +|`offDays`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | +|`direction`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB1N99 | +|`currentDayStyle`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | +|`nonCurrentDayStyle`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | +|`todayStyle`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | +|`weekStyle`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | +|`workStateStyle`| Function | Maksimov Nikita | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TMG | |`onSelectChange`| Function | Maksimov Nikita | in progress | | |`onRequestData`| Function | Maksimov Nikita | in progress | | -|*CalendarController*| *Class* |Maksimov Nikita | in progress| | -|`backToToday`| Function |Maksimov Nikita | in progress| | -|`goTo`| Function |Maksimov Nikita | in progress| | -|*CanvasPath*| *Class* | Lobah Mikhail | in progress | | -|`arc`| Function | Lobah Mikhail | in progress | | -|`arcTo`| Function | Lobah Mikhail | in progress | | -|`bezierCurveTo`| Function | Lobah Mikhail | in progress | | -|`closePath`| Function | Lobah Mikhail | in progress | | -|`ellipse`| Function | Lobah Mikhail | in progress | | -|`lineTo`| Function | Lobah Mikhail | in progress | | -|`moveTo`| Function | Lobah Mikhail | in progress | | -|`quadraticCurveTo`| Function | Lobah Mikhail | in progress | | -|`rect`| Function | Lobah Mikhail | in progress | | -|*CanvasPattern*| *Class* | Vadim Voronov | in progress | | -|`setTransform`| Function | Vadim Voronov | in progress | | +|*CalendarPicker*| *Component* |Politov Mikhail | in progress | | +|`setCalendarPickerOptions`| Function |Politov Mikhail | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`textStyle`| Function |Politov Mikhail | done | | +|`onChange`| Function |Politov Mikhail | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`edgeAlign`| Function |Politov Mikhail | done | | |*Canvas*| *Component* |Vadim Voronov | blocked IDL | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZ229 | |`setCanvasOptions`| Function |Vadim Voronov | blocked IDL | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZ229 | |`onReady`| Function |Vadim Voronov | done | | @@ -149,6 +134,7 @@ |`hitTestBehavior`| Function | Roman Sedaikin | done | | |`onChildTouchTest`| Function | | | | |`layoutWeight`| Function | Roman Sedaikin | done | | +|`chainWeight`| Function | | | | |`padding`| Function | Skroba Gleb | in progress | | |`safeAreaPadding`| Function | | | | |`margin`| Function | Skroba Gleb | in progress | | @@ -159,10 +145,10 @@ |`backgroundEffect`| Function | Skroba Gleb | done | | |`backgroundImageResizable`| Function | Skroba Gleb | done | | |`foregroundEffect`| Function | Skroba Gleb | done | | -|`visualEffect`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`backgroundFilter`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`foregroundFilter`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`compositingFilter`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`visualEffect`| Function | Skroba Gleb | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`backgroundFilter`| Function | Skroba Gleb | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`foregroundFilter`| Function | Skroba Gleb | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`compositingFilter`| Function | Skroba Gleb | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |`opacity`| Function | Roman Sedaikin | done | | |`border`| Function | Roman Sedaikin | done | | |`borderStyle`| Function | Roman Sedaikin | done | | @@ -187,14 +173,14 @@ |`focusable`| Function | Roman Sedaikin | done | | |`onFocus`| Function | Roman Sedaikin | done | | |`onBlur`| Function | Roman Sedaikin | done | | -|`tabIndex`| Function | | | | -|`defaultFocus`| Function | | | | -|`groupDefaultFocus`| Function | | | | -|`focusOnTouch`| Function | | | | -|`focusBox`| Function | | | | +|`tabIndex`| Function | Dmitry A Smirnov| in progress | | +|`defaultFocus`| Function | Dmitry A Smirnov| in progress | | +|`groupDefaultFocus`| Function | Dmitry A Smirnov| in progress | | +|`focusOnTouch`| Function | Dmitry A Smirnov| in progress | | +|`focusBox`| Function | Dmitry A Smirnov| in progress | | |`animation`| Function | Erokhin Ilya | blocked IDL |https://gitee.com/nikolay-igotti/idlize/issues/IAXHJP| -|`transition`| Function | | | | -|`motionBlur`| Function | | | | +|`transition`| Function | Dmitry A Smirnov| in progress | | +|`motionBlur`| Function | Dmitry A Smirnov| in progress | | |`brightness`| Function | Lobah Mikhail | in progress | | |`contrast`| Function | Lobah Mikhail | in progress | | |`grayscale`| Function | Lobah Mikhail | in progress | | @@ -209,9 +195,9 @@ |`freeze`| Function | Lobah Mikhail | in progress | | |`translate`| Function | Erokhin Ilya | done | | |`scale`| Function | Erokhin Ilya | done | | -|`gridSpan`| Function | | | | -|`gridOffset`| Function | | | | -|`rotate`| Function | | | | +|`gridSpan`| Function | Dmitry A Smirnov| in progress | | +|`gridOffset`| Function | Dmitry A Smirnov| in progress | | +|`rotate`| Function | Dmitry A Smirnov| in progress | | |`transform`| Function | | | | |`onAppear`| Function | Roman Sedaikin | done | | |`onDisAppear`| Function | Roman Sedaikin | done | | @@ -219,20 +205,20 @@ |`onDetach`| Function | | | | |`onAreaChange`| Function | Roman Sedaikin | done | | |`visibility`| Function | Roman Sedaikin | done | | -|`flexGrow`| Function | | | | -|`flexShrink`| Function | | | | -|`flexBasis`| Function | | | | +|`flexGrow`| Function | Dmitry A Smirnov| in progress | | +|`flexShrink`| Function | Dmitry A Smirnov| in progress | | +|`flexBasis`| Function | Dmitry A Smirnov| in progress | | |`alignSelf`| Function | Roman Sedaikin | done | | |`displayPriority`| Function | Roman Sedaikin | done | | |`zIndex`| Function | Roman Sedaikin | done | | |`direction`| Function | Roman Sedaikin | done | | |`align`| Function | Roman Sedaikin | done | | |`position`| Function | Roman Sedaikin | done | | -|`markAnchor`| Function | | | | +|`markAnchor`| Function | Dmitry A Smirnov| in progress | | |`offset`| Function | Skroba Gleb | in progress | | |`enabled`| Function | Roman Sedaikin | done | | -|`useSizeType`| Function | | | | -|`alignRules`| Function | | | | +|`useSizeType`| Function | Dmitry A Smirnov| in progress | | +|`alignRules`| Function | Dmitry A Smirnov| in progress | | |`aspectRatio`| Function | Roman Sedaikin | done | | |`clickEffect`| Function | | | | |`onDragStart`| Function | | | | @@ -251,9 +237,9 @@ |`motionPath`| Function | | | | |`shadow`| Function | Roman Sedaikin | done | | |`clip`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAW4RH | -|`clipShape`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAW4RH | -|`mask`| Function | | | | -|`maskShape`| Function | | | | +|`clipShape`| Function | Dmitry A Smirnov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAW4RH | +|`mask`| Function | Dmitry A Smirnov| in progress | | +|`maskShape`| Function | Dmitry A Smirnov| in progress | | |`key`| Function | | | | |`id`| Function | Erokhin Ilya | done | | |`geometryTransition`| Function | | | | @@ -287,8 +273,8 @@ |`backgroundImage`| Function | Erokhin Ilya | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9UR | |`backgroundBlurStyle`| Function | Skroba Gleb | done | | |`foregroundBlurStyle`| Function | Roman Sedaikin | done | | -|`focusScopeId`| Function | Berezin Kirill | in progress | | -|`focusScopePriority`| Function | Berezin Kirill | in progress | | +|`focusScopeId`| Function | Dmitry A Smirnov| in progress | | +|`focusScopePriority`| Function | Dmitry A Smirnov| in progress | | |`gesture`| Function | Erokhin Ilya | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IARW2A | |`priorityGesture`| Function | Erokhin Ilya | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IARW2A | |`parallelGesture`| Function | Erokhin Ilya | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IARW2A | @@ -321,12 +307,14 @@ |`strokeWidth`| Function | Evstigneev Roman | done | | |`antiAlias`| Function | Evstigneev Roman | done | | |`strokeDashArray`| Function | Evstigneev Roman | blocked AceEngine|https://gitee.com/openharmony/interface_sdk-js/issues/IAX8ZZ| +|*Common*| *Component* | | | | +|`setCommonOptions`| Function | | | | |*ScrollableCommonMethod*| *Component* | Samarin Sergey |in progress | | |`scrollBar`| Function | Samarin Sergey | in progress | | |`scrollBarColor`| Function | Samarin Sergey | in progress | | |`scrollBarWidth`| Function | Samarin Sergey | in progress | | |`nestedScroll`| Function | Samarin Sergey | in progress | | -|`enableScrollInteraction`| Function | Samarin Sergey |in progress | | +|`enableScrollInteraction`| Function | Samarin Sergey | in progress | | |`friction`| Function | Samarin Sergey | in progress | | |`onScroll`| Function | Samarin Sergey | in progress| | |`onWillScroll`| Function | Samarin Sergey | in progress| | @@ -336,8 +324,9 @@ |`onScrollStart`| Function | Samarin Sergey | in progress| | |`onScrollStop`| Function | Samarin Sergey | in progress| | |`flingSpeedLimit`| Function | Samarin Sergey | in progress | | -|`edgeEffect`| Function | Samarin Sergey |in progress | Arkoala| | -|`fadingEdge`| Function | Samarin Sergey | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`clipContent`| Function | | | | +|`edgeEffect`| Function | Samarin Sergey | in progress | | +|`fadingEdge`| Function | Samarin Sergey | in progress| https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |*Component3D*| *Component* |Kovalev Sergey | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZC20 | |`setComponent3DOptions`| Function |Kovalev Sergey | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZC20 | |`environment`| Function |Kovalev Sergey | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZC20 | @@ -356,9 +345,6 @@ |`onDec`| Function | Erokhin Ilya | done | | |`enableDec`| Function | Erokhin Ilya | done | | |`enableInc`| Function | Erokhin Ilya | done | | -|*CustomDialogController*| *Class* | Erokhin Ilya | blocked | https://gitee.com/openharmony/interface_sdk-js/issues/IB07SJ & https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | -|`open`| Function | Erokhin Ilya | blocked IDL | https://gitee.com/openharmony/interface_sdk-js/issues/IB07SJ & https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | -|`close`| Function | Erokhin Ilya | blocked IDL| https://gitee.com/openharmony/interface_sdk-js/issues/IB07SJ & https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | |*DataPanel*| *Component* | Morozov Sergey |blocked| | |`setDataPanelOptions`| Function | Morozov Sergey |done | | |`closeEffect`| Function | Morozov Sergey |done | | @@ -368,22 +354,32 @@ |`trackShadow`| Function |Morozov Sergey |blocked IDL |https://gitee.com/nikolay-igotti/idlize/issues/IAW4DU| |`contentModifier`| Function | Morozov Sergey |blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SG | |*DatePicker*| *Component* | Vadim Voronov | done | | -|`setDatePickerOptions`| Function | Vadim Voronov| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`setDatePickerOptions`| Function | Vadim Voronov| in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |`lunar`| Function |Vadim Voronov | done | | |`disappearTextStyle`| Function | Vadim Voronov| done | | |`textStyle`| Function |Vadim Voronov | done | | |`selectedTextStyle`| Function |Vadim Voronov | done | | |`onChange`| Function | Vadim Voronov| done | | -|`onDateChange`| Function |Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`onDateChange`| Function |Vadim Voronov | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |*Divider*| *Component* | Tuzhilkin Ivan | done | | |`setDividerOptions`| Function | Tuzhilkin Ivan| done | | |`vertical`| Function | Tuzhilkin Ivan | done | | |`color`| Function | Tuzhilkin Ivan | done | | |`strokeWidth`| Function | Tuzhilkin Ivan | done | | |`lineCap`| Function | Tuzhilkin Ivan | done | | +|*EffectComponent*| *Component* | | | | +|`setEffectComponentOptions`| Function | | | | +|*Ellipse*| *Component* | | | | +|`setEllipseOptions`| Function | | | | +|*EmbeddedComponent*| *Component* | | | | +|`setEmbeddedComponentOptions`| Function | | | | +|`onTerminated`| Function | | | | +|`onError`| Function | | | | |*Flex*| *Component* | Kovalev Sergey | in progress | | |`setFlexOptions`| Function | Kovalev Sergey | done | | |`pointLight`| Function | Evstigneev Roman | In Progress | | +|*FlowItem*| *Component* | | | | +|`setFlowItemOptions`| Function | | | | |*FolderStack*| *Component* | Politov Mikhail | done | | |`setFolderStackOptions`| Function | Politov Mikhail | done | | |`alignContent`| Function | Politov Mikhail | done | | @@ -473,13 +469,16 @@ |`setGridRowOptions`| Function |Lobah Mikhail| in progress| | |`onBreakpointChange`| Function |Lobah Mikhail| in progress| | |`alignItems`| Function |Lobah Mikhail| in progress| | +|*Hyperlink*| *Component* | | | +|`setHyperlinkOptions`| Function | | | +|`color`| Function | | | |*Image*| *Component* | Korobeinikov Evgeny | in progress | | |`setImageOptions`| Function | Berezin Kirill | in progress | | |`alt`| Function | Evstigneev Roman | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9UR | |`matchTextDirection`| Function | Evstigneev Roman | in progress | | |`fitOriginalSize`| Function | Evstigneev Roman | in progress | | |`fillColor`| Function | Evstigneev Roman | done | | -|`objectFit`| Function |Kirill Berezin| done | | +|`objectFit`| Function |Berezin Kirill| done | | |`objectRepeat`| Function | Evstigneev Roman | in progress | | |`autoResize`| Function | Evstigneev Roman | in progress | https://gitee.com/openharmony/arkui_ace_engine/issues/IAW529 | |`renderMode`| Function | Evstigneev Roman | in progress | | @@ -500,6 +499,21 @@ |`resizable`| Function | Evstigneev Roman | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0Y7V | |`privacySensitive`| Function | Evstigneev Roman | in progress | | |`enhancedImageQuality`| Function | Evstigneev Roman | in progress | | +|*ImageAnimator*| *Component* | | | | +|`setImageAnimatorOptions`| Function | | | | +|`images`| Function | | | | +|`state`| Function | | | | +|`duration`| Function | | | | +|`reverse`| Function | | | | +|`fixedSize`| Function | | | | +|`preDecode`| Function | | | | +|`fillMode`| Function | | | | +|`iterations`| Function | | | | +|`onStart`| Function | | | | +|`onPause`| Function | | | | +|`onRepeat`| Function | | | | +|`onCancel`| Function | | | | +|`onFinish`| Function | | | | |*ImageSpan*| *Component* | Politov Mikhail | in progress| | |`setImageSpanOptions`| Function | Politov Mikhail | in progress| | |`verticalAlign`| Function | Politov Mikhail | in progress | | @@ -561,6 +575,11 @@ |`setListItemGroupOptions`|Function|Morozov Sergey|blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | |`divider`|Function|Morozov Sergey|done| | |`childrenMainSize`|Function|Morozov Sergey|in progress| | +|*LoadingProgress*|*Component*| Samarin Sergey | done | | +|`setLoadingProgressOptions`|Function| Samarin Sergey | done | | +|`color`|Function| Samarin Sergey | done | | +|`enableLoading`|Function| Samarin Sergey | done | | +|`contentModifier`|Function| Samarin Sergey|blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SG | |*LocationButton*| *Component* |Samarin Sergey| done | | |`setLocationButtonOptions`| Function |Samarin Sergey| done | | |`onClick`| Function |Samarin Sergey| done | | @@ -575,19 +594,16 @@ |`onStart`| Function | Andrey Khudenkikh| in progress | | |`onBounce`| Function |Andrey Khudenkikh | in progress | | |`onFinish`| Function |Andrey Khudenkikh | in progress | | -|*LoadingProgress*|*Component*| Samarin Sergey | done | | -|`setLoadingProgressOptions`|Function| Samarin Sergey | done | | -|`color`|Function| Samarin Sergey | done | | -|`enableLoading`|Function| Samarin Sergey | done | | -|`contentModifier`|Function| Samarin Sergey|blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SG | +|*MediaCachedImage*| *Component* | | | +|`setMediaCachedImageOptions`| Function | | | |*Menu*|*Component*|Morozov Sergey|blocked | | |`setMenuOptions`| Function |Morozov Sergey| done | | |`fontSize`|Function|Morozov Sergey| done | | |`fontColor`|Function|Morozov Sergey| done | | |`font`|Function|Morozov Sergey| done | | |`radius`|Function|Morozov Sergey| done | | -|`menuItemDivider`|Function|Morozov Sergey| blocked IDL |https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX| -|`menuItemGroupDivider`|Function|Morozov Sergey| blocked IDL |https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX| +|`menuItemDivider`|Function|Morozov Sergey| in progress |https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX| +|`menuItemGroupDivider`|Function|Morozov Sergey| in progress |https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX| |`subMenuExpandingMode`|Function|Morozov Sergey| done | | |*MenuItem*| *Component* |Morozov Sergey|blocked| | |`setMenuItemOptions`| Function |Morozov Sergey|blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | @@ -616,9 +632,15 @@ |`onWillHide`| Function | Kovalev Sergey | done | | |`systemBarStyle`| Function |Kovalev Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SG | |`recoverable`| Function |Kovalev Sergey | done | | -|`systemTransition`| Function |Kovalev Sergey | blocked AceEngine | No handlers for Ark_NavigationSystemTransitionType | +|`systemTransition`| Function |Kovalev Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB4BII | |`title`| Function |Kovalev Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | +|`toolbarConfiguration`| Function |Kovalev Sergey | in progress | | +|`hideToolBar`| Function | Kovalev Sergey | in progress | | |`ignoreLayoutSafeArea`| Function |Kovalev Sergey | done | | +|*NavRouter*| *Component* |Evstigneev Roman | done | | +|`setNavRouterOptions`| Function |Evstigneev Roman| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAYQZF | +|`onStateChange`| Function |Evstigneev Roman | done| | +|`mode`| Function |Evstigneev Roman | done | | |*Navigation*| *Component* | Erokhin Ilya | in progress | | |`setNavigationOptions`| Function | Skroba Gleb | in progress| depend on NavPathStack | |`navBarWidth`|Function| Skroba Gleb | in progress | | @@ -630,7 +652,7 @@ |`hideNavBar`|Function| Erokhin Ilya | done | | |`subTitle`|Function| Erokhin Ilya | done | | |`hideTitleBar`|Function| Skroba Gleb | in progress | main part done, no ace_engine implementation for second | -|`onTitleModeChange`| Function | Skroba Gleb | in progress| no callbacks Arkoala support | +|`onTitleModeChange`| Function | Skroba Gleb | in progress| no callbacks IDL support | |`hideBackButton`|Function| Erokhin Ilya | done | | |`titleMode`|Function| Erokhin Ilya | done | | |`menus`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q , https://gitee.com/openharmony/arkui_ace_engine/issues/IB3U6S| @@ -638,23 +660,22 @@ |`hideToolBar`|Function| Skroba Gleb | in progress | main part done, no ace_engine implementation for second | |`onNavBarStateChange`|Function| Erokhin Ilya | done | | |`onNavigationModeChange`|Function| Erokhin Ilya | done | | -|`navDestination`| Function | Skroba Gleb | in progress | no callbacks Arkoala support | -|`customNavContentTransition`| Function | Skroba Gleb | in progress| no callbacks Arkoala support | +|`navDestination`| Function | Skroba Gleb | in progress | no callbacks IDL support | +|`customNavContentTransition`| Function | Skroba Gleb | in progress| no callbacks IDL support | |`systemBarStyle`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SG | |`recoverable`|Function| Erokhin Ilya | done | | +|`enableDragBar`| Function | | | | |`title`| Function | Erokhin Ilya | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | |`toolbarConfiguration`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q| -|`ignoreLayoutSafeArea`| Function | Skroba Gleb | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TXB | -|*NavRouter*| *Component* |Evstigneev Roman | done | | -|`setNavRouterOptions`| Function |Evstigneev Roman| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAYQZF | -|`onStateChange`| Function |Evstigneev Roman | done| | -|`mode`| Function |Evstigneev Roman | done | | +|`ignoreLayoutSafeArea`| Function | Skroba Gleb | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3TXB | |*Navigator*| *Component* | Skroba Gleb| blocked | | |`setNavigatorOptions`| Function | Skroba Gleb | done | | |`active`| Function | Skroba Gleb | done | | |`type`| Function | Skroba Gleb | done | | |`target`| Function | Skroba Gleb | done | | -|`params`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`params`| Function | Skroba Gleb |in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|*NodeContainer*| *Component* | | | | +|`setNodeContainerOptions`| Function | | | | |*Panel*| *Component* | Pavelyev Ivan| done | | |`setPanelOptions`| Function | Pavelyev Ivan| done | | |`mode`| Function |Pavelyev Ivan| done | | @@ -689,18 +710,28 @@ |`autoReset`| Function | Dmitry A Smirnov| done| | |`onDotConnect`| Function | Dmitry A Smirnov| in progress| | |`activateCircleStyle`| Function | Dmitry A Smirnov| blocked AceEngine| https://gitee.com/openharmony/arkui_ace_engine/issues/IAYWON | -|*Progress*| *Component* | Erokhin Ilya | | | +|*PluginComponent*| *Component* | | | | +|`setPluginComponentOptions`| Function | | | | +|`onComplete`| Function | | | | +|`onError`| Function | | | | +|*Polygon*| *Component* | | | | +|`setPolygonOptions`| Function | | | | +|`points`| Function | | | | +|*Polyline*| *Component* | | | | +|`setPolylineOptions`| Function | | | | +|`points`| Function | | | | +|*Progress*| *Component* | Erokhin Ilya | | | |`setProgressOptions`| Function | Erokhin Ilya | in progress | | |`value`| Function | Erokhin Ilya | in progress | | |`color`| Function | Erokhin Ilya | in progress | | -|`style`| Function | Erokhin Ilya | in progress | | +|`style`| Function | Erokhin Ilya | blocked | linearStyle.strokeRadius https://gitee.com/nikolay-igotti/idlize/issues/IB4G8D | |`privacySensitive`| Function | Erokhin Ilya | in progress | | -|`contentModifier`| Function | Erokhin Ilya | in progress | | +|`contentModifier`| Function | Erokhin Ilya | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SG | |*QRCode*| *Component* | Evstigneev Roman |in progress| | |`setQRCodeOptions`| Function |Evstigneev Roman | done | | -|`color`| Function |Evstigneev Roman |blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZVOQ | -|`backgroundColor`| Function |Evstigneev Roman | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZVOQ | -|`contentOpacity`| Function |Evstigneev Roman | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZVOQ | +|`color`| Function |Evstigneev Roman |done | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZVOQ | +|`backgroundColor`| Function |Evstigneev Roman | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZVOQ | +|`contentOpacity`| Function |Evstigneev Roman | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IAZVOQ | |*Radio*| *Component* | Evstigneev Roman | done | | |`setRadioOptions`| Function | Evstigneev Roman | done | | |`checked`| Function | Evstigneev Roman | done | | @@ -720,12 +751,12 @@ |`radiusHeight`|Function|Dudkin Sergey| done | | |`radius`|Function|Dudkin Sergey| blocked AceEngine|https://gitee.com/openharmony/interface_sdk-js/issues/IAXA7J| |*Refresh*| *Component* |Politov Mikhail | in progress | | -|`setRefreshOptions`| Function |Politov Mikhail | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`onStateChange`| Function |Politov Mikhail | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`onRefreshing`| Function |Politov Mikhail | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`setRefreshOptions`| Function |Politov Mikhail | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`onStateChange`| Function |Politov Mikhail | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`onRefreshing`| Function |Politov Mikhail | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |`refreshOffset`| Function |Politov Mikhail | done | | |`pullToRefresh`| Function |Politov Mikhail | done | | -|`onOffsetChange`| Function |Politov Mikhail | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`onOffsetChange`| Function |Politov Mikhail | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |`pullDownRatio`| Function |Politov Mikhail | done | | |*RelativeContainer*| *Component* | Dmitry A Smirnov | done | | |`setRelativeContainerOptions`| Function | Dmitry A Smirnov | done | | @@ -751,10 +782,10 @@ |`onEditingChange`| Function | Dudkin Sergey| done| | |`enterKeyType`| Function | Dudkin Sergey| in progress| | |`onSubmit`| Function | Dudkin Sergey| done| | -|`onWillChange`| Function | Dudkin Sergey| done| | +|`onWillChange`| Function | Dudkin Sergey| blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IB4G70 | |`onDidChange`| Function | Dudkin Sergey| done| | -|`onCut`| Function | Dudkin Sergey| in progress| Ark_CutEvent param is always empty now DMZ| -|`onCopy`| Function | Dudkin Sergey| in progress| Ark_CopyEvent param is always empty now DMZ| +|`onCut`| Function | Dudkin Sergey| in progress| | +|`onCopy`| Function | Dudkin Sergey| in progress| | |`editMenuOptions`| Function | Dudkin Sergey| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB3UKQ | |`enableKeyboardOnFocus`| Function | Dudkin Sergey| in progress| | |`enableHapticFeedback`| Function | Dudkin Sergey| in progress| | @@ -766,6 +797,8 @@ |`setRichTextOptions`| Function | Dudkin Sergey| in progress| | |`onStart`| Function | Dudkin Sergey| in progress| | |`onComplete`| Function | Dudkin Sergey| in progress| | +|*RootScene*| *Component* | Maksimov Nikita | in progress | | +|`setRootSceneOptions`| Function | Maksimov Nikita | in progress | | |*Row*| *Component* | Andrey Khudenkikh | in progress | | |`setRowOptions`| Function | Andrey Khudenkikh | done | | |`alignItems`| Function | Andrey Khudenkikh | done | | @@ -778,38 +811,32 @@ |*SaveButton*| *Component* | Samarin Sergey| done | | |`setSaveButtonOptions`| Function | Samarin Sergey| done | | |`onClick`| Function | Samarin Sergey| done | | -|*Scroll*| *Component* | Kirill Berezin | in progress | | -|`setScrollOptions`| Function | Kirill Berezin | in progress | | -|`scrollable`| Function | Kirill Berezin | In progress | | -|`onScroll`| Function | Kirill Berezin | done | | -|`onWillScroll`| Function | Kirill Berezin |blocked | | -|`onDidScroll`| Function | Kirill Berezin | in progress | | -|`onScrollEdge`| Function | Kirill Berezin | in progress | | -|`onScrollStart`| Function | Kirill Berezin | done | | -|`onScrollEnd`| Function | Kirill Berezin | done | | -|`onScrollStop`| Function | Kirill Berezin | done | | -|`scrollBar`| Function | Kirill Berezin | in progress | | -|`scrollBarColor`| Function | Kirill Berezin | in progress | | -|`scrollBarWidth`| Function | Kirill Berezin | in progress | | -|`edgeEffect`| Function | Kirill Berezin | in progress | | -|`onScrollFrameBegin`| Function | Kirill Berezin |blocked | | -|`nestedScroll`| Function | Kirill Berezin | in progress | | -|`enableScrollInteraction`| Function | Kirill Berezin | In progress | | -|`friction`| Function | Kirill Berezin | In progress | | -|`scrollSnap`| Function | Kirill Berezin | in progress | | -|`enablePaging`| Function | Kirill Berezin | done | | -|`initialOffset`| Function | Kirill Berezin | done | | -|*Scroller*| *Class* | Erokhin Ilya | blocked | | -|`scrollTo`| Function | Erokhin Ilya | done | | -|`scrollEdge`| Function | Erokhin Ilya | done | | -|`fling`| Function | Erokhin Ilya | done | | -|`scrollPage`| Function | Erokhin Ilya | done | | -|`currentOffset`| Function | Erokhin Ilya | blocked IDL |https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0| -|`scrollToIndex`| Function | Erokhin Ilya | blocked IDL |https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX| -|`scrollBy`| Function | Erokhin Ilya | done | | -|`isAtEnd`| Function | Erokhin Ilya | done | | -|`getItemRect`| Function | Erokhin Ilya | blocked IDL |https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0| -|`getItemIndex`| Function | Erokhin Ilya | done | | +|*Screen*| *Component* | Maksimov Nikita | in progress | | +|`setScreenOptions`| Function | Maksimov Nikita | in progress | | +|*Scroll*| *Component* | Berezin Kirill | in progress | | +|`setScrollOptions`| Function | Berezin Kirill | in progress | | +|`scrollable`| Function | Berezin Kirill | In progress | | +|`onScroll`| Function | Berezin Kirill | done | | +|`onWillScroll`| Function | Berezin Kirill |blocked | | +|`onDidScroll`| Function | Berezin Kirill | in progress | | +|`onScrollEdge`| Function | Berezin Kirill | in progress | | +|`onScrollStart`| Function | Berezin Kirill | done | | +|`onScrollEnd`| Function | Berezin Kirill | done | | +|`onScrollStop`| Function | Berezin Kirill | done | | +|`scrollBar`| Function | Berezin Kirill | in progress | | +|`scrollBarColor`| Function | Berezin Kirill | in progress | | +|`scrollBarWidth`| Function | Berezin Kirill | in progress | | +|`edgeEffect`| Function | Berezin Kirill | in progress | | +|`onScrollFrameBegin`| Function | Berezin Kirill |blocked | | +|`nestedScroll`| Function | Berezin Kirill | in progress | | +|`enableScrollInteraction`| Function | Berezin Kirill | In progress | | +|`friction`| Function | Berezin Kirill | In progress | | +|`scrollSnap`| Function | Berezin Kirill | in progress | | +|`enablePaging`| Function | Berezin Kirill | done | | +|`initialOffset`| Function | Berezin Kirill | done | | +|*ScrollBar*| *Component* | Maksimov Nikita | in progress | | +|`setScrollBarOptions`| Function | Maksimov Nikita | in progress | | +|`enableNestedScroll`| Function | Maksimov Nikita | in progress | | |*Search*|*Component*| Evstigneev Roman |In Progress| | |`setSearchOptions`|Function| Evstigneev Roman | in progress | https://gitee.com/openharmony/arkui_ace_engine/issues/IAXCOP | |`searchButton`|Function| Evstigneev Roman | done | | @@ -857,11 +884,11 @@ |`layoutDirection`| Function |Samarin Sergey|done | | |`position`| Function |Samarin Sergey| done | | |`markAnchor`| Function |Samarin Sergey| done | | -|`offset`| Function |Samarin Sergey| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`offset`| Function |Samarin Sergey| in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |`fontSize`| Function |Samarin Sergey| done | | |`fontStyle`| Function |Samarin Sergey| done | | |`fontWeight`| Function |Samarin Sergey| done | | -|`fontFamily`| Function |Samarin Sergey| blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB29LJ | +|`fontFamily`| Function |Samarin Sergey| done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB29LJ | |`fontColor`| Function |Samarin Sergey| done | | |`iconColor`| Function |Samarin Sergey| done | | |`backgroundColor`| Function |Samarin Sergey| done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB17WJ | @@ -939,7 +966,7 @@ |`showTips`| Function |Morozov Sergey |done | | |*BaseSpan*| *Component* |Politov Mikhail | in progress | | |`textBackgroundStyle`| Function | Politov Mikhail | done | | -|`baselineOffset`| Function | Politov Mikhail | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`baselineOffset`| Function | Politov Mikhail | in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |*Span*| *Component* | Politov Mikhail | done | | |`setSpanOptions`| Function |Politov Mikhail | done | | |`font`| Function | Politov Mikhail | done | | @@ -952,7 +979,7 @@ |`letterSpacing`| Function |Politov Mikhail | done | | |`textCase`| Function | Politov Mikhail | done | | |`lineHeight`| Function | Politov Mikhail | done | | -|`textShadow`| Function | Politov Mikhail | blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB1K3Z | +|`textShadow`| Function | Politov Mikhail | done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB1K3Z | |*Stack*| *Component* | Korobeinikov Evgeny | in progress | | |`setStackOptions` | Function | Korobeinikov Evgeny | done | | |`alignContent` | Function | Korobeinikov Evgeny | done | | @@ -993,7 +1020,7 @@ |`onAnimationStart`| Function | Skroba Gleb| done | | |`onAnimationEnd`| Function | Skroba Gleb | done | | |`onGestureSwipe`| Function | Skroba Gleb | done | | -|`nestedScroll`| Function | Skroba Gleb| blocked UT | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3ULZ | +|`nestedScroll`| Function | Skroba Gleb| done | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3ULZ | |`customContentTransition`| Function | Skroba Gleb | in progress | | |`onContentDidScroll`| Function | Skroba Gleb| done | | |`indicatorInteractive`| Function | Skroba Gleb| done | | @@ -1005,14 +1032,10 @@ |`loop`| Function | Andrey Khudenkikh | done | | |`vertical`| Function | Andrey Khudenkikh | done | | |`onChange`| Function | Andrey Khudenkikh | done | | -|*IndicatorComponentController*| *Class* | Andrey Khudenkikh | in progress | | -|`showNext`| Function | Andrey Khudenkikh | in progress | | -|`showPrevious`| Function | Andrey Khudenkikh | in progress | | -|`changeIndex`| Function | Andrey Khudenkikh | in progress | | -|*SymbolGlyph*| *Component* |Andrey Khudenkikh | in progress | | -|`setSymbolGlyphOptions`| Function |Andrey Khudenkikh | in progress | | +|*SymbolGlyph*| *Component* |Andrey Khudenkikh | blocked | | +|`setSymbolGlyphOptions`| Function |Andrey Khudenkikh | done | | |`fontSize`| Function |Andrey Khudenkikh | done | | -|`fontColor`| Function |Andrey Khudenkikh | in progress | | +|`fontColor`| Function |Andrey Khudenkikh | done | | |`fontWeight`| Function |Andrey Khudenkikh | done | | |`effectStrategy`| Function |Andrey Khudenkikh | done | | |`renderingStrategy`| Function |Andrey Khudenkikh | done | | @@ -1024,21 +1047,52 @@ |`fontWeight`| Function |Dmitry A Smirnov| done| | |`effectStrategy`| Function |Dmitry A Smirnov| done| | |`renderingStrategy`| Function |Dmitry A Smirnov| done| | +|*Tabs*| *Component* | Tuzhilkin Ivan | in progress | | +|`setTabsOptions`| Function | Skroba Gleb | done | | +|`vertical`| Function | Tuzhilkin Ivan | done | | +|`barPosition`| Function | Tuzhilkin Ivan | done | | +|`scrollable`| Function | Tuzhilkin Ivan | done | | +|`barMode`| Function | Tuzhilkin Ivan | done | | +|`barWidth`| Function | Tuzhilkin Ivan | done | | +|`barHeight`| Function | Tuzhilkin Ivan | done | | +|`animationDuration`| Function | Tuzhilkin Ivan | in progress | https://gitee.com/openharmony/arkui_ace_engine/issues/IATEBX | +|`animationMode`| Function | Tuzhilkin Ivan | done | | +|`edgeEffect`| Function | Tuzhilkin Ivan | done | | +|`onChange`| Function | Tuzhilkin Ivan | done | | +|`onTabBarClick`| Function | Tuzhilkin Ivan | done | | +|`onAnimationStart`| Function | Tuzhilkin Ivan | done | | +|`onAnimationEnd`| Function | Tuzhilkin Ivan | done | | +|`onGestureSwipe`| Function | Tuzhilkin Ivan | done | | +|`fadingEdge`| Function | Tuzhilkin Ivan | done | | +|`divider`| Function | Tuzhilkin Ivan | done | | +|`barOverlap`| Function | Tuzhilkin Ivan | done | | +|`barBackgroundColor`| Function | Tuzhilkin Ivan | done | | +|`barGridAlign`| Function | Tuzhilkin Ivan | done | | +|`customContentTransition`| Function | Tuzhilkin Ivan | in progress | | +|`barBackgroundBlurStyle`| Function | Tuzhilkin Ivan | done | | +|`barBackgroundEffect`| Function | | | | +|`onContentWillChange`| Function | Tuzhilkin Ivan | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IARLIB | +|`barModeBarMode_SCROLLABLE`| Function | | | | +|*TabContent*| *Component* | Evstigneev Roman |in progress | | +|`setTabContentOptions`| Function | Evstigneev Roman | done | | +|`tabBar`| Function | Evstigneev Roman | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | +|`onWillShow`| Function |Evstigneev Roman | in progress | | +|`onWillHide`| Function |Evstigneev Roman | in progress | | |*Text*| *Component* | Kirill Kirichenko | in progress | | |`setTextOptions`| Function | Kirill Kirichenko | in progress | | |`font`| Function |Samarin Sergey |in progress | | -|`fontColor`| Function |Samarin Sergey |in progress | | -|`fontSize`| Function |Samarin Sergey |in progress | | +|`fontColor`| Function |Samarin Sergey | in progress | | +|`fontSize`| Function |Samarin Sergey | in progress | | |`minFontSize`| Function |Samarin Sergey |in progress | | |`maxFontSize`| Function |Samarin Sergey |in progress | | |`minFontScale`| Function |Samarin Sergey |in progress | | |`maxFontScale`| Function |Samarin Sergey |in progress | | -|`fontStyle`| Function |Samarin Sergey |in progress | | +|`fontStyle`| Function |Samarin Sergey | in progress | | |`fontWeight`| Function |Samarin Sergey |in progress | | |`lineSpacing`| Function |Samarin Sergey |in progress | | |`textAlign`| Function |Samarin Sergey |in progress | | |`lineHeight`| Function |Samarin Sergey |in progress | | -|`textOverflow`| Function |Samarin Sergey |in progress | | +|`textOverflow`| Function |Samarin Sergey | in progress | | |`fontFamily`| Function |Samarin Sergey |in progress | | |`maxLines`| Function |Samarin Sergey |in progress | | |`decoration`| Function |Samarin Sergey |in progress | | @@ -1048,14 +1102,14 @@ |`copyOption`| Function |Samarin Sergey |in progress | | |`draggable`| Function |Samarin Sergey | done | | |`textShadow`| Function |Samarin Sergey |in progress | | -|`heightAdaptivePolicy`| Function |Samarin Sergey |in progress | | +|`heightAdaptivePolicy`| Function |Samarin Sergey | in progress | | |`textIndent`| Function |Samarin Sergey |in progress | | -|`wordBreak`| Function | Samarin Sergey |in progress | | +|`wordBreak`| Function | Samarin Sergey | in progress | | |`lineBreakStrategy`| Function |Samarin Sergey |in progress | | |`onCopy`| Function | Samarin Sergey |in progress | | |`caretColor`| Function |Samarin Sergey |in progress | | |`selectedBackgroundColor`| Function |Samarin Sergey |in progress | | -|`ellipsisMode`| Function |Samarin Sergey |in progress | | +|`ellipsisMode`| Function |Samarin Sergey | in progress | | |`EnableDataDetector`| Function | Kirill Kirichenko | done | | |`DataDetectorConfig`| Function | Kirill Kirichenko | in progress | | |`onTextSelectionChange`| Function |Samarin Sergey |in progress | | @@ -1072,12 +1126,12 @@ |`placeholderFont`|Function|Tuzhilkin Ivan|done| | |`enterKeyType`|Function|Tuzhilkin Ivan|done| | |`textAlign`|Function|Tuzhilkin Ivan|done| | -|`caretColor`|Function|Tuzhilkin Ivan|done| | -|`fontColor`|Function|Tuzhilkin Ivan|done| | -|`textIndent`|Function|Tuzhilkin Ivan|done| | +|`caretColor`|Function|Tuzhilkin Ivan|in progress| | +|`fontColor`|Function|Tuzhilkin Ivan|in progress| | +|`textIndent`|Function|Tuzhilkin Ivan|in progress| | |`inputFilter`|Function|Tuzhilkin Ivan|done| | |`caretStyle`|Function|Tuzhilkin Ivan|in progress| | -|`selectedBackgroundColor`|Function|Tuzhilkin Ivan|done| | +|`selectedBackgroundColor`|Function|Tuzhilkin Ivan|in progress| | |`onSubmit`|Function|Tuzhilkin Ivan|done| | |`onChange`|Function|Tuzhilkin Ivan|done| | |`onTextSelectionChange`|Function|Tuzhilkin Ivan|done| | @@ -1090,13 +1144,13 @@ |`enableKeyboardOnFocus`|Function|Tuzhilkin Ivan|done| | |`maxLength`|Function|Tuzhilkin Ivan|done| | |`selectionMenuHidden`|Function|Tuzhilkin Ivan|done| | -|`minFontSize`|Function|Tuzhilkin Ivan|done| | -|`maxFontSize`|Function|Tuzhilkin Ivan|done| | +|`minFontSize`|Function|Tuzhilkin Ivan|in progress| | +|`maxFontSize`|Function|Tuzhilkin Ivan|in progress| | |`maxLines`|Function|Tuzhilkin Ivan|done| | |`customKeyboard`|Function|Tuzhilkin Ivan|blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | -|`decoration`|Function|Tuzhilkin Ivan|done| | -|`letterSpacing`|Function|Tuzhilkin Ivan|done| | -|`lineSpacing`|Function|Tuzhilkin Ivan|blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`decoration`|Function|Tuzhilkin Ivan|in progress| | +|`letterSpacing`|Function|Tuzhilkin Ivan|in progress| | +|`lineSpacing`|Function|Tuzhilkin Ivan|in progress| | |`lineHeight`|Function|Tuzhilkin Ivan|done| | |`type`|Function|Tuzhilkin Ivan|done| | |`enableAutoFill`|Function|Tuzhilkin Ivan|done| | @@ -1113,8 +1167,8 @@ |`fontStyle`|Function|Tuzhilkin Ivan|in progress| | |`fontWeight`|Function|Tuzhilkin Ivan|in progress| | |`fontFamily`|Function|Tuzhilkin Ivan|in progress| | -|`textOverflow`|Function|Tuzhilkin Ivan|blocked AceEngine|https://gitee.com/openharmony/arkui_ace_engine/issues/IAXX0N| -|`showCounter`|Function|Tuzhilkin Ivan|blocked AceEngine| https://gitee.com/openharmony/arkui_ace_engine/issues/IB3V0N | +|`textOverflow`|Function|Tuzhilkin Ivan|in progress| https://gitee.com/openharmony/arkui_ace_engine/issues/IAXX0N | +|`showCounter`|Function|Tuzhilkin Ivan|in progress| https://gitee.com/openharmony/arkui_ace_engine/issues/IB3V0N | |`style`|Function|Tuzhilkin Ivan|in progress| | |`barState`|Function|Tuzhilkin Ivan|in progress| | |`heightAdaptivePolicy`|Function|Tuzhilkin Ivan|in progress| | @@ -1134,9 +1188,6 @@ |`fontFeature`| Function |Pavelyev Ivan|done| | |`contentModifier`| Function |Pavelyev Ivan|blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9SG | |`dateTimeOptions`| Function |Pavelyev Ivan|in progress| | -|*TextClockController*| *Class* |Pavelyev Ivan|in progress| | -|`start`| Function |Pavelyev Ivan|in progress| | -|`stop`| Function |Pavelyev Ivan|in progress| | |*TextInput*| *Component* | Spirin Andrey | in progress | | |`setTextInputOptions`| Function | Spirin Andrey | done | | |`type`| Function | Spirin Andrey | done | | @@ -1157,8 +1208,8 @@ |`fontColor`| Function | Spirin Andrey | done | | |`fontSize`| Function | Spirin Andrey | done | | |`fontStyle`| Function | Spirin Andrey | done | | -|`fontWeight`| Function | Spirin Andrey | done | | -|`fontFamily`| Function | Spirin Andrey | in progress | | +|`fontWeight`| Function | Spirin Andrey | done | | +|`fontFamily`| Function | Spirin Andrey | done | | |`onCopy`| Function | Spirin Andrey | in progress | | |`onCut`| Function | Spirin Andrey | in progress| | |`onPaste`| Function | Spirin Andrey | in progress| | @@ -1174,7 +1225,7 @@ |`showError`| Function | Spirin Andrey | done | | |`showUnit`| Function | Spirin Andrey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | |`showUnderline`| Function | Spirin Andrey | done | | -|`underlineColor`| Function | Spirin Andrey | in progress | | +|`underlineColor`| Function | Spirin Andrey | done | | |`selectionMenuHidden`| Function | Spirin Andrey | done | | |`barState`| Function | Spirin Andrey | done | | |`maxLines`| Function | Spirin Andrey | done | | @@ -1189,7 +1240,7 @@ |`decoration`| Function | Spirin Andrey | done | | |`letterSpacing`| Function | Spirin Andrey | done | | |`lineHeight`| Function | Spirin Andrey | done | | -|`passwordRules`| Function | Spirin Andrey | in progress | | +|`passwordRules`| Function | Spirin Andrey | done | | |`fontFeature`| Function | Spirin Andrey | done | | |`showPassword`| Function | Spirin Andrey | done | | |`onSecurityStateChange`| Function | Spirin Andrey | in progress| | @@ -1217,7 +1268,7 @@ |`divider`| Function |Ekaterina Stepanova | done | | |`gradientHeight`| Function | Ekaterina Stepanova| done | | |*TextTimer*| *Component* |Ekaterina Stepanova| blocked | | -|`setTextTimerOptions`| Function |Ekaterina Stepanova| in progress | | +|`setTextTimerOptions`| Function |Ekaterina Stepanova| done | | |`format`| Function |Ekaterina Stepanova| done | | |`fontColor`| Function |Ekaterina Stepanova| done | | |`fontSize`| Function |Ekaterina Stepanova| done | | @@ -1227,18 +1278,14 @@ |`onTimer`| Function |Ekaterina Stepanova| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB3V0H | |`textShadow`| Function |Ekaterina Stepanova| blocked AceEngine| https://gitee.com/openharmony/arkui_ace_engine/issues/IB2SZK | |`contentModifier`| Function |Ekaterina Stepanova| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SG | -|*TextTimerController*| *Class* |Ekaterina Stepanova| in progress | | -|`start`| Function |Ekaterina Stepanova| in progress | | -|`pause`| Function |Ekaterina Stepanova| in progress | | -|`reset`| Function |Ekaterina Stepanova| in progress | | |*TimePicker*| *Component* | Ekaterina Stepanova| blocked | | -|`setTimePickerOptions`| Function |Ekaterina Stepanova| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`setTimePickerOptions`| Function |Ekaterina Stepanova| in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |`useMilitaryTime`| Function |Ekaterina Stepanova| done | | |`loop`| Function |Ekaterina Stepanova| done | | |`disappearTextStyle`| Function |Ekaterina Stepanova| done | | |`textStyle`| Function |Ekaterina Stepanova| done | | |`selectedTextStyle`| Function |Ekaterina Stepanova| done | | -|`dateTimeOptions`| Function |Ekaterina Stepanova| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`dateTimeOptions`| Function |Ekaterina Stepanova| in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |`onChange`| Function |Ekaterina Stepanova| done | | |`enableHapticFeedback`| Function |Ekaterina Stepanova| done | | |*Toggle*| *Component* |Morozov Sergey |blocked | | @@ -1248,269 +1295,6 @@ |`selectedColor`| Function | Morozov Sergey|done | | |`switchPointColor`| Function | Morozov Sergey|done | | |`switchStyle`| Function | Morozov Sergey|done | | -|*SearchController*| *Class* |Evstigneev Roman |done | | -|`caretPosition`| Function |Evstigneev Roman | done | | -|`stopEditing`| Function |Evstigneev Roman | done | | -|`setTextSelection`| Function |Evstigneev Roman | done | | -|*SwiperController*| *Class* | Skroba Gleb | done | | -|`showNext`| Function | Skroba Gleb | done | | -|`showPrevious`| Function | Skroba Gleb | done | | -|`changeIndex`| Function | Skroba Gleb | done | | -|`finishAnimation`| Function | Skroba Gleb | in progress | | -|*SwiperContentTransitionProxy*| *Class* | Skroba Gleb | in progress | | -|`finishTransition`| Function | Skroba Gleb | in progress | | -|`getSelectedIndex`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | -|`setSelectedIndex`| Function | Skroba Gleb | in progress | | -|`getIndex`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | -|`setIndex`| Function | Skroba Gleb | in progress | | -|`getPosition`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | -|`setPosition`| Function | Skroba Gleb | in progress | | -|`getMainAxisLength`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | -|`setMainAxisLength`| Function | Skroba Gleb | in progress | | -|*TabsController*| *Class* | Skroba Gleb | in progress | -|`changeIndex`| Function | Skroba Gleb | done | | -|`preloadItems`| Function | Skroba Gleb | done | | -|`setTabBarTranslate`| Function | | | | -|`setTabBarOpacity`| Function | | | | -|*TextAreaController*| *Class* | Tuzhilkin Ivan | in progress | | -|`caretPosition`| Function | Tuzhilkin Ivan | in progress | | -|`setTextSelection`| Function | Tuzhilkin Ivan | in progress | | -|`stopEditing`| Function | Tuzhilkin Ivan | in progress | | -|*TabContentTransitionProxy*| *Class* | | | | -|`finishTransition`| Function | | | | -|`getFrom`| Function | | | | -|`setFrom`| Function | | | | -|`getTo`| Function | | | | -|`setTo`| Function | | | | -|*EditMenuOptions*| *Class* | Erokhin Ilya | in progress | | -|`onCreateMenu`| Function |Erokhin Ilya | in progress | | -|`onMenuItemClick`| Function |Erokhin Ilya | in progress | | -|*TextInputController*| *Class* | Spirin Andrey | in progress | | -|`caretPosition`| Function | Spirin Andrey | in progress | | -|`setTextSelection`| Function | Spirin Andrey | in progress | | -|`stopEditing`| Function | Spirin Andrey | in progress | | -|*Tabs*| *Component* | Tuzhilkin Ivan | in progress | | -|`setTabsOptions`| Function | Skroba Gleb | done | | -|`vertical`| Function | Tuzhilkin Ivan | done | | -|`barPosition`| Function | Tuzhilkin Ivan | done | | -|`scrollable`| Function | Tuzhilkin Ivan | done | | -|`barMode`| Function | Tuzhilkin Ivan | done | | -|`barWidth`| Function | Tuzhilkin Ivan | done | | -|`barHeight`| Function | Tuzhilkin Ivan | done | | -|`animationDuration`| Function | Tuzhilkin Ivan | in progress | https://gitee.com/openharmony/arkui_ace_engine/issues/IATEBX | -|`animationMode`| Function | Tuzhilkin Ivan | done | | -|`edgeEffect`| Function | Tuzhilkin Ivan | done | | -|`onChange`| Function | Tuzhilkin Ivan | done | | -|`onTabBarClick`| Function | Tuzhilkin Ivan | done | | -|`onAnimationStart`| Function | Tuzhilkin Ivan | done | | -|`onAnimationEnd`| Function | Tuzhilkin Ivan | done | | -|`onGestureSwipe`| Function | Tuzhilkin Ivan | done | | -|`fadingEdge`| Function | Tuzhilkin Ivan | done | | -|`divider`| Function | Tuzhilkin Ivan | done | | -|`barOverlap`| Function | Tuzhilkin Ivan | done | | -|`barBackgroundColor`| Function | Tuzhilkin Ivan | done | | -|`barGridAlign`| Function | Tuzhilkin Ivan | done | | -|`customContentTransition`| Function | Tuzhilkin Ivan | in progress | | -|`barBackgroundBlurStyle`| Function | Tuzhilkin Ivan | done | | -|`onContentWillChange`| Function | Tuzhilkin Ivan | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IARLIB | -|*TabContent*| *Component* | Evstigneev Roman |in progress | | -|`setTabContentOptions`| Function | Evstigneev Roman | done | | -|`tabBar`| Function | Evstigneev Roman | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | -|`onWillShow`| Function |Evstigneev Roman | in progress | | -|`onWillHide`| Function |Evstigneev Roman | in progress | | -|*SideBarContainer*| *Component* |Dmitry A Smirnov|blocked| | -|`setSideBarContainerOptions`| Function |Dmitry A Smirnov|done| | -|`showSideBar`| Function |Dmitry A Smirnov|done| | -|`controlButton`| Function |Dmitry A Smirnov| blocked IDL | 1.parse PixelMap from CustomObject https://gitee.com/nikolay-igotti/idlize/issues/IAU9UR 2. default values https://gitee.com/openharmony/arkui_ace_engine/issues/IAW40V | -|`showControlButton`| Function |Dmitry A Smirnov|done| | -|`onChange`| Function |Dmitry A Smirnov|done| | -|`sideBarWidth`| Function |Dmitry A Smirnov|done| | -|`minSideBarWidth`| Function |Dmitry A Smirnov|done| | -|`maxSideBarWidth`| Function |Dmitry A Smirnov|done| | -|`autoHide`| Function |Dmitry A Smirnov|done| | -|`sideBarPosition`| Function |Dmitry A Smirnov|done| | -|`divider`| Function |Dmitry A Smirnov|done| | -|`minContentWidth`| Function |Dmitry A Smirnov|done| | -|*WaterFlow*| *Component* | Kovalev Sergey | in progress | | -|`setWaterFlowOptions`| Function | Kovalev Sergey |blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`columnsTemplate`| Function | Kovalev Sergey | done | | -|`itemConstraintSize`| Function | Kovalev Sergey | done | | -|`rowsTemplate`| Function | Kovalev Sergey | done | | -|`columnsGap`| Function | Kovalev Sergey | done | | -|`rowsGap`| Function |Kovalev Sergey | done | | -|`layoutDirection`| Function |Kovalev Sergey | done | | -|`nestedScroll`| Function | Kovalev Sergey | done | | -|`enableScrollInteraction`| Function | Kovalev Sergey | done | | -|`friction`| Function | Kovalev Sergey | done | | -|`cachedCount`| Function |Kovalev Sergey | done | | -|`onReachStart`| Function | Kovalev Sergey | in progress | | -|`onReachEnd`| Function | Kovalev Sergey | in progress | | -|`onScrollFrameBegin`| Function | Kovalev Sergey | in progress | | -|`onScrollIndex`| Function | Kovalev Sergey | in progress | | -|*LinearIndicatorController*| *Class* | Kovalev Sergey | in progress | | -|`setProgress`| Function | Kovalev Sergey | in progress | | -|`start`| Function | Kovalev Sergey | in progress | | -|`pause`| Function | Kovalev Sergey | in progress | | -|`stop`| Function | Kovalev Sergey | in progress | | -|*LinearIndicator*| *Component* | Kovalev Sergey | in progress | | -|`setLinearIndicatorOptions`| Function | Kovalev Sergey | in progress | | -|`indicatorStyle`| Function | Kovalev Sergey | in progress | | -|`indicatorLoop`| Function | Kovalev Sergey | in progress | | -|`onChange`| Function | Kovalev Sergey | in progress | | -|*CanvasRenderer*| *Class* | Vadim Voronov | in progress | | -|`drawImage`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`beginPath`| Function | Vadim Voronov | done | | -|`clip`| Function | Vadim Voronov | in progress | | -|`fill`| Function | Vadim Voronov | in progress | | -|`stroke`| Function | Vadim Voronov | in progress | | -|`createLinearGradient`| Function | Vadim Voronov | in progress | | -|`createPattern`| Function | Vadim Voronov | in progress | | -|`createRadialGradient`| Function | Vadim Voronov | in progress | | -|`createConicGradient`| Function | Vadim Voronov | in progress | | -|`createImageData`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX & https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | -|`getImageData`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | -|`getPixelMap`| Function | Vadim Voronov | in progress | | -|`putImageData`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`getLineDash`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | -|`setLineDash`| Function | Vadim Voronov | done | | -|`clearRect`| Function | Vadim Voronov | done | | -|`fillRect`| Function | Vadim Voronov | done | | -|`strokeRect`| Function | Vadim Voronov | done | | -|`restore`| Function | Vadim Voronov | done | | -|`save`| Function | Vadim Voronov | done | | -|`fillText`| Function | Vadim Voronov | done | | -|`measureText`| Function | Vadim Voronov | in progress | | -|`strokeText`| Function | Vadim Voronov | done | | -|`getTransform`| Function | Vadim Voronov | in progress | | -|`resetTransform`| Function | Vadim Voronov | done | | -|`rotate`| Function | Vadim Voronov | done | | -|`scale`| Function | Vadim Voronov | done | | -|`setTransform`| Function | Vadim Voronov | done | | -|`transform`| Function | Vadim Voronov | done | | -|`translate`| Function | Vadim Voronov | done | | -|`setPixelMap`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`transferFromImageBitmap`| Function | Vadim Voronov | in progress | | -|`saveLayer`| Function | Vadim Voronov | done | | -|`restoreLayer`| Function | Vadim Voronov | done | | -|`reset`| Function | Vadim Voronov | done | | -|`getGlobalAlpha`| Function | Vadim Voronov | in progress | | -|`setGlobalAlpha`| Function | Vadim Voronov | done | | -|`getGlobalCompositeOperation`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | -|`setGlobalCompositeOperation`| Function | Vadim Voronov | done | | -|`setFillStyle`| Function | Vadim Voronov | in progress | | -|`setStrokeStyle`| Function | Vadim Voronov | in progress | | -|`getFilter`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | -|`setFilter`| Function | Vadim Voronov | done | | -|`getImageSmoothingEnabled`| Function | Vadim Voronov | in progress | | -|`setImageSmoothingEnabled`| Function | Vadim Voronov | in progress | | -|`getImageSmoothingQuality`| Function | Vadim Voronov | in progress | | -|`setImageSmoothingQuality`| Function | Vadim Voronov | in progress | | -|`getLineCap`| Function | Vadim Voronov | in progress | | -|`setLineCap`| Function | Vadim Voronov | in progress | | -|`getLineDashOffset`| Function | Vadim Voronov | in progress | | -|`setLineDashOffset`| Function | Vadim Voronov | in progress | | -|`getLineJoin`| Function | Vadim Voronov | in progress | | -|`setLineJoin`| Function | Vadim Voronov | in progress | | -|`getLineWidth`| Function | Vadim Voronov | in progress | | -|`setLineWidth`| Function | Vadim Voronov | in progress | | -|`getMiterLimit`| Function | Vadim Voronov | in progress | | -|`setMiterLimit`| Function | Vadim Voronov | in progress | | -|`getShadowBlur`| Function | Vadim Voronov | in progress | | -|`setShadowBlur`| Function | Vadim Voronov | in progress | | -|`getShadowColor`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | -|`setShadowColor`| Function | Vadim Voronov | in progress | | -|`getShadowOffsetX`| Function | Vadim Voronov | in progress | | -|`setShadowOffsetX`| Function | Vadim Voronov | in progress | | -|`getShadowOffsetY`| Function | Vadim Voronov | in progress | | -|`setShadowOffsetY`| Function | Vadim Voronov | in progress | | -|`getDirection`| Function | Vadim Voronov | in progress | | -|`setDirection`| Function | Vadim Voronov | in progress | | -|`getFont`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | -|`setFont`| Function | Vadim Voronov | in progress | | -|`getTextAlign`| Function | Vadim Voronov | in progress | | -|`setTextAlign`| Function | Vadim Voronov | in progress | | -|`getTextBaseline`| Function | Vadim Voronov | in progress | | -|`setTextBaseline`| Function | Vadim Voronov | in progress | | -|*CanvasRenderingContext2D*| *Class* | Vadim Voronov| blocked| | -|`toDataURL`| Function |Vadim Voronov| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|`startImageAnalyzer`| Function |Vadim Voronov| done | | -|`stopImageAnalyzer`| Function | Vadim Voronov| done| | -|`onOnAttach`| Function | Vadim Voronov | in progress | | -|`offOnAttach`| Function | Vadim Voronov | in progress | | -|`onOnDetach`| Function | Vadim Voronov | in progress | | -|`offOnDetach`| Function | Vadim Voronov | in progress | | -|`getHeight`| Function |Vadim Voronov| done | | -|`getWidth`| Function |Vadim Voronov| done | | -|*DrawingRenderingContext*| *Class* |Vadim Voronov| blocked | | -|`invalidate`| Function |Vadim Voronov| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | -|*ChildrenMainSize*| *Class* | Morozov Sergey | in progress | | -|`splice`| Function | Morozov Sergey | in progress | | -|`update`| Function | Morozov Sergey | in progress | | -|`getChildDefaultSize`| Function | Morozov Sergey | in progress | | -|*ImageAnalyzerController*| *Class* |Vadim Voronov| blocked | | -|`getImageAnalyzerSupportTypes`| Function |Vadim Voronov| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | -|*ListScroller*| *Class* |Morozov Sergey | blocked | | -|`getItemRectInGroup`| Function |Morozov Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | -|`scrollToItemInGroup`| Function |Morozov Sergey | done | | -|`closeAllSwipeActions`| Function |Morozov Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | -|`getVisibleListContentInfo`| Function |Morozov Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | -|*NavPathStack*| *Class* | Morozov Sergey |in progress | | -|`pushPath`| Function | Morozov Sergey |in progress | | -|`pushDestination`| Function | Morozov Sergey |in progress | | -|`pushPathByName`| Function | Morozov Sergey |in progress | | -|`pushDestinationByName`| Function | Morozov Sergey |in progress | | -|`replacePath`| Function | Morozov Sergey |in progress | | -|`replaceDestination`| Function | Morozov Sergey |in progress | | -|`replacePathByName`| Function | Morozov Sergey |in progress | | -|`removeByIndexes`| Function | Morozov Sergey |in progress | | -|`removeByName`| Function | Morozov Sergey |in progress | | -|`removeByNavDestinationId`| Function | Morozov Sergey |in progress | | -|`pop`| Function | Morozov Sergey |in progress | | -|`popToName`| Function | Morozov Sergey |in progress | | -|`popToIndex`| Function | Morozov Sergey |in progress | | -|`moveToTop`| Function | Morozov Sergey |in progress | | -|`moveIndexToTop`| Function | Morozov Sergey |in progress | | -|`clear`| Function | Morozov Sergey |in progress | | -|`getAllPathName`| Function | Morozov Sergey |in progress | | -|`getParamByIndex`| Function | Morozov Sergey |in progress | | -|`getParamByName`| Function | Morozov Sergey |in progress | | -|`getIndexByName`| Function | Morozov Sergey |in progress | | -|`getParent`| Function | Morozov Sergey |in progress | | -|`size`| Function | Morozov Sergey |in progress | | -|`disableAnimation`| Function | Morozov Sergey |in progress | | -|`setInterception`| Function | Morozov Sergey |in progress | | -|*RichEditorBaseController*| *Class*|Dudkin Sergey| in progress| | -|`getCaretOffset`| Function|Dudkin Sergey| in progress| | -|`setCaretOffset`| Function|Dudkin Sergey| in progress| | -|`closeSelectionMenu`| Function|Dudkin Sergey| in progress| | -|`getTypingStyle`| Function|Dudkin Sergey| in progress| | -|`setTypingStyle`| Function|Dudkin Sergey| in progress| | -|`setSelection`| Function|Dudkin Sergey| in progress| | -|`isEditing`| Function|Dudkin Sergey| in progress| | -|`stopEditing`| Function|Dudkin Sergey| in progress| | -|`getLayoutManager`| Function|Dudkin Sergey| in progress| | -|`getPreviewText`| Function|Dudkin Sergey| in progress| | -|*RichEditorController*| *Class* |Dudkin Sergey| blocked| | -|`addTextSpan`| Function |Dudkin Sergey| done| | -|`addImageSpan`| Function |Dudkin Sergey| blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9UR | -|`addBuilderSpan`| Function | Dudkin Sergey| blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | -|`addSymbolSpan`| Function | Dudkin Sergey| done| | -|`updateSpanStyle`| Function | Dudkin Sergey| done| | -|`updateParagraphStyle`| Function | Dudkin Sergey| done| | -|`deleteSpans`| Function |Dudkin Sergey| done| | -|`getSpans`| Function |Dudkin Sergey| done| | -|`getParagraphs`| Function |Dudkin Sergey| blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IB1LVZ | -|`getSelection`| Function |Dudkin Sergey| done| | -|`fromStyledString`| Function | Dudkin Sergey| done| | -|`toStyledString`| Function | Dudkin Sergey| done| | -|*RichEditorStyledStringController*| *Class* |Dudkin Sergey| in progress| | -|`setStyledString`| Function |Dudkin Sergey| in progress| | -|`getStyledString`| Function | Dudkin Sergey| in progress| | -|`getSelection`| Function |Dudkin Sergey| in progress| | -|`onContentChanged`| Function | Dudkin Sergey| in progress| | -|*PatternLockController*| *Class* |Dmitry A Smirnov| done| | -|`reset`| Function |Dmitry A Smirnov| done| | -|`setChallengeResult`| Function |Dmitry A Smirnov| done| | |*Video*| *Component* | Erokhin Ilya | blocked | | |`setVideoOptions`| Function | Erokhin Ilya | blocked AceEngine| https://gitee.com/openharmony/arkui_ace_engine/issues/IAZ229 | |`muted`| Function | Erokhin Ilya | done | | @@ -1530,87 +1314,8 @@ |`onStop`| Function | Erokhin Ilya | done | | |`enableAnalyzer`| Function | Erokhin Ilya | done | | |`analyzerConfig`| Function | Erokhin Ilya | blocked AceEngine| https://gitee.com/openharmony/arkui_ace_engine/issues/IAZ229 | -|*VideoController*| *Class* | Erokhin Ilya | done | | -|`start`| Function | Erokhin Ilya | done | | -|`pause`| Function | Erokhin Ilya | done | | -|`stop`| Function | Erokhin Ilya | done | | -|`setCurrentTime`| Function | Erokhin Ilya | done| | -|`requestFullscreen`| Function | Erokhin Ilya | done | | -|`exitFullscreen`| Function | Erokhin Ilya | done | | -|`reset`| Function | Erokhin Ilya | done | | -|*WebKeyboardController*| *Class* | Erokhin Ilya | in progress | | -|`insertText`| Function | Erokhin Ilya | in progress | | -|`deleteForward`| Function | Erokhin Ilya | in progress | | -|`deleteBackward`| Function | Erokhin Ilya | in progress | | -|`sendFunctionKey`| Function | Erokhin Ilya | in progress | | -|`close`| Function | Erokhin Ilya | in progress | | -|*FullScreenExitHandler*| *Class* | Erokhin Ilya | in progress | | -|`exitFullScreen`| Function | Erokhin Ilya | in progress | | -|*FileSelectorParam*| *Class* | Erokhin Ilya | in progress | | -|`getTitle`| Function | Erokhin Ilya | in progress | | -|`getMode`| Function | Erokhin Ilya | in progress | | -|`getAcceptType`| Function | Erokhin Ilya | in progress | | -|`isCapture`| Function | Erokhin Ilya | in progress | | -|*JsResult*| *Class* | Erokhin Ilya | in progress | | -|`handleCancel`| Function | Erokhin Ilya | in progress | | -|`handleConfirm`| Function | Erokhin Ilya | in progress | | -|`handlePromptConfirm`| Function | Erokhin Ilya | in progress | | -|*FileSelectorResult*| *Class* | Erokhin Ilya | in progress | | -|`handleFileList`| Function | Erokhin Ilya | in progress | | -|*HttpAuthHandler*| *Class* | Erokhin Ilya | in progress | | -|`confirm`| Function | Erokhin Ilya | in progress | | -|`cancel`| Function | Erokhin Ilya | in progress | | -|`isHttpAuthInfoSaved`| Function | Erokhin Ilya | in progress | | -|*SslErrorHandler*| *Class* | Erokhin Ilya | in progress | | -|`handleConfirm`| Function | Erokhin Ilya | in progress | | -|`handleCancel`| Function | Erokhin Ilya | in progress | | -|*ClientAuthenticationHandler*| *Class* | Erokhin Ilya | in progress | | -|`confirm`| Function | Erokhin Ilya | in progress | | -|`cancel`| Function | Erokhin Ilya | in progress | | -|`ignore`| Function | Erokhin Ilya | in progress | | -|*PermissionRequest*| *Class* | Erokhin Ilya | in progress | | -|`deny`| Function | Erokhin Ilya | in progress | | -|`getOrigin`| Function | Erokhin Ilya | in progress | | -|`getAccessibleResource`| Function | Erokhin Ilya | in progress | | -|`grant`| Function | Erokhin Ilya | in progress | | -|*ScreenCaptureHandler*| *Class* | Erokhin Ilya | in progress | | -|`getOrigin`| Function | Erokhin Ilya | in progress | | -|`grant`| Function | Erokhin Ilya | in progress | | -|`deny`| Function | Erokhin Ilya | in progress | | -|*DataResubmissionHandler*| *Class* | Erokhin Ilya | in progress | | -|`resend`| Function | Erokhin Ilya | in progress | | -|`cancel`| Function | Erokhin Ilya | in progress | | -|*ControllerHandler*| *Class* | Erokhin Ilya | in progress | | -|`setWebController`| Function | Erokhin Ilya | in progress | | -|*WebContextMenuParam*| *Class* | Erokhin Ilya | in progress | | -|`x`| Function | Erokhin Ilya | in progress | | -|`y`| Function | Erokhin Ilya | in progress | | -|`getLinkUrl`| Function | Erokhin Ilya | in progress | | -|`getUnfilteredLinkUrl`| Function | Erokhin Ilya | in progress | | -|`getSourceUrl`| Function | Erokhin Ilya | in progress | | -|`existsImageContents`| Function | Erokhin Ilya | in progress | | -|`getMediaType`| Function | Erokhin Ilya | in progress | | -|`getSelectionText`| Function | Erokhin Ilya | in progress | | -|`getSourceType`| Function | Erokhin Ilya | in progress | | -|`getInputFieldType`| Function | Erokhin Ilya | in progress | | -|`isEditable`| Function | Erokhin Ilya | in progress | | -|`getEditStateFlags`| Function | Erokhin Ilya | in progress | | -|`getPreviewWidth`| Function | Erokhin Ilya | in progress | | -|`getPreviewHeight`| Function | Erokhin Ilya | in progress | | -|*WebContextMenuResult*| *Class* | Erokhin Ilya | in progress | | -|`closeContextMenu`| Function | Erokhin Ilya | in progress | | -|`copyImage`| Function | Erokhin Ilya | in progress | | -|`copy`| Function | Erokhin Ilya | in progress | | -|`paste`| Function | Erokhin Ilya | in progress | | -|`cut`| Function | Erokhin Ilya | in progress | | -|`selectAll`| Function | Erokhin Ilya | in progress | | -|*ConsoleMessage*| *Class* | Erokhin Ilya | in progress | | -|`getMessage`| Function | Erokhin Ilya | in progress | | -|`getSourceId`| Function | Erokhin Ilya | in progress | | -|`getLineNumber`| Function | Erokhin Ilya | in progress | | -|`getMessageLevel`| Function | Erokhin Ilya | in progress | | |*Web*| *Component* | Erokhin Ilya | in progress | | -|`setWebOptions`| Function | Erokhin Ilya | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`setWebOptions`| Function | Erokhin Ilya | in progress| https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | |`javaScriptAccess`| Function | Erokhin Ilya | done | | |`fileAccess`| Function | Erokhin Ilya | done | | |`onlineImageAccess`| Function | Erokhin Ilya | done | | @@ -1619,7 +1324,7 @@ |`mixedMode`| Function | Erokhin Ilya | done | | |`zoomAccess`| Function | Erokhin Ilya | done | | |`geolocationAccess`| Function | Erokhin Ilya | done | | -|`javaScriptProxy`| Function | Erokhin Ilya | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX & https://gitee.com/nikolay-igotti/idlize/issues/IAU9OV | +|`javaScriptProxy`| Function | Erokhin Ilya | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9OV | |`password`| Function | Erokhin Ilya | done | | |`cacheMode`| Function | Erokhin Ilya | done | | |`darkMode`| Function | Erokhin Ilya | done | | @@ -1716,7 +1421,7 @@ |`onNativeEmbedVisibilityChange`| Function | Erokhin Ilya | done | | |`onNativeEmbedGestureEvent`| Function | Erokhin Ilya | in progress | dependency on Ark_EventResult & Ark_Function | |`copyOptions`| Function | Erokhin Ilya | done | | -|`onOverrideUrlLoading`| Function | Erokhin Ilya | blocked | https://gitee.com/nikolay-igotti/idlize/issues/IAPDBZ | +|`onOverrideUrlLoading`| Function | Erokhin Ilya | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAPDBZ | |`textAutosizing`| Function | Erokhin Ilya | done | | |`enableNativeMediaPlayer`| Function | Erokhin Ilya | done | | |`enableSmoothDragResize`| Function | Erokhin Ilya | done | | @@ -1724,32 +1429,537 @@ |`onRenderProcessResponding`| Function | Erokhin Ilya | done | | |`selectionMenuOptions`| Function | Erokhin Ilya | in progress | | |`onViewportFitChanged`| Function | Erokhin Ilya | done | | -|`onInterceptKeyboardAttach`| Function | Erokhin Ilya | blocked | dependency on Ark_CustomObject & Ark_WebKeyboardController | +|`onInterceptKeyboardAttach`| Function | Erokhin Ilya | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAPDBZ| |`onAdsBlocked`| Function | Erokhin Ilya | in progress | | |`keyboardAvoidMode`| Function | Erokhin Ilya | done | | |`editMenuOptions`| Function | Erokhin Ilya | in progress | | |`enableHapticFeedback`| Function | Erokhin Ilya | done | | |`registerNativeEmbedRule`| Function | Erokhin Ilya | done | | -|*WebController*| *Class* | Erokhin Ilya | in progress | | -|`onInactive`| Function | Erokhin Ilya | done | | -|`onActive`| Function | Erokhin Ilya | done | | -|`zoom`| Function | Erokhin Ilya | done | | -|`clearHistory`| Function | Erokhin Ilya | done | | -|`runJavaScript`| Function | Erokhin Ilya | in progress | | -|`loadData`| Function | Erokhin Ilya | done | | -|`loadUrl`| Function | Erokhin Ilya | done | | -|`refresh`| Function | Erokhin Ilya | done | | -|`stop`| Function | Erokhin Ilya | done | | -|`registerJavaScriptProxy`| Function | Erokhin Ilya | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9OV | -|`deleteJavaScriptRegister`| Function | Erokhin Ilya | done | | -|`getHitTest`| Function | Erokhin Ilya | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | -|`requestFocus`| Function | Erokhin Ilya | done | | -|`accessBackward`| Function | Erokhin Ilya | done | | -|`accessForward`| Function | Erokhin Ilya | done | | -|`accessStep`| Function | Erokhin Ilya | done | | -|`backward`| Function | Erokhin Ilya | done | | -|`forward`| Function | Erokhin Ilya | done | | -|`getCookieManager`| Function | Erokhin Ilya | done | | +|`bindSelectionMenu`| Function | Erokhin Ilya | in progress | | +|*WindowScene*| *Component* | Spirin Andrey | in progress | | +|`setWindowSceneOptions`| Function | Spirin Andrey | in progress | | +|`attractionEffect`| Function | Spirin Andrey | in progress | | +|*XComponent*| *Component* | | | | +|`setXComponentOptions`| Function | | | | +|`onLoad`| Function | | | | +|`onDestroy`| Function | | | | +|`enableAnalyzer`| Function | | | | +|`enableSecure`| Function | | | | +|*SideBarContainer*| *Component* |Dmitry A Smirnov|blocked| | +|`setSideBarContainerOptions`| Function |Dmitry A Smirnov|done| | +|`showSideBar`| Function |Dmitry A Smirnov|done| | +|`controlButton`| Function |Dmitry A Smirnov| blocked IDL | 1.parse PixelMap from CustomObject https://gitee.com/nikolay-igotti/idlize/issues/IAU9UR 2. default values https://gitee.com/openharmony/arkui_ace_engine/issues/IAW40V | +|`showControlButton`| Function |Dmitry A Smirnov|done| | +|`onChange`| Function |Dmitry A Smirnov|done| | +|`sideBarWidth`| Function |Dmitry A Smirnov|done| | +|`minSideBarWidth`| Function |Dmitry A Smirnov|done| | +|`maxSideBarWidth`| Function |Dmitry A Smirnov|done| | +|`autoHide`| Function |Dmitry A Smirnov|done| | +|`sideBarPosition`| Function |Dmitry A Smirnov|done| | +|`divider`| Function |Dmitry A Smirnov|done| | +|`minContentWidth`| Function |Dmitry A Smirnov|done| | +|*RemoteWindow*| *Component* | Spirin Andrey | in progress | | +|`setRemoteWindowOptions`| Function | Spirin Andrey | in progress | | +|*WaterFlow*| *Component* | Kovalev Sergey | in progress | | +|`setWaterFlowOptions`| Function | Kovalev Sergey |in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`columnsTemplate`| Function | Kovalev Sergey | done | | +|`itemConstraintSize`| Function | Kovalev Sergey | done | | +|`rowsTemplate`| Function | Kovalev Sergey | done | | +|`columnsGap`| Function | Kovalev Sergey | done | | +|`rowsGap`| Function |Kovalev Sergey | done | | +|`layoutDirection`| Function |Kovalev Sergey | done | | +|`nestedScroll`| Function | Kovalev Sergey | done | | +|`enableScrollInteraction`| Function | Kovalev Sergey | done | | +|`friction`| Function | Kovalev Sergey | done | | +|`cachedCount`| Function |Kovalev Sergey | done | | +|`onReachStart`| Function | Kovalev Sergey | in progress | | +|`onReachEnd`| Function | Kovalev Sergey | in progress | | +|`onScrollFrameBegin`| Function | Kovalev Sergey | in progress | | +|`onScrollIndex`| Function | Kovalev Sergey | in progress | | +|*UIExtensionComponent*| *Component* | | | +|`setUIExtensionComponentOptions`| Function | | | | +|`onRemoteReady`| Function | | | | +|`onReceive`| Function | | | | +|`onResult`| Function | | | | +|`onRelease`| Function | | | | +|`onError`| Function | | | | +|`onTerminated`| Function | | | | +|*LinearIndicator*| *Component* | Kovalev Sergey | in progress | | +|`setLinearIndicatorOptions`| Function | Kovalev Sergey | in progress | | +|`indicatorStyle`| Function | Kovalev Sergey | in progress | | +|`indicatorLoop`| Function | Kovalev Sergey | in progress | | +|`onChange`| Function | Kovalev Sergey | in progress | | +|*ActionSheet*| *Class* | | | +|`show`| Function | | | +|*AlertDialog*| *Class* | | | +|`show`| Function | | | +|*CalendarController*| *Class* |Maksimov Nikita | in progress | | +|`backToToday`| Function |Maksimov Nikita | in progress | | +|`goTo`| Function |Maksimov Nikita | in progress | | +|*CalendarPickerDialog*| *Class* | | | | +|`show`| Function | | | | +|*CanvasGradient*| *Class* | | | | +|`addColorStop`| Function | | | | +|*CanvasPath*| *Class* | Lobah Mikhail | in progress | | +|`arc`| Function | Lobah Mikhail | in progress | | +|`arcTo`| Function | Lobah Mikhail | in progress | | +|`bezierCurveTo`| Function | Lobah Mikhail | in progress | | +|`closePath`| Function | Lobah Mikhail | in progress | | +|`ellipse`| Function | Lobah Mikhail | in progress | | +|`lineTo`| Function | Lobah Mikhail | in progress | | +|`moveTo`| Function | Lobah Mikhail | in progress | | +|`quadraticCurveTo`| Function | Lobah Mikhail | in progress | | +|`rect`| Function | Lobah Mikhail | in progress | | +|*Path2D*| *Class* | | | | +|`addPath`| Function | | | | +|*CanvasPattern*| *Class* | Vadim Voronov | in progress | | +|`setTransform`| Function | Vadim Voronov | in progress | | +|*ImageBitmap*| *Class* | Pavelyev Ivan | in progress | | +|`close`| Function | Pavelyev Ivan | in progress | | +|`getHeight`| Function | Pavelyev Ivan | in progress | | +|`getWidth`| Function | Pavelyev Ivan | in progress | | +|*CanvasRenderer*| *Class* | Vadim Voronov | in progress | | +|`drawImage`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB4BTA | +|`beginPath`| Function | Vadim Voronov | done | | +|`clip`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO | +|`fill`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO | +|`stroke`| Function | Vadim Voronov | in progress | | +|`createLinearGradient`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`createPattern`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`createRadialGradient`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`createConicGradient`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`createImageData`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB4BTA & https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`getImageData`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`getPixelMap`| Function | Vadim Voronov | in progress | | +|`putImageData`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB4BTA | +|`getLineDash`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | +|`setLineDash`| Function | Vadim Voronov | done | | +|`clearRect`| Function | Vadim Voronov | done | | +|`fillRect`| Function | Vadim Voronov | done | | +|`strokeRect`| Function | Vadim Voronov | done | | +|`restore`| Function | Vadim Voronov | done | | +|`save`| Function | Vadim Voronov | done | | +|`fillText`| Function | Vadim Voronov | done | | +|`measureText`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`strokeText`| Function | Vadim Voronov | done | | +|`getTransform`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`resetTransform`| Function | Vadim Voronov | done | | +|`rotate`| Function | Vadim Voronov | done | | +|`scale`| Function | Vadim Voronov | done | | +|`setTransform`| Function | Vadim Voronov | in progress | | +|`transform`| Function | Vadim Voronov | done | | +|`translate`| Function | Vadim Voronov | done | | +|`setPixelMap`| Function | Vadim Voronov | in progress | | +|`transferFromImageBitmap`| Function | Vadim Voronov | in progress | | +|`saveLayer`| Function | Vadim Voronov | done | | +|`restoreLayer`| Function | Vadim Voronov | done | | +|`reset`| Function | Vadim Voronov | done | | +|`getGlobalAlpha`| Function | Vadim Voronov | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setGlobalAlpha`| Function | Vadim Voronov | done | | +|`getGlobalCompositeOperation`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR & https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setGlobalCompositeOperation`| Function | Vadim Voronov | done | | +|`setFillStyle`| Function | Vadim Voronov | in progress | | +|`setStrokeStyle`| Function | Vadim Voronov | in progress | | +|`getFilter`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | +|`setFilter`| Function | Vadim Voronov | done | | +|`getImageSmoothingEnabled`| Function | Vadim Voronov | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setImageSmoothingEnabled`| Function | Vadim Voronov | done | | +|`getImageSmoothingQuality`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO & https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 & https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setImageSmoothingQuality`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO | +|`getLineCap`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO & https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 & https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setLineCap`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO | +|`getLineDashOffset`| Function | Vadim Voronov | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setLineDashOffset`| Function | Vadim Voronov | done | | +|`getLineJoin`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO & https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 & https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setLineJoin`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO | +|`getLineWidth`| Function | Vadim Voronov | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setLineWidth`| Function | Vadim Voronov | done | | +|`getMiterLimit`| Function | Vadim Voronov | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setMiterLimit`| Function | Vadim Voronov | done | | +|`getShadowBlur`| Function | Vadim Voronov | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setShadowBlur`| Function | Vadim Voronov | done | | +|`getShadowColor`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | +|`setShadowColor`| Function | Vadim Voronov | done | | +|`getShadowOffsetX`| Function | Vadim Voronov | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setShadowOffsetX`| Function | Vadim Voronov | done | | +|`getShadowOffsetY`| Function | Vadim Voronov | blocked AceEngine | https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setShadowOffsetY`| Function | Vadim Voronov | done | | +|`getDirection`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO & https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 & https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setDirection`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO | +|`getFont`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR & https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setFont`| Function | Vadim Voronov | in progress | | +|`getTextAlign`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO & https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 & https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setTextAlign`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO | +|`getTextBaseline`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO & https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 & https://gitee.com/openharmony/arkui_ace_engine/issues/IB3UUE | +|`setTextBaseline`| Function | Vadim Voronov | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB45FO | +|*CanvasRenderingContext2D*| *Class* | Vadim Voronov| in progress| | +|`toDataURL`| Function |Vadim Voronov| in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`startImageAnalyzer`| Function |Vadim Voronov| done | | +|`stopImageAnalyzer`| Function | Vadim Voronov| done| | +|`onOnAttach`| Function | Vadim Voronov | in progress | | +|`offOnAttach`| Function | Vadim Voronov | in progress | | +|`onOnDetach`| Function | Vadim Voronov | in progress | | +|`offOnDetach`| Function | Vadim Voronov | in progress | | +|`getHeight`| Function |Vadim Voronov| done | | +|`getWidth`| Function |Vadim Voronov| done | | +|*DrawingRenderingContext*| *Class* |Vadim Voronov| in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|`invalidate`| Function |Vadim Voronov| in progress | https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX | +|*ICurve*| *Class* | | | | +|`interpolate`| Function | | | | +|*DrawModifier*| *Class* | | | | +|`drawBehind`| Function | | | | +|`drawContent`| Function | | | | +|`drawFront`| Function | | | | +|`invalidate`| Function | | | | +|*TransitionEffect*| *Class* | | | | +|`translate`| Function | | | | +|`rotate`| Function | | | | +|`scale`| Function | | | | +|`opacity`| Function | | | | +|`move`| Function | | | | +|`asymmetric`| Function | | | | +|`animation`| Function | | | | +|`combine`| Function | | | | +|*PixelMapMock*| *Class* | | | | +|`release`| Function | | | | +|*ProgressMask*| *Class* | | | | +|`updateProgress`| Function | | | | +|`updateColor`| Function | | | | +|`enableBreathingAnimation`| Function | | | | +|*AttributeModifier*| *Class* | | | | +|`applyNormalAttribute`| Function | | | | +|`applyPressedAttribute`| Function | | | | +|`applyFocusedAttribute`| Function | | | | +|`applyDisabledAttribute`| Function | | | | +|`applySelectedAttribute`| Function | | | | +|*ContentModifier*| *Class* | | | | +|`applyContent`| Function | | | | +|*Measurable*| *Class* | | | | +|`measure`| Function | | | | +|`getMargin`| Function | | | | +|`getPadding`| Function | | | | +|`getBorderWidth`| Function | | | | +|*View*| *Class* | | | | +|`create`| Function | | | | +|*TextContentControllerBase*| *Class* | | | | +|`getCaretOffset`| Function | | | | +|`getTextContentRect`| Function | | | | +|`getTextContentLineCount`| Function | | | | +|*DynamicNode*| *Class* | | | | +|`onMove`| Function | | | | +|*ChildrenMainSize*| *Class* | Morozov Sergey | blocked Arkoala | | +|`splice`| Function | Morozov Sergey | in progress | | +|`update`| Function | Morozov Sergey | in progress | | +|`getChildDefaultSize`| Function | Morozov Sergey | blocked Arkoala | https://gitee.com/nikolay-igotti/idlize/issues/IB4QKQ | +|*GestureModifier*| *Class* | | | | +|`applyGesture`| Function | | | | +|*AbstractProperty*| *Class* | | | | +|`get`| Function | | | | +|`set`| Function | | | | +|`info`| Function | | | | +|*IPropertySubscriber*| *Class* | | | | +|`id`| Function | | | | +|`aboutToBeDeleted`| Function | | | | +|*ISinglePropertyChangeSubscriber*| *Class* | | | | +|`hasChanged`| Function | | | | +|*SubscribaleAbstract*| *Class* | | | | +|`notifyPropertyHasChanged`| Function | | | | +|`addOwningProperty`| Function | | | | +|`removeOwningProperty`| Function | | | | +|`removeOwningPropertyById`| Function | | | | +|*ContextMenu*| *Class* | | | | +|`close`| Function | | | | +|*CustomDialogController*| *Class* | Erokhin Ilya | blocked | https://gitee.com/openharmony/interface_sdk-js/issues/IB07SJ & https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | +|`open`| Function | Erokhin Ilya | blocked IDL | https://gitee.com/openharmony/interface_sdk-js/issues/IB07SJ & https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | +|`close`| Function | Erokhin Ilya | blocked IDL| https://gitee.com/openharmony/interface_sdk-js/issues/IB07SJ & https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | +|*DatePickerDialog*| *Class* | | | | +|`show`| Function | | | | +|*PanGestureOptions*| *Class* | | | | +|`setDirection`| Function | | | | +|`setDistance`| Function | | | | +|`setFingers`| Function | | | | +|`getDirection`| Function | | | | +|*ScrollableTargetInfo*| *Class* | | | | +|`isBegin`| Function | | | | +|`isEnd`| Function | | | | +|*EventTargetInfo*| *Class* | | | | +|`getId`| Function | | | | +|*GestureRecognizer*| *Class* | Kovalev Sergey | in progress | +|`getTag`| Function | Kovalev Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | +|`getType`| Function | Kovalev Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`isBuiltIn`| Function | Kovalev Sergey | in progress | +|`setEnabled`| Function | Kovalev Sergey | in progress | +|`isEnabled`| Function | Kovalev Sergey | in progress | +|`getState`| Function | Kovalev Sergey | in progress | +|`getEventTargetInfo`| Function | Kovalev Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`isValid`| Function | Kovalev Sergey | in progress | +|*PanRecognizer*| *Class* | | | | +|`getPanGestureOptions`| Function | | | | +|*ImageAnalyzerController*| *Class* |Vadim Voronov| blocked | | +|`getImageAnalyzerSupportTypes`| Function |Vadim Voronov| blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | +|*ListScroller*| *Class* |Morozov Sergey | blocked | | +|`getItemRectInGroup`| Function |Morozov Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`scrollToItemInGroup`| Function |Morozov Sergey | done | | +|`closeAllSwipeActions`| Function |Morozov Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`getVisibleListContentInfo`| Function |Morozov Sergey | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|*Matrix2D*| *Class* | | | | +|`identity`| Function | | | | +|`invert`| Function | | | | +|`multiply`| Function | | | | +|`rotate`| Function | | | | +|`translate`| Function | | | | +|`scale`| Function | | | | +|`getScaleX`| Function | | | | +|`setScaleX`| Function | | | | +|`getRotateY`| Function | | | | +|`setRotateY`| Function | | | | +|`getRotateX`| Function | | | | +|`setRotateX`| Function | | | | +|`getScaleY`| Function | | | | +|`setScaleY`| Function | | | | +|`getTranslateX`| Function | | | | +|`setTranslateX`| Function | | | | +|`getTranslateY`| Function | | | | +|`setTranslateY`| Function | | | | +|*NavDestinationContext*| *Class* | | | | +|`getConfigInRouteMap`| Function | | | | +|`setPathInfo`| Function | | | | +|`setPathStack`| Function | | | | +|`getNavDestinationId`| Function | | | | +|`setNavDestinationId`| Function | | | | +|*NavPathStack*| *Class* | Morozov Sergey |in progress | | +|`pushPath`| Function | Morozov Sergey |in progress | | +|`pushDestination`| Function | Morozov Sergey |in progress | | +|`pushPathByName`| Function | Morozov Sergey |in progress | | +|`pushDestinationByName`| Function | Morozov Sergey |in progress | | +|`replacePath`| Function | Morozov Sergey |in progress | | +|`replaceDestination`| Function | Morozov Sergey |in progress | | +|`replacePathByName`| Function | Morozov Sergey |in progress | | +|`removeByIndexes`| Function | Morozov Sergey |in progress | | +|`removeByName`| Function | Morozov Sergey |in progress | | +|`removeByNavDestinationId`| Function | Morozov Sergey |in progress | | +|`pop`| Function | Morozov Sergey |in progress | | +|`popToName`| Function | Morozov Sergey |in progress | | +|`popToIndex`| Function | Morozov Sergey |in progress | | +|`moveToTop`| Function | Morozov Sergey |in progress | | +|`moveIndexToTop`| Function | Morozov Sergey |in progress | | +|`clear`| Function | Morozov Sergey |in progress | | +|`getAllPathName`| Function | Morozov Sergey |in progress | | +|`getParamByIndex`| Function | Morozov Sergey |in progress | | +|`getParamByName`| Function | Morozov Sergey |in progress | | +|`getIndexByName`| Function | Morozov Sergey |in progress | | +|`getParent`| Function | Morozov Sergey |in progress | | +|`size`| Function | Morozov Sergey |in progress | | +|`disableAnimation`| Function | Morozov Sergey |in progress | | +|`setInterception`| Function | Morozov Sergey |in progress | | +|*NavigationTransitionProxy*| *Class* | | | | +|`finishTransition`| Function | | | | +|`cancelTransition`| Function | | | | +|`updateTransition`| Function | | | | +|`setFrom`| Function | | | | +|`setTo`| Function | | | | +|`getIsInteractive`| Function | | | | +|`setIsInteractive`| Function | | | | +|*PatternLockController*| *Class* |Dmitry A Smirnov| done| | +|`reset`| Function |Dmitry A Smirnov| done| | +|`setChallengeResult`| Function |Dmitry A Smirnov| done| | +|*RichEditorBaseController*| *Class*|Dudkin Sergey| in progress| | +|`getCaretOffset`| Function|Dudkin Sergey| in progress| | +|`setCaretOffset`| Function|Dudkin Sergey| in progress| | +|`closeSelectionMenu`| Function|Dudkin Sergey| in progress| | +|`getTypingStyle`| Function|Dudkin Sergey| in progress| | +|`setTypingStyle`| Function|Dudkin Sergey| in progress| | +|`setSelection`| Function|Dudkin Sergey| in progress| | +|`isEditing`| Function|Dudkin Sergey| in progress| | +|`stopEditing`| Function|Dudkin Sergey| in progress| | +|`getLayoutManager`| Function|Dudkin Sergey| in progress| | +|`getPreviewText`| Function|Dudkin Sergey| in progress| | +|*RichEditorController*| *Class* |Dudkin Sergey| blocked| | +|`addTextSpan`| Function |Dudkin Sergey| done| | +|`addImageSpan`| Function |Dudkin Sergey| blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9UR | +|`addBuilderSpan`| Function | Dudkin Sergey| blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | +|`addSymbolSpan`| Function | Dudkin Sergey| done| | +|`updateSpanStyle`| Function | Dudkin Sergey| done| | +|`updateParagraphStyle`| Function | Dudkin Sergey| done| | +|`deleteSpans`| Function |Dudkin Sergey| done| | +|`getSpans`| Function |Dudkin Sergey| done| | +|`getParagraphs`| Function |Dudkin Sergey| blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IB1LVZ | +|`getSelection`| Function |Dudkin Sergey| done| | +|`fromStyledString`| Function | Dudkin Sergey| done| | +|`toStyledString`| Function | Dudkin Sergey| done| | +|*RichEditorStyledStringController*| *Class* |Dudkin Sergey| in progress| | +|`setStyledString`| Function |Dudkin Sergey| in progress| | +|`getStyledString`| Function | Dudkin Sergey| in progress| | +|`getSelection`| Function |Dudkin Sergey| in progress| | +|`onContentChanged`| Function | Dudkin Sergey| in progress| | +|*Scroller*| *Class* | Erokhin Ilya | blocked | | +|`scrollTo`| Function | Erokhin Ilya | done | | +|`scrollEdge`| Function | Erokhin Ilya | done | | +|`fling`| Function | Erokhin Ilya | done | | +|`scrollPage`| Function | Erokhin Ilya | done | | +|`currentOffset`| Function | Erokhin Ilya | blocked IDL |https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0| +|`scrollToIndex`| Function | Erokhin Ilya | in progress |https://gitee.com/nikolay-igotti/idlize/issues/IAU9SX| +|`scrollBy`| Function | Erokhin Ilya | done | | +|`isAtEnd`| Function | Erokhin Ilya | done | | +|`getItemRect`| Function | Erokhin Ilya | blocked IDL |https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0| +|`getItemIndex`| Function | Erokhin Ilya | done | | +|*SearchController*| *Class* |Evstigneev Roman |done | | +|`caretPosition`| Function |Evstigneev Roman | done | | +|`stopEditing`| Function |Evstigneev Roman | done | | +|`setTextSelection`| Function |Evstigneev Roman | done | | +|*SwiperController*| *Class* | Skroba Gleb | done | | +|`showNext`| Function | Skroba Gleb | done | | +|`showPrevious`| Function | Skroba Gleb | done | | +|`changeIndex`| Function | Skroba Gleb | done | | +|`finishAnimation`| Function | Skroba Gleb | in progress | | +|*SwiperContentTransitionProxy*| *Class* | Skroba Gleb | in progress | | +|`finishTransition`| Function | Skroba Gleb | in progress | | +|`getSelectedIndex`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | +|`setSelectedIndex`| Function | Skroba Gleb | in progress | | +|`getIndex`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | +|`setIndex`| Function | Skroba Gleb | in progress | | +|`getPosition`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | +|`setPosition`| Function | Skroba Gleb | in progress | | +|`getMainAxisLength`| Function | Skroba Gleb | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IB0DGR | +|`setMainAxisLength`| Function | Skroba Gleb | in progress | | +|*IndicatorComponentController*| *Class* | Andrey Khudenkikh | in progress | | +|`showNext`| Function | Andrey Khudenkikh | in progress | | +|`showPrevious`| Function | Andrey Khudenkikh | in progress | | +|`changeIndex`| Function | Andrey Khudenkikh | in progress | | +|*TabsController*| *Class* | Skroba Gleb | in progress | +|`changeIndex`| Function | Skroba Gleb | done | | +|`preloadItems`| Function | Skroba Gleb | done | | +|`setTabBarTranslate`| Function | | | | +|`setTabBarOpacity`| Function | | | | +|*TabContentTransitionProxy*| *Class* | | | | +|`finishTransition`| Function | | | | +|`getFrom`| Function | | | | +|`setFrom`| Function | | | | +|`getTo`| Function | | | | +|`setTo`| Function | | | | +|*TextController*| *Class* | | | | +|`closeSelectionMenu`| Function | | | | +|`setStyledString`| Function | | | | +|`getLayoutManager`| Function | | | | +|*TextAreaController*| *Class* | Tuzhilkin Ivan | in progress | | +|`caretPosition`| Function | Tuzhilkin Ivan | in progress | | +|`setTextSelection`| Function | Tuzhilkin Ivan | in progress | | +|`stopEditing`| Function | Tuzhilkin Ivan | in progress | | +|*TextClockController*| *Class* |Pavelyev Ivan|in progress| | +|`start`| Function |Pavelyev Ivan|in progress| | +|`stop`| Function |Pavelyev Ivan|in progress| | +|*TextBaseController*| *Class* | | | | +|`setSelection`| Function | | | | +|`closeSelectionMenu`| Function | | | | +|`getLayoutManager`| Function | | | | +|*TextEditControllerEx*| *Class* | | | | +|`isEditing`| Function | | | | +|`stopEditing`| Function | | | | +|`setCaretOffset`| Function | | | | +|`getCaretOffset`| Function | | | | +|`getPreviewText`| Function | | | | +|*StyledStringController*| *Class* | | | | +|`setStyledString`| Function | | | | +|`getStyledString`| Function | | | | +|*LayoutManager*| *Class* | | | | +|`getLineCount`| Function | | | | +|`getGlyphPositionAtCoordinate`| Function | | | | +|`getLineMetrics`| Function | | | | +|`getRectsForRange`| Function | | | | +|*EditMenuOptions*| *Class* | Erokhin Ilya | in progress | | +|`onCreateMenu`| Function |Erokhin Ilya | in progress | | +|`onMenuItemClick`| Function |Erokhin Ilya | in progress | | +|*TextInputController*| *Class* | Spirin Andrey | in progress | | +|`caretPosition`| Function | Spirin Andrey | in progress | | +|`setTextSelection`| Function | Spirin Andrey | in progress | | +|`stopEditing`| Function | Spirin Andrey | in progress | | +|*TextPickerDialog*| *Class* | | | | +|`show`| Function | | | | +|*TextTimerController*| *Class* |Ekaterina Stepanova| done | | +|`start`| Function |Ekaterina Stepanova| done | | +|`pause`| Function |Ekaterina Stepanova| done | | +|`reset`| Function |Ekaterina Stepanova| done | | +|*TimePickerDialog*| *Class* | | | | +|`show`| Function | | | | +|*VideoController*| *Class* | Erokhin Ilya | done | | +|`start`| Function | Erokhin Ilya | done | | +|`pause`| Function | Erokhin Ilya | done | | +|`stop`| Function | Erokhin Ilya | done | | +|`setCurrentTime`| Function | Erokhin Ilya | done| | +|`requestFullscreen`| Function | Erokhin Ilya | done | | +|`exitFullscreen`| Function | Erokhin Ilya | done | | +|`reset`| Function | Erokhin Ilya | done | | +|*WebKeyboardController*| *Class* | Erokhin Ilya | in progress | | +|`insertText`| Function | Erokhin Ilya | in progress | | +|`deleteForward`| Function | Erokhin Ilya | in progress | | +|`deleteBackward`| Function | Erokhin Ilya | in progress | | +|`sendFunctionKey`| Function | Erokhin Ilya | in progress | | +|`close`| Function | Erokhin Ilya | in progress | | +|*FullScreenExitHandler*| *Class* | Erokhin Ilya | in progress | | +|`exitFullScreen`| Function | Erokhin Ilya | in progress | | +|*FileSelectorParam*| *Class* | Erokhin Ilya | in progress | | +|`getTitle`| Function | Erokhin Ilya | in progress | | +|`getMode`| Function | Erokhin Ilya | in progress | | +|`getAcceptType`| Function | Erokhin Ilya | in progress | | +|`isCapture`| Function | Erokhin Ilya | in progress | | +|*JsResult*| *Class* | Erokhin Ilya | in progress | | +|`handleCancel`| Function | Erokhin Ilya | in progress | | +|`handleConfirm`| Function | Erokhin Ilya | in progress | | +|`handlePromptConfirm`| Function | Erokhin Ilya | in progress | | +|*FileSelectorResult*| *Class* | Erokhin Ilya | in progress | | +|`handleFileList`| Function | Erokhin Ilya | in progress | | +|*HttpAuthHandler*| *Class* | Erokhin Ilya | in progress | | +|`confirm`| Function | Erokhin Ilya | in progress | | +|`cancel`| Function | Erokhin Ilya | in progress | | +|`isHttpAuthInfoSaved`| Function | Erokhin Ilya | in progress | | +|*SslErrorHandler*| *Class* | Erokhin Ilya | in progress | | +|`handleConfirm`| Function | Erokhin Ilya | in progress | | +|`handleCancel`| Function | Erokhin Ilya | in progress | | +|*ClientAuthenticationHandler*| *Class* | Erokhin Ilya | in progress | | +|`confirm`| Function | Erokhin Ilya | in progress | | +|`cancel`| Function | Erokhin Ilya | in progress | | +|`ignore`| Function | Erokhin Ilya | in progress | | +|*PermissionRequest*| *Class* | Erokhin Ilya | in progress | | +|`deny`| Function | Erokhin Ilya | in progress | | +|`getOrigin`| Function | Erokhin Ilya | in progress | | +|`getAccessibleResource`| Function | Erokhin Ilya | in progress | | +|`grant`| Function | Erokhin Ilya | in progress | | +|*ScreenCaptureHandler*| *Class* | Erokhin Ilya | in progress | | +|`getOrigin`| Function | Erokhin Ilya | in progress | | +|`grant`| Function | Erokhin Ilya | in progress | | +|`deny`| Function | Erokhin Ilya | in progress | | +|*DataResubmissionHandler*| *Class* | Erokhin Ilya | in progress | | +|`resend`| Function | Erokhin Ilya | in progress | | +|`cancel`| Function | Erokhin Ilya | in progress | | +|*ControllerHandler*| *Class* | Erokhin Ilya | in progress | | +|`setWebController`| Function | Erokhin Ilya | in progress | | +|*WebContextMenuParam*| *Class* | Erokhin Ilya | in progress | | +|`x`| Function | Erokhin Ilya | in progress | | +|`y`| Function | Erokhin Ilya | in progress | | +|`getLinkUrl`| Function | Erokhin Ilya | in progress | | +|`getUnfilteredLinkUrl`| Function | Erokhin Ilya | in progress | | +|`getSourceUrl`| Function | Erokhin Ilya | in progress | | +|`existsImageContents`| Function | Erokhin Ilya | in progress | | +|`getMediaType`| Function | Erokhin Ilya | in progress | | +|`getSelectionText`| Function | Erokhin Ilya | in progress | | +|`getSourceType`| Function | Erokhin Ilya | in progress | | +|`getInputFieldType`| Function | Erokhin Ilya | in progress | | +|`isEditable`| Function | Erokhin Ilya | in progress | | +|`getEditStateFlags`| Function | Erokhin Ilya | in progress | | +|`getPreviewWidth`| Function | Erokhin Ilya | in progress | | +|`getPreviewHeight`| Function | Erokhin Ilya | in progress | | +|*WebContextMenuResult*| *Class* | Erokhin Ilya | in progress | | +|`closeContextMenu`| Function | Erokhin Ilya | in progress | | +|`copyImage`| Function | Erokhin Ilya | in progress | | +|`copy`| Function | Erokhin Ilya | in progress | | +|`paste`| Function | Erokhin Ilya | in progress | | +|`cut`| Function | Erokhin Ilya | in progress | | +|`selectAll`| Function | Erokhin Ilya | in progress | | +|*ConsoleMessage*| *Class* | Erokhin Ilya | in progress | | +|`getMessage`| Function | Erokhin Ilya | in progress | | +|`getSourceId`| Function | Erokhin Ilya | in progress | | +|`getLineNumber`| Function | Erokhin Ilya | in progress | | +|`getMessageLevel`| Function | Erokhin Ilya | in progress | | |*WebResourceRequest*| *Class* | Erokhin Ilya | in progress | | |`getRequestHeader`| Function | Erokhin Ilya | in progress | | |`getRequestUrl`| Function | Erokhin Ilya | in progress | | @@ -1778,12 +1988,85 @@ |`getErrorCode`| Function | Erokhin Ilya | in progress | | |*JsGeolocation*| *Class* | Erokhin Ilya | in progress | | |`invoke`| Function | Erokhin Ilya | in progress | | -|*EventResult*| *Class* | Erokhin Ilya | in progress | | -|`setGestureEventResult`| Function | Erokhin Ilya | in progress | | |*WebCookie*| *Class* | Erokhin Ilya | done | | |`setCookie`| Function | Erokhin Ilya | done | | |`saveCookie`| Function | Erokhin Ilya | done | | -|*CustomSpan*| *Class* | Politov Mikhail | in progress | | -|`onMeasure`| Function | Politov Mikhail | in progress | | -|`onDraw`| Function | Politov Mikhail | in progress | | -|`invalidate`| Function | Politov Mikhail | in progress | | +|*EventResult*| *Class* | Erokhin Ilya | in progress | | +|`setGestureEventResult`| Function | Erokhin Ilya | in progress | | +|*WebController*| *Class* | Erokhin Ilya | in progress | | +|`onInactive`| Function | Erokhin Ilya | done | | +|`onActive`| Function | Erokhin Ilya | done | | +|`zoom`| Function | Erokhin Ilya | done | | +|`clearHistory`| Function | Erokhin Ilya | done | | +|`runJavaScript`| Function | Erokhin Ilya | in progress | | +|`loadData`| Function | Erokhin Ilya | done | | +|`loadUrl`| Function | Erokhin Ilya | done | | +|`refresh`| Function | Erokhin Ilya | done | | +|`stop`| Function | Erokhin Ilya | done | | +|`registerJavaScriptProxy`| Function | Erokhin Ilya | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAU9OV | +|`deleteJavaScriptRegister`| Function | Erokhin Ilya | done | | +|`getHitTest`| Function | Erokhin Ilya | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IAUYD0 | +|`requestFocus`| Function | Erokhin Ilya | done | | +|`accessBackward`| Function | Erokhin Ilya | done | | +|`accessForward`| Function | Erokhin Ilya | done | | +|`accessStep`| Function | Erokhin Ilya | done | | +|`backward`| Function | Erokhin Ilya | done | | +|`forward`| Function | Erokhin Ilya | done | | +|`getCookieManager`| Function | Erokhin Ilya | done | | +|*XComponentController*| *Class* | | | | +|`getXComponentSurfaceId`| Function | | | | +|`getXComponentContext`| Function | | | | +|`setXComponentSurfaceSize`| Function | | | | +|`setXComponentSurfaceRect`| Function | | | | +|`getXComponentSurfaceRect`| Function | | | | +|`setXComponentSurfaceRotation`| Function | | | | +|`getXComponentSurfaceRotation`| Function | | | | +|`onSurfaceCreated`| Function | | | | +|`onSurfaceChanged`| Function | | | | +|`onSurfaceDestroyed`| Function | | | | +|`startImageAnalyzer`| Function | | | | +|`stopImageAnalyzer`| Function | | | | +|*WaterFlowSections*| *Class* | | | | +|`splice`| Function | | | | +|`push`| Function | | | | +|`update`| Function | | | | +|`values`| Function | | | | +|`length`| Function | | | | +|*UIExtensionProxy*| *Class* | | | | +|`send`| Function | | | | +|`sendSync`| Function | | | | +|`onAsyncReceiverRegister`| Function | | | | +|`onSyncReceiverRegister`| Function | | | | +|`offAsyncReceiverRegister`| Function | | | | +|`offSyncReceiverRegister`| Function | | | | +|*StyledString*| *Class* | | | | +|`getString`| Function | | | | +|`getStyles`| Function | | | | +|`equals`| Function | | | | +|`subStyledString`| Function | | | | +|`fromHtml`| Function | | | | +|`toHtml`| Function | | | | +|`marshalling`| Function | | | | +|`unmarshalling`| Function | | | | +|`getLength`| Function | | | | +|*MutableStyledString*| *Class* | | | | +|`replaceString`| Function | | | | +|`insertString`| Function | | | | +|`removeString`| Function | | | | +|`replaceStyle`| Function | | | | +|`setStyle`| Function | | | | +|`removeStyle`| Function | | | | +|`removeStyles`| Function | | | | +|`clearStyles`| Function | | | | +|`replaceStyledString`| Function | | | | +|`insertStyledString`| Function | | | | +|`appendStyledString`| Function | | | | +|*CustomSpan*| *Class* | Politov Mikhail | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IB4H0N | +|`onMeasure`| Function | Politov Mikhail | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IB4H0N | +|`onDraw`| Function | Politov Mikhail | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IB4H0N | +|`invalidate`| Function | Politov Mikhail | blocked IDL| https://gitee.com/nikolay-igotti/idlize/issues/IB4H0N | +|*LinearIndicatorController*| *Class* | Kovalev Sergey | in progress | | +|`setProgress`| Function | Kovalev Sergey | in progress | | +|`start`| Function | Kovalev Sergey | in progress | | +|`pause`| Function | Kovalev Sergey | in progress | | +|`stop`| Function | Kovalev Sergey | in progress | | \ No newline at end of file -- Gitee From 40ae0ef1ccef22c236f9bf6629d95492771f4952 Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Fri, 15 Nov 2024 15:05:33 +0000 Subject: [PATCH 12/53] !979 The Accessor::DestroyPeer method also can be generated * update src/peer-generation/printers/ModifierPrinter.ts. * update src/peer-generation/printers/HeaderPrinter.ts. * update src/peer-generation/Materialized.ts. --- src/peer-generation/Materialized.ts | 29 +++++++++++++++++-- src/peer-generation/printers/HeaderPrinter.ts | 10 ++++--- .../printers/ModifierPrinter.ts | 11 +++---- 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/peer-generation/Materialized.ts b/src/peer-generation/Materialized.ts index ed0f8c39..7012d88f 100644 --- a/src/peer-generation/Materialized.ts +++ b/src/peer-generation/Materialized.ts @@ -14,13 +14,14 @@ */ import { ArgConvertor, RetConvertor } from "./ArgConvertors" -import { Field, Method, MethodModifier } from "./LanguageWriters" +import { Field, Method, MethodModifier, NamedMethodSignature } from "./LanguageWriters" import { capitalize } from "../util" import { ImportFeature, ImportsCollector } from "./ImportsCollector" -import { IDLType } from "../idl" +import { createReferenceType, IDLType, IDLVoidType } from "../idl" import { PeerMethod } from "./PeerMethod"; import { PeerClassBase } from "./PeerClass"; import { PeerLibrary } from "./PeerLibrary" +import { PrimitiveType } from "./ArkPrimitiveType" export class MaterializedField { constructor( @@ -145,6 +146,30 @@ export class MaterializedClass implements PeerClassBase { } } +export function createDestroyPeerMethod(clazz: MaterializedClass): MaterializedMethod { + const destroyPeerReturnType: RetConvertor = { + isVoid: true, + nativeType: () => PrimitiveType.Void.getText(), + interopType: () => PrimitiveType.Void.getText(), + macroSuffixPart: () => "V" + } + + return new MaterializedMethod( + clazz.className, + [], + destroyPeerReturnType, + false, + new Method( + 'destroyPeer', + new NamedMethodSignature( + IDLVoidType, + [createReferenceType(clazz.className)], + ['peer'] + ) + ) + ) +} + export function collectMaterializedImports(imports: ImportsCollector, library: PeerLibrary, level: string = "") { for (const materialized of library.materializedClasses.keys()) { imports.addFeature(materialized, `${level}Ark${materialized}Materialized`) diff --git a/src/peer-generation/printers/HeaderPrinter.ts b/src/peer-generation/printers/HeaderPrinter.ts index 4ba1ea66..b92f01f6 100644 --- a/src/peer-generation/printers/HeaderPrinter.ts +++ b/src/peer-generation/printers/HeaderPrinter.ts @@ -19,12 +19,13 @@ import { PeerGeneratorConfig } from "../PeerGeneratorConfig"; import { collectCallbacks, groupCallbacks, IdlCallbackInfo } from "./EventsPrinter"; import { CppLanguageWriter, createTypeNameConvertor, printMethodDeclaration } from "../LanguageWriters"; import { camelCaseToUpperSnakeCase } from "../../util"; +import { maybeOptional } from "../../idl"; import { PeerLibrary } from "../PeerLibrary"; import { PeerClass } from "../PeerClass"; import { PeerMethod } from "../PeerMethod"; -import { forceAsNamedNode, IDLVoidType, maybeOptional, toIDLType } from "../../idl"; import { getReferenceResolver } from "../ReferenceResolver"; import { Language } from "../../Language"; +import { createDestroyPeerMethod } from "../Materialized"; export function generateEventReceiverName(componentName: string) { return `${PeerGeneratorConfig.cppPrefix}ArkUI${componentName}EventsReceiver` @@ -82,9 +83,10 @@ class HeaderVisitor { let accessorName = `${PeerGeneratorConfig.cppPrefix}ArkUI${name}Accessor` this.api.print(`typedef struct ${peerName} ${peerName};`) this.api.print(`typedef struct ${accessorName} {`) - this.api.pushIndent(); - [clazz.ctor, clazz.finalizer].concat(clazz.methods) - .forEach(method => this.printMethod(method)) + this.api.pushIndent() + const mDestroyPeer = createDestroyPeerMethod(clazz) + const methods = [clazz.ctor, clazz.finalizer, mDestroyPeer].concat(clazz.methods) + methods.forEach(method => this.printMethod(method)) this.api.popIndent() this.api.print(`} ${accessorName};\n`) } diff --git a/src/peer-generation/printers/ModifierPrinter.ts b/src/peer-generation/printers/ModifierPrinter.ts index d3177112..5382a6b8 100644 --- a/src/peer-generation/printers/ModifierPrinter.ts +++ b/src/peer-generation/printers/ModifierPrinter.ts @@ -26,16 +26,16 @@ import { warning } from "../FileGenerators"; import { PeerGeneratorConfig } from "../PeerGeneratorConfig"; -import { MaterializedClass, MaterializedMethod } from "../Materialized"; -import { groupBy, throwException } from "../../util"; +import { createDestroyPeerMethod, MaterializedClass, MaterializedMethod } from "../Materialized"; +import { groupBy } from "../../util"; import { CppLanguageWriter, createLanguageWriter, createTypeNameConvertor, LanguageWriter, printMethodDeclaration } from "../LanguageWriters"; import { LibaceInstall } from "../../Install"; +import { IDLBooleanType, IDLFunctionType, IDLStringType, isOptionalType } from "../../idl" import { PeerLibrary } from "../PeerLibrary"; import { PeerClass } from "../PeerClass"; import { PeerMethod } from "../PeerMethod"; import { Language } from "../../Language"; import { createEmptyReferenceResolver, getReferenceResolver } from "../ReferenceResolver"; -import { IDLBooleanType, IDLFunctionType, IDLStringType, isOptionalType } from "../../idl"; export class ModifierVisitor { dummy = createLanguageWriter(Language.CPP, getReferenceResolver(this.library)) @@ -241,8 +241,9 @@ class AccessorVisitor extends ModifierVisitor { // Materialized class methods share the same namespace // so take the first one. const namespaceName = clazz.methods[0].implNamespaceName - this.pushNamespace(namespaceName, false); - [clazz.ctor, clazz.finalizer].concat(clazz.methods).forEach(method => { + this.pushNamespace(namespaceName, false) + const mDestroyPeer = createDestroyPeerMethod(clazz); + [clazz.ctor, clazz.finalizer, mDestroyPeer].concat(clazz.methods).forEach(method => { this.printMaterializedMethod(this.dummy, method, m => this.printDummyImplFunctionBody(m)) this.printMaterializedMethod(this.real, method, m => this.printModifierImplFunctionBody(m)) this.accessors.print(`${method.implNamespaceName}::${method.implName},`) -- Gitee From b7fd6e6167d53156c6973952034ce2e4cbcce56c Mon Sep 17 00:00:00 2001 From: zakalyukinalexander_ac40 Date: Fri, 15 Nov 2024 15:08:28 +0000 Subject: [PATCH 13/53] update doc/DEMOS_STATUS.md. Signed-off-by: zakalyukinalexander_ac40 --- doc/DEMOS_STATUS.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/DEMOS_STATUS.md b/doc/DEMOS_STATUS.md index e7d39fb5..56bd9ea6 100644 --- a/doc/DEMOS_STATUS.md +++ b/doc/DEMOS_STATUS.md @@ -15,7 +15,7 @@ |---------------------------|-----------|-----------|-------------|---------------------|------------------|-------------------|-----------|----------| | @ohos.router | Class | | | Kirill Kirichenko | done | | | | | `back` | Function | | ENC, WON | Kirill Kirichenko | done | Kirill Kirichenko | | High | -| `pageTransition` | Function | | ENC, WON | Kirill Kirichenko | in progress | Kirill Kirichenko | | High | +| `pageTransition` | Function | | ENC, WON | | | Kirill Kirichenko | | High | | CustomDialogController | Class | | HEL | Erokhin Ilya | blocked | | | Low | | `builder` | Function | | | Erokhin Ilya | blocked | | | | | `autoCancel` | Function | | | Erokhin Ilya | done | | | | @@ -32,11 +32,11 @@ | `active` | Function | | HEL | Skroba Gleb | done | | | High | | `type` | Function | | HEL | Skroba Gleb | done | | | High | | `target` | Function | | HEL | Skroba Gleb | done | | | High | -| `params` | Function | | HEL | Skroba Gleb | blocked IDL | | | High | +| `params` | Function | | HEL | Skroba Gleb | in progress | | | High | | Progress | Component | Yes | | Erokhin Ilya | Blocked | | | | | `style, total, value` | Options | | HEL | Erokhin Ilya | in progress | | | Medium | | `type, value` | Options | | HEL | Erokhin Ilya | in progress | | | Medium | -| `style` | Function | | HEL | Erokhin Ilya | in progress | | | Medium | +| `style` | Function | | HEL | Erokhin Ilya | blocked | | | Medium | | `color` | Function | | HEL | Erokhin Ilya | in progress | | | Medium | | Common | Component | Yes | | Roman Sedaikin | in progress | Roman Sedaikin | done | | | `width` | Function | | ENC,WON,HEL | Roman Sedaikin | done | Roman Sedaikin | done | High+ | @@ -99,7 +99,7 @@ | `@Styles function` | Decorator | | HEL | N/A | N/A | A. Tarasov | | Low | | Button | Component | Yes | | Evstigneev Roman | in progress | | | | | `stateEffect, type` | Options | | HEL | Evstigneev Roman | done | | | Medium | -| `radialGradient` | Function | | ENC | Kirill Kirichenko | | | | Medium | +| `radialGradient` | Function | | ENC | | | | | Medium | | `ctor($r)` | Function | | ENC | Kirill Kirichenko | done | | | High | | Image | Component | Yes | | | | | | | | `ctor(URL)` | Function | | ENC | Kirill Berezin | In progress | | | Medium | @@ -115,7 +115,7 @@ | `displayCount` | Function | | HEL | Skroba Gleb | done | | | Medium | | `indicatorStyle` | Function | | WON | Skroba Gleb | done | | | Low | | `priorityGesture` | Function | | WON | Erokhin Ilya | blocked | | | Medium | -| Text | Component | Yes | | Kirill Kirichenko | in progress | | | | +| Text | Component | Yes | | | | | | | | `ctor($r)` | Function | | HEL | Kirill Kirichenko | done | | | High | | Shape | Component | | HEL | Dudkin Sergey | done | | | High | | `fill` | Function | | HEL | Dudkin Sergey | done | | | High | -- Gitee From 02a46c4b3b96f4cff169a5ce50a72e8eb6103107 Mon Sep 17 00:00:00 2001 From: zakalyukinalexander_ac40 Date: Fri, 15 Nov 2024 15:08:45 +0000 Subject: [PATCH 14/53] update doc/COMPONENTS_STATUS.md. Signed-off-by: zakalyukinalexander_ac40 --- doc/COMPONENTS_STATUS.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/COMPONENTS_STATUS.md b/doc/COMPONENTS_STATUS.md index 07b26dcc..50143c37 100755 --- a/doc/COMPONENTS_STATUS.md +++ b/doc/COMPONENTS_STATUS.md @@ -1078,8 +1078,8 @@ |`tabBar`| Function | Evstigneev Roman | blocked IDL | https://gitee.com/nikolay-igotti/idlize/issues/IAX81Q | |`onWillShow`| Function |Evstigneev Roman | in progress | | |`onWillHide`| Function |Evstigneev Roman | in progress | | -|*Text*| *Component* | Kirill Kirichenko | in progress | | -|`setTextOptions`| Function | Kirill Kirichenko | in progress | | +|*Text*| *Component* | | | | +|`setTextOptions`| Function | | | | |`font`| Function |Samarin Sergey |in progress | | |`fontColor`| Function |Samarin Sergey | in progress | | |`fontSize`| Function |Samarin Sergey | in progress | | @@ -1111,16 +1111,16 @@ |`selectedBackgroundColor`| Function |Samarin Sergey |in progress | | |`ellipsisMode`| Function |Samarin Sergey | in progress | | |`EnableDataDetector`| Function | Kirill Kirichenko | done | | -|`DataDetectorConfig`| Function | Kirill Kirichenko | in progress | | +|`DataDetectorConfig`| Function | | | | |`onTextSelectionChange`| Function |Samarin Sergey |in progress | | |`fontFeature`| Function |Samarin Sergey |in progress | | |`privacySensitive`| Function |Samarin Sergey | done | | |`textSelectable`| Function |Samarin Sergey | done | | -|`EditMenuOptions`| Function | Kirill Kirichenko | in progress | | +|`EditMenuOptions`| Function | | | | |`halfLeading`| Function |Samarin Sergey | done | | |`enableHapticFeedback`| Function |Samarin Sergey | done | | |`selection`| Function |Samarin Sergey |in progress | | -|`BindSelectionMenu`| Function | Kirill Kirichenko | in progress | | +|`BindSelectionMenu`| Function | | | | |*TextArea*|*Component*|Tuzhilkin Ivan|in progress| | |`placeholderColor`|Function|Tuzhilkin Ivan|done| | |`placeholderFont`|Function|Tuzhilkin Ivan|done| | -- Gitee From dcbd8c748e0ad4abdd3414fbbae3eb450d4730b1 Mon Sep 17 00:00:00 2001 From: zakalyukinalexander_ac40 Date: Fri, 15 Nov 2024 15:09:12 +0000 Subject: [PATCH 15/53] update doc/COMPONENTS.md. Signed-off-by: zakalyukinalexander_ac40 --- doc/COMPONENTS.md | 895 +++++++++++++++++++++++----------------------- 1 file changed, 445 insertions(+), 450 deletions(-) diff --git a/doc/COMPONENTS.md b/doc/COMPONENTS.md index 75c8b6aa..f465f820 100644 --- a/doc/COMPONENTS.md +++ b/doc/COMPONENTS.md @@ -3,16 +3,16 @@ | Status | Components | Classes | Functions | | ----------- | ---------- | ------- | --------- | -| Total | 114 | 96 | 1859 | -| In Progress | 36 | 39 | 438 | -| Done | 30 | 5 | 891 | -| Blocked | 28 | 7 | 224 | +| Total | 114 | 95 | 1855 | +| In Progress | 39 | 40 | 461 | +| Done | 30 | 6 | 916 | +| Blocked | 29 | 7 | 214 | | Name | Kind | Owner | Status | | ---- | ---- | ----- | ------ | |*AbilityComponent*| *Component* | Tuzhilkin Ivan | in progress | -|`setAbilityComponentOptions`| Function | Tuzhilkin Ivan | blocked IDL | +|`setAbilityComponentOptions`| Function | Tuzhilkin Ivan | in progress | |`onConnect`| Function | Tuzhilkin Ivan | in progress | |`onDisconnect`| Function | Tuzhilkin Ivan | in progress | |*AlphabetIndexer*| *Component* | Ekaterina Stepanova | blocked | @@ -80,24 +80,24 @@ |`contentModifier`| Function | Evstigneev Roman | blocked IDL | |`labelStyle`| Function | Evstigneev Roman | done | |*Calendar*| *Component* | Maksimov Nikita | in progress | -|`setCalendarOptions`| Function | Maksimov Nikita | blocked UT | -|`showLunar`| Function | Maksimov Nikita | blocked UT | -|`showHoliday`| Function | Maksimov Nikita | blocked UT | +|`setCalendarOptions`| Function | Maksimov Nikita | done | +|`showLunar`| Function | Maksimov Nikita | done | +|`showHoliday`| Function | Maksimov Nikita | done | |`needSlide`| Function | Maksimov Nikita | done | -|`startOfWeek`| Function | Maksimov Nikita | blocked UT | -|`offDays`| Function | Maksimov Nikita | blocked UT | -|`direction`| Function | Maksimov Nikita | blocked UT | -|`currentDayStyle`| Function | Maksimov Nikita | blocked UT | -|`nonCurrentDayStyle`| Function | Maksimov Nikita | blocked UT | -|`todayStyle`| Function | Maksimov Nikita | blocked UT | -|`weekStyle`| Function | Maksimov Nikita | blocked UT | -|`workStateStyle`| Function | Maksimov Nikita | blocked UT | +|`startOfWeek`| Function | Maksimov Nikita | done | +|`offDays`| Function | Maksimov Nikita | done | +|`direction`| Function | Maksimov Nikita | done | +|`currentDayStyle`| Function | Maksimov Nikita | done | +|`nonCurrentDayStyle`| Function | Maksimov Nikita | done | +|`todayStyle`| Function | Maksimov Nikita | done | +|`weekStyle`| Function | Maksimov Nikita | done | +|`workStateStyle`| Function | Maksimov Nikita | done | |`onSelectChange`| Function | Maksimov Nikita | in progress | |`onRequestData`| Function | Maksimov Nikita | in progress | |*CalendarPicker*| *Component* | Politov Mikhail | in progress | -|`setCalendarPickerOptions`| Function | Politov Mikhail | blocked IDL | +|`setCalendarPickerOptions`| Function | Politov Mikhail | in progress | |`textStyle`| Function | Politov Mikhail | done | -|`onChange`| Function | Politov Mikhail | blocked IDL | +|`onChange`| Function | Politov Mikhail | in progress | |`edgeAlign`| Function | Politov Mikhail | done | |*Canvas*| *Component* | Vadim Voronov | blocked IDL | |`setCanvasOptions`| Function | Vadim Voronov | blocked IDL | @@ -144,7 +144,7 @@ |`hitTestBehavior`| Function | Roman Sedaikin | done | |`onChildTouchTest`| Function | | | |`layoutWeight`| Function | Roman Sedaikin | done | -|`chainWeight`| Function | | | +|`chainWeight`| Function | | | |`padding`| Function | Skroba Gleb | in progress | |`safeAreaPadding`| Function | | | |`margin`| Function | Skroba Gleb | in progress | @@ -155,10 +155,10 @@ |`backgroundEffect`| Function | Skroba Gleb | done | |`backgroundImageResizable`| Function | Skroba Gleb | done | |`foregroundEffect`| Function | Skroba Gleb | done | -|`visualEffect`| Function | Skroba Gleb | blocked IDL | -|`backgroundFilter`| Function | Skroba Gleb | blocked IDL | -|`foregroundFilter`| Function | Skroba Gleb | blocked IDL | -|`compositingFilter`| Function | Skroba Gleb | blocked IDL | +|`visualEffect`| Function | Skroba Gleb | in progress | +|`backgroundFilter`| Function | Skroba Gleb | in progress | +|`foregroundFilter`| Function | Skroba Gleb | in progress | +|`compositingFilter`| Function | Skroba Gleb | in progress | |`opacity`| Function | Roman Sedaikin | done | |`border`| Function | Roman Sedaikin | done | |`borderStyle`| Function | Roman Sedaikin | done | @@ -183,14 +183,14 @@ |`focusable`| Function | Roman Sedaikin | done | |`onFocus`| Function | Roman Sedaikin | done | |`onBlur`| Function | Roman Sedaikin | done | -|`tabIndex`| Function | | | -|`defaultFocus`| Function | | | -|`groupDefaultFocus`| Function | | | -|`focusOnTouch`| Function | | | -|`focusBox`| Function | | | +|`tabIndex`| Function | Dmitry A Smirnov | in progress | +|`defaultFocus`| Function | Dmitry A Smirnov | in progress | +|`groupDefaultFocus`| Function | Dmitry A Smirnov | in progress | +|`focusOnTouch`| Function | Dmitry A Smirnov | in progress | +|`focusBox`| Function | Dmitry A Smirnov | in progress | |`animation`| Function | Erokhin Ilya | blocked IDL | -|`transition`| Function | | | -|`motionBlur`| Function | | | +|`transition`| Function | Dmitry A Smirnov | in progress | +|`motionBlur`| Function | Dmitry A Smirnov | in progress | |`brightness`| Function | Lobah Mikhail | in progress | |`contrast`| Function | Lobah Mikhail | in progress | |`grayscale`| Function | Lobah Mikhail | in progress | @@ -205,9 +205,9 @@ |`freeze`| Function | Lobah Mikhail | in progress | |`translate`| Function | Erokhin Ilya | done | |`scale`| Function | Erokhin Ilya | done | -|`gridSpan`| Function | | | -|`gridOffset`| Function | | | -|`rotate`| Function | | | +|`gridSpan`| Function | Dmitry A Smirnov | in progress | +|`gridOffset`| Function | Dmitry A Smirnov | in progress | +|`rotate`| Function | Dmitry A Smirnov | in progress | |`transform`| Function | | | |`onAppear`| Function | Roman Sedaikin | done | |`onDisAppear`| Function | Roman Sedaikin | done | @@ -215,20 +215,20 @@ |`onDetach`| Function | | | |`onAreaChange`| Function | Roman Sedaikin | done | |`visibility`| Function | Roman Sedaikin | done | -|`flexGrow`| Function | | | -|`flexShrink`| Function | | | -|`flexBasis`| Function | | | +|`flexGrow`| Function | Dmitry A Smirnov | in progress | +|`flexShrink`| Function | Dmitry A Smirnov | in progress | +|`flexBasis`| Function | Dmitry A Smirnov | in progress | |`alignSelf`| Function | Roman Sedaikin | done | |`displayPriority`| Function | Roman Sedaikin | done | |`zIndex`| Function | Roman Sedaikin | done | |`direction`| Function | Roman Sedaikin | done | |`align`| Function | Roman Sedaikin | done | |`position`| Function | Roman Sedaikin | done | -|`markAnchor`| Function | | | +|`markAnchor`| Function | Dmitry A Smirnov | in progress | |`offset`| Function | Skroba Gleb | in progress | |`enabled`| Function | Roman Sedaikin | done | -|`useSizeType`| Function | | | -|`alignRules`| Function | | | +|`useSizeType`| Function | Dmitry A Smirnov | in progress | +|`alignRules`| Function | Dmitry A Smirnov | in progress | |`aspectRatio`| Function | Roman Sedaikin | done | |`clickEffect`| Function | | | |`onDragStart`| Function | | | @@ -247,9 +247,9 @@ |`motionPath`| Function | | | |`shadow`| Function | Roman Sedaikin | done | |`clip`| Function | Skroba Gleb | blocked IDL | -|`clipShape`| Function | Skroba Gleb | blocked IDL | -|`mask`| Function | | | -|`maskShape`| Function | | | +|`clipShape`| Function | Dmitry A Smirnov | blocked IDL | +|`mask`| Function | Dmitry A Smirnov | in progress | +|`maskShape`| Function | Dmitry A Smirnov | in progress | |`key`| Function | | | |`id`| Function | Erokhin Ilya | done | |`geometryTransition`| Function | | | @@ -283,8 +283,8 @@ |`backgroundImage`| Function | Erokhin Ilya | blocked IDL | |`backgroundBlurStyle`| Function | Skroba Gleb | done | |`foregroundBlurStyle`| Function | Roman Sedaikin | done | -|`focusScopeId`| Function | Berezin Kirill | in progress | -|`focusScopePriority`| Function | Berezin Kirill | in progress | +|`focusScopeId`| Function | Dmitry A Smirnov | in progress | +|`focusScopePriority`| Function | Dmitry A Smirnov | in progress | |`gesture`| Function | Erokhin Ilya | blocked IDL | |`priorityGesture`| Function | Erokhin Ilya | blocked IDL | |`parallelGesture`| Function | Erokhin Ilya | blocked IDL | @@ -317,8 +317,8 @@ |`strokeWidth`| Function | Evstigneev Roman | done | |`antiAlias`| Function | Evstigneev Roman | done | |`strokeDashArray`| Function | Evstigneev Roman | blocked AceEngine | -|*Common*| *Component* | | | -|`setCommonOptions`| Function | | | +|*Common*| *Component* | | | +|`setCommonOptions`| Function | | | |*ScrollableCommonMethod*| *Component* | Samarin Sergey | in progress | |`scrollBar`| Function | Samarin Sergey | in progress | |`scrollBarColor`| Function | Samarin Sergey | in progress | @@ -334,9 +334,9 @@ |`onScrollStart`| Function | Samarin Sergey | in progress | |`onScrollStop`| Function | Samarin Sergey | in progress | |`flingSpeedLimit`| Function | Samarin Sergey | in progress | -|`clipContent`| Function | | | +|`clipContent`| Function | | | |`edgeEffect`| Function | Samarin Sergey | in progress | -|`fadingEdge`| Function | Samarin Sergey | blocked IDL | +|`fadingEdge`| Function | Samarin Sergey | in progress | |*Component3D*| *Component* | Kovalev Sergey | blocked AceEngine | |`setComponent3DOptions`| Function | Kovalev Sergey | blocked AceEngine | |`environment`| Function | Kovalev Sergey | blocked AceEngine | @@ -364,32 +364,32 @@ |`trackShadow`| Function | Morozov Sergey | blocked IDL | |`contentModifier`| Function | Morozov Sergey | blocked IDL | |*DatePicker*| *Component* | Vadim Voronov | done | -|`setDatePickerOptions`| Function | Vadim Voronov | blocked IDL | +|`setDatePickerOptions`| Function | Vadim Voronov | in progress | |`lunar`| Function | Vadim Voronov | done | |`disappearTextStyle`| Function | Vadim Voronov | done | |`textStyle`| Function | Vadim Voronov | done | |`selectedTextStyle`| Function | Vadim Voronov | done | |`onChange`| Function | Vadim Voronov | done | -|`onDateChange`| Function | Vadim Voronov | blocked IDL | +|`onDateChange`| Function | Vadim Voronov | in progress | |*Divider*| *Component* | Tuzhilkin Ivan | done | |`setDividerOptions`| Function | Tuzhilkin Ivan | done | |`vertical`| Function | Tuzhilkin Ivan | done | |`color`| Function | Tuzhilkin Ivan | done | |`strokeWidth`| Function | Tuzhilkin Ivan | done | |`lineCap`| Function | Tuzhilkin Ivan | done | -|*EffectComponent*| *Component* | | | -|`setEffectComponentOptions`| Function | | | -|*Ellipse*| *Component* | | | -|`setEllipseOptions`| Function | | | -|*EmbeddedComponent*| *Component* | | | -|`setEmbeddedComponentOptions`| Function | | | -|`onTerminated`| Function | | | -|`onError`| Function | | | +|*EffectComponent*| *Component* | | | +|`setEffectComponentOptions`| Function | | | +|*Ellipse*| *Component* | | | +|`setEllipseOptions`| Function | | | +|*EmbeddedComponent*| *Component* | | | +|`setEmbeddedComponentOptions`| Function | | | +|`onTerminated`| Function | | | +|`onError`| Function | | | |*Flex*| *Component* | Kovalev Sergey | in progress | |`setFlexOptions`| Function | Kovalev Sergey | done | |`pointLight`| Function | Evstigneev Roman | In Progress | -|*FlowItem*| *Component* | | | -|`setFlowItemOptions`| Function | | | +|*FlowItem*| *Component* | | | +|`setFlowItemOptions`| Function | | | |*FolderStack*| *Component* | Politov Mikhail | done | |`setFolderStackOptions`| Function | Politov Mikhail | done | |`alignContent`| Function | Politov Mikhail | done | @@ -479,16 +479,16 @@ |`setGridRowOptions`| Function | Lobah Mikhail | in progress | |`onBreakpointChange`| Function | Lobah Mikhail | in progress | |`alignItems`| Function | Lobah Mikhail | in progress | -|*Hyperlink*| *Component* | | | -|`setHyperlinkOptions`| Function | | | -|`color`| Function | | | +|*Hyperlink*| *Component* | | | +|`setHyperlinkOptions`| Function | | | +|`color`| Function | | | |*Image*| *Component* | Korobeinikov Evgeny | in progress | |`setImageOptions`| Function | Berezin Kirill | in progress | |`alt`| Function | Evstigneev Roman | blocked IDL | |`matchTextDirection`| Function | Evstigneev Roman | in progress | |`fitOriginalSize`| Function | Evstigneev Roman | in progress | |`fillColor`| Function | Evstigneev Roman | done | -|`objectFit`| Function | Kirill Berezin | done | +|`objectFit`| Function | Berezin Kirill | done | |`objectRepeat`| Function | Evstigneev Roman | in progress | |`autoResize`| Function | Evstigneev Roman | in progress | |`renderMode`| Function | Evstigneev Roman | in progress | @@ -509,21 +509,21 @@ |`resizable`| Function | Evstigneev Roman | blocked IDL | |`privacySensitive`| Function | Evstigneev Roman | in progress | |`enhancedImageQuality`| Function | Evstigneev Roman | in progress | -|*ImageAnimator*| *Component* | | | -|`setImageAnimatorOptions`| Function | | | -|`images`| Function | | | -|`state`| Function | | | -|`duration`| Function | | | -|`reverse`| Function | | | -|`fixedSize`| Function | | | -|`preDecode`| Function | | | -|`fillMode`| Function | | | -|`iterations`| Function | | | -|`onStart`| Function | | | -|`onPause`| Function | | | -|`onRepeat`| Function | | | -|`onCancel`| Function | | | -|`onFinish`| Function | | | +|*ImageAnimator*| *Component* | | | +|`setImageAnimatorOptions`| Function | | | +|`images`| Function | | | +|`state`| Function | | | +|`duration`| Function | | | +|`reverse`| Function | | | +|`fixedSize`| Function | | | +|`preDecode`| Function | | | +|`fillMode`| Function | | | +|`iterations`| Function | | | +|`onStart`| Function | | | +|`onPause`| Function | | | +|`onRepeat`| Function | | | +|`onCancel`| Function | | | +|`onFinish`| Function | | | |*ImageSpan*| *Component* | Politov Mikhail | in progress | |`setImageSpanOptions`| Function | Politov Mikhail | in progress | |`verticalAlign`| Function | Politov Mikhail | in progress | @@ -604,16 +604,16 @@ |`onStart`| Function | Andrey Khudenkikh | in progress | |`onBounce`| Function | Andrey Khudenkikh | in progress | |`onFinish`| Function | Andrey Khudenkikh | in progress | -|*MediaCachedImage*| *Component* | | | -|`setMediaCachedImageOptions`| Function | | | +|*MediaCachedImage*| *Component* | | | +|`setMediaCachedImageOptions`| Function | | | |*Menu*| *Component* | Morozov Sergey | blocked | |`setMenuOptions`| Function | Morozov Sergey | done | |`fontSize`| Function | Morozov Sergey | done | |`font`| Function | Morozov Sergey | done | |`fontColor`| Function | Morozov Sergey | done | |`radius`| Function | Morozov Sergey | done | -|`menuItemDivider`| Function | Morozov Sergey | blocked IDL | -|`menuItemGroupDivider`| Function | Morozov Sergey | blocked IDL | +|`menuItemDivider`| Function | Morozov Sergey | in progress | +|`menuItemGroupDivider`| Function | Morozov Sergey | in progress | |`subMenuExpandingMode`| Function | Morozov Sergey | done | |*MenuItem*| *Component* | Morozov Sergey | blocked | |`setMenuItemOptions`| Function | Morozov Sergey | blocked IDL | @@ -642,10 +642,10 @@ |`onWillHide`| Function | Kovalev Sergey | done | |`systemBarStyle`| Function | Kovalev Sergey | blocked IDL | |`recoverable`| Function | Kovalev Sergey | done | -|`systemTransition`| Function | Kovalev Sergey | blocked AceEngine | +|`systemTransition`| Function | Kovalev Sergey | blocked IDL | |`title`| Function | Kovalev Sergey | blocked IDL | -|`toolbarConfiguration`| Function | | | -|`hideToolBar`| Function | | | +|`toolbarConfiguration`| Function | Kovalev Sergey | in progress | +|`hideToolBar`| Function | Kovalev Sergey | in progress | |`ignoreLayoutSafeArea`| Function | Kovalev Sergey | done | |*NavRouter*| *Component* | Evstigneev Roman | done | |`setNavRouterOptions`| Function | Evstigneev Roman | blocked IDL | @@ -674,18 +674,18 @@ |`customNavContentTransition`| Function | Skroba Gleb | in progress | |`systemBarStyle`| Function | Skroba Gleb | blocked IDL | |`recoverable`| Function | Erokhin Ilya | done | -|`enableDragBar`| Function | | | +|`enableDragBar`| Function | | | |`title`| Function | Erokhin Ilya | blocked IDL | |`toolbarConfiguration`| Function | Skroba Gleb | blocked IDL | -|`ignoreLayoutSafeArea`| Function | Skroba Gleb | blocked UT | +|`ignoreLayoutSafeArea`| Function | Skroba Gleb | done | |*Navigator*| *Component* | Skroba Gleb | blocked | |`setNavigatorOptions`| Function | Skroba Gleb | done | |`active`| Function | Skroba Gleb | done | |`type`| Function | Skroba Gleb | done | |`target`| Function | Skroba Gleb | done | -|`params`| Function | Skroba Gleb | blocked IDL | -|*NodeContainer*| *Component* | | | -|`setNodeContainerOptions`| Function | | | +|`params`| Function | Skroba Gleb | in progress | +|*NodeContainer*| *Component* | | | +|`setNodeContainerOptions`| Function | | | |*Panel*| *Component* | Pavelyev Ivan | done | |`setPanelOptions`| Function | Pavelyev Ivan | done | |`mode`| Function | Pavelyev Ivan | done | @@ -720,28 +720,28 @@ |`autoReset`| Function | Dmitry A Smirnov | done | |`onDotConnect`| Function | Dmitry A Smirnov | in progress | |`activateCircleStyle`| Function | Dmitry A Smirnov | blocked AceEngine | -|*PluginComponent*| *Component* | | | -|`setPluginComponentOptions`| Function | | | -|`onComplete`| Function | | | -|`onError`| Function | | | -|*Polygon*| *Component* | | | -|`setPolygonOptions`| Function | | | -|`points`| Function | | | -|*Polyline*| *Component* | | | -|`setPolylineOptions`| Function | | | -|`points`| Function | | | +|*PluginComponent*| *Component* | | | +|`setPluginComponentOptions`| Function | | | +|`onComplete`| Function | | | +|`onError`| Function | | | +|*Polygon*| *Component* | | | +|`setPolygonOptions`| Function | | | +|`points`| Function | | | +|*Polyline*| *Component* | | | +|`setPolylineOptions`| Function | | | +|`points`| Function | | | |*Progress*| *Component* | Erokhin Ilya | | |`setProgressOptions`| Function | Erokhin Ilya | in progress | |`value`| Function | Erokhin Ilya | in progress | |`color`| Function | Erokhin Ilya | in progress | -|`style`| Function | Erokhin Ilya | in progress | +|`style`| Function | Erokhin Ilya | blocked | |`privacySensitive`| Function | Erokhin Ilya | in progress | -|`contentModifier`| Function | Erokhin Ilya | in progress | +|`contentModifier`| Function | Erokhin Ilya | blocked IDL | |*QRCode*| *Component* | Evstigneev Roman | in progress | |`setQRCodeOptions`| Function | Evstigneev Roman | done | -|`color`| Function | Evstigneev Roman | blocked UT | -|`backgroundColor`| Function | Evstigneev Roman | blocked UT | -|`contentOpacity`| Function | Evstigneev Roman | blocked UT | +|`color`| Function | Evstigneev Roman | done | +|`backgroundColor`| Function | Evstigneev Roman | done | +|`contentOpacity`| Function | Evstigneev Roman | done | |*Radio*| *Component* | Evstigneev Roman | done | |`setRadioOptions`| Function | Evstigneev Roman | done | |`checked`| Function | Evstigneev Roman | done | @@ -761,12 +761,12 @@ |`radiusHeight`| Function | Dudkin Sergey | done | |`radius`| Function | Dudkin Sergey | blocked AceEngine | |*Refresh*| *Component* | Politov Mikhail | in progress | -|`setRefreshOptions`| Function | Politov Mikhail | blocked IDL | -|`onStateChange`| Function | Politov Mikhail | blocked IDL | -|`onRefreshing`| Function | Politov Mikhail | blocked IDL | +|`setRefreshOptions`| Function | Politov Mikhail | in progress | +|`onStateChange`| Function | Politov Mikhail | in progress | +|`onRefreshing`| Function | Politov Mikhail | in progress | |`refreshOffset`| Function | Politov Mikhail | done | |`pullToRefresh`| Function | Politov Mikhail | done | -|`onOffsetChange`| Function | Politov Mikhail | blocked IDL | +|`onOffsetChange`| Function | Politov Mikhail | in progress | |`pullDownRatio`| Function | Politov Mikhail | done | |*RelativeContainer*| *Component* | Dmitry A Smirnov | done | |`setRelativeContainerOptions`| Function | Dmitry A Smirnov | done | @@ -792,7 +792,7 @@ |`onEditingChange`| Function | Dudkin Sergey | done | |`enterKeyType`| Function | Dudkin Sergey | in progress | |`onSubmit`| Function | Dudkin Sergey | done | -|`onWillChange`| Function | Dudkin Sergey | done | +|`onWillChange`| Function | Dudkin Sergey | blocked IDL | |`onDidChange`| Function | Dudkin Sergey | done | |`onCut`| Function | Dudkin Sergey | in progress | |`onCopy`| Function | Dudkin Sergey | in progress | @@ -807,8 +807,8 @@ |`setRichTextOptions`| Function | Dudkin Sergey | in progress | |`onStart`| Function | Dudkin Sergey | in progress | |`onComplete`| Function | Dudkin Sergey | in progress | -|*RootScene*| *Component* | | | -|`setRootSceneOptions`| Function | | | +|*RootScene*| *Component* | Maksimov Nikita | in progress | +|`setRootSceneOptions`| Function | Maksimov Nikita | in progress | |*Row*| *Component* | Andrey Khudenkikh | in progress | |`setRowOptions`| Function | Andrey Khudenkikh | done | |`alignItems`| Function | Andrey Khudenkikh | done | @@ -821,32 +821,32 @@ |*SaveButton*| *Component* | Samarin Sergey | done | |`setSaveButtonOptions`| Function | Samarin Sergey | done | |`onClick`| Function | Samarin Sergey | done | -|*Screen*| *Component* | | | -|`setScreenOptions`| Function | | | -|*Scroll*| *Component* | Kirill Berezin | in progress | -|`setScrollOptions`| Function | Kirill Berezin | in progress | -|`scrollable`| Function | Kirill Berezin | In progress | -|`onScroll`| Function | Kirill Berezin | done | -|`onWillScroll`| Function | Kirill Berezin | blocked | -|`onDidScroll`| Function | Kirill Berezin | in progress | -|`onScrollEdge`| Function | Kirill Berezin | in progress | -|`onScrollStart`| Function | Kirill Berezin | done | -|`onScrollEnd`| Function | Kirill Berezin | done | -|`onScrollStop`| Function | Kirill Berezin | done | -|`scrollBar`| Function | Kirill Berezin | in progress | -|`scrollBarColor`| Function | Kirill Berezin | in progress | -|`scrollBarWidth`| Function | Kirill Berezin | in progress | -|`onScrollFrameBegin`| Function | Kirill Berezin | blocked | -|`nestedScroll`| Function | Kirill Berezin | in progress | -|`enableScrollInteraction`| Function | Kirill Berezin | In progress | -|`friction`| Function | Kirill Berezin | In progress | -|`scrollSnap`| Function | Kirill Berezin | in progress | -|`enablePaging`| Function | Kirill Berezin | done | -|`initialOffset`| Function | Kirill Berezin | done | -|`edgeEffect`| Function | Kirill Berezin | in progress | -|*ScrollBar*| *Component* | | | -|`setScrollBarOptions`| Function | | | -|`enableNestedScroll`| Function | | | +|*Screen*| *Component* | Maksimov Nikita | in progress | +|`setScreenOptions`| Function | Maksimov Nikita | in progress | +|*Scroll*| *Component* | Berezin Kirill | in progress | +|`setScrollOptions`| Function | Berezin Kirill | in progress | +|`scrollable`| Function | Berezin Kirill | In progress | +|`onScroll`| Function | Berezin Kirill | done | +|`onWillScroll`| Function | Berezin Kirill | blocked | +|`onDidScroll`| Function | Berezin Kirill | in progress | +|`onScrollEdge`| Function | Berezin Kirill | in progress | +|`onScrollStart`| Function | Berezin Kirill | done | +|`onScrollEnd`| Function | Berezin Kirill | done | +|`onScrollStop`| Function | Berezin Kirill | done | +|`scrollBar`| Function | Berezin Kirill | in progress | +|`scrollBarColor`| Function | Berezin Kirill | in progress | +|`scrollBarWidth`| Function | Berezin Kirill | in progress | +|`onScrollFrameBegin`| Function | Berezin Kirill | blocked | +|`nestedScroll`| Function | Berezin Kirill | in progress | +|`enableScrollInteraction`| Function | Berezin Kirill | In progress | +|`friction`| Function | Berezin Kirill | In progress | +|`scrollSnap`| Function | Berezin Kirill | in progress | +|`enablePaging`| Function | Berezin Kirill | done | +|`initialOffset`| Function | Berezin Kirill | done | +|`edgeEffect`| Function | Berezin Kirill | in progress | +|*ScrollBar*| *Component* | Maksimov Nikita | in progress | +|`setScrollBarOptions`| Function | Maksimov Nikita | in progress | +|`enableNestedScroll`| Function | Maksimov Nikita | in progress | |*Search*| *Component* | Evstigneev Roman | In Progress | |`setSearchOptions`| Function | Evstigneev Roman | in progress | |`fontColor`| Function | Evstigneev Roman | done | @@ -894,11 +894,11 @@ |`layoutDirection`| Function | Samarin Sergey | done | |`position`| Function | Samarin Sergey | done | |`markAnchor`| Function | Samarin Sergey | done | -|`offset`| Function | Samarin Sergey | blocked IDL | +|`offset`| Function | Samarin Sergey | in progress | |`fontSize`| Function | Samarin Sergey | done | |`fontStyle`| Function | Samarin Sergey | done | |`fontWeight`| Function | Samarin Sergey | done | -|`fontFamily`| Function | Samarin Sergey | blocked UT | +|`fontFamily`| Function | Samarin Sergey | done | |`fontColor`| Function | Samarin Sergey | done | |`iconColor`| Function | Samarin Sergey | done | |`backgroundColor`| Function | Samarin Sergey | done | @@ -976,7 +976,7 @@ |`showTips`| Function | Morozov Sergey | done | |*BaseSpan*| *Component* | Politov Mikhail | in progress | |`textBackgroundStyle`| Function | Politov Mikhail | done | -|`baselineOffset`| Function | Politov Mikhail | blocked IDL | +|`baselineOffset`| Function | Politov Mikhail | in progress | |*Span*| *Component* | Politov Mikhail | done | |`setSpanOptions`| Function | Politov Mikhail | done | |`font`| Function | Politov Mikhail | done | @@ -989,7 +989,7 @@ |`letterSpacing`| Function | Politov Mikhail | done | |`textCase`| Function | Politov Mikhail | done | |`lineHeight`| Function | Politov Mikhail | done | -|`textShadow`| Function | Politov Mikhail | blocked UT | +|`textShadow`| Function | Politov Mikhail | done | |*Stack*| *Component* | Korobeinikov Evgeny | in progress | |`setStackOptions`| Function | Korobeinikov Evgeny | done | |`alignContent`| Function | Korobeinikov Evgeny | done | @@ -1026,7 +1026,7 @@ |`onAnimationStart`| Function | Skroba Gleb | done | |`onAnimationEnd`| Function | Skroba Gleb | done | |`onGestureSwipe`| Function | Skroba Gleb | done | -|`nestedScroll`| Function | Skroba Gleb | blocked UT | +|`nestedScroll`| Function | Skroba Gleb | done | |`customContentTransition`| Function | Skroba Gleb | in progress | |`onContentDidScroll`| Function | Skroba Gleb | done | |`indicatorInteractive`| Function | Skroba Gleb | done | @@ -1042,10 +1042,10 @@ |`loop`| Function | Andrey Khudenkikh | done | |`vertical`| Function | Andrey Khudenkikh | done | |`onChange`| Function | Andrey Khudenkikh | done | -|*SymbolGlyph*| *Component* | Andrey Khudenkikh | in progress | -|`setSymbolGlyphOptions`| Function | Andrey Khudenkikh | in progress | +|*SymbolGlyph*| *Component* | Andrey Khudenkikh | blocked | +|`setSymbolGlyphOptions`| Function | Andrey Khudenkikh | done | |`fontSize`| Function | Andrey Khudenkikh | done | -|`fontColor`| Function | Andrey Khudenkikh | in progress | +|`fontColor`| Function | Andrey Khudenkikh | done | |`fontWeight`| Function | Andrey Khudenkikh | done | |`effectStrategy`| Function | Andrey Khudenkikh | done | |`renderingStrategy`| Function | Andrey Khudenkikh | done | @@ -1080,16 +1080,16 @@ |`barGridAlign`| Function | Tuzhilkin Ivan | done | |`customContentTransition`| Function | Tuzhilkin Ivan | in progress | |`barBackgroundBlurStyle`| Function | Tuzhilkin Ivan | done | -|`barBackgroundEffect`| Function | | | +|`barBackgroundEffect`| Function | | | |`onContentWillChange`| Function | Tuzhilkin Ivan | blocked IDL | -|`barModeBarMode_SCROLLABLE`| Function | | | +|`barModeBarMode_SCROLLABLE`| Function | | | |*TabContent*| *Component* | Evstigneev Roman | in progress | |`setTabContentOptions`| Function | Evstigneev Roman | done | |`tabBar`| Function | Evstigneev Roman | blocked IDL | |`onWillShow`| Function | Evstigneev Roman | in progress | |`onWillHide`| Function | Evstigneev Roman | in progress | -|*Text*| *Component* | Kirill Kirichenko | in progress | -|`setTextOptions`| Function | Kirill Kirichenko | in progress | +|*Text*| *Component* | | | +|`setTextOptions`| Function | | | |`font`| Function | Samarin Sergey | in progress | |`fontColor`| Function | Samarin Sergey | in progress | |`fontSize`| Function | Samarin Sergey | in progress | @@ -1137,16 +1137,16 @@ |`placeholderFont`| Function | Tuzhilkin Ivan | done | |`enterKeyType`| Function | Tuzhilkin Ivan | done | |`textAlign`| Function | Tuzhilkin Ivan | done | -|`caretColor`| Function | Tuzhilkin Ivan | done | -|`fontColor`| Function | Tuzhilkin Ivan | done | +|`caretColor`| Function | Tuzhilkin Ivan | in progress | +|`fontColor`| Function | Tuzhilkin Ivan | in progress | |`fontSize`| Function | Tuzhilkin Ivan | in progress | |`fontStyle`| Function | Tuzhilkin Ivan | in progress | |`fontWeight`| Function | Tuzhilkin Ivan | in progress | |`fontFamily`| Function | Tuzhilkin Ivan | in progress | -|`textOverflow`| Function | Tuzhilkin Ivan | blocked AceEngine | -|`textIndent`| Function | Tuzhilkin Ivan | done | +|`textOverflow`| Function | Tuzhilkin Ivan | in progress | +|`textIndent`| Function | Tuzhilkin Ivan | in progress | |`caretStyle`| Function | Tuzhilkin Ivan | in progress | -|`selectedBackgroundColor`| Function | Tuzhilkin Ivan | done | +|`selectedBackgroundColor`| Function | Tuzhilkin Ivan | in progress | |`onSubmit`| Function | Tuzhilkin Ivan | done | |`onChange`| Function | Tuzhilkin Ivan | done | |`onTextSelectionChange`| Function | Tuzhilkin Ivan | done | @@ -1161,15 +1161,15 @@ |`style`| Function | Tuzhilkin Ivan | in progress | |`barState`| Function | Tuzhilkin Ivan | in progress | |`selectionMenuHidden`| Function | Tuzhilkin Ivan | done | -|`minFontSize`| Function | Tuzhilkin Ivan | done | -|`maxFontSize`| Function | Tuzhilkin Ivan | done | +|`minFontSize`| Function | Tuzhilkin Ivan | in progress | +|`maxFontSize`| Function | Tuzhilkin Ivan | in progress | |`heightAdaptivePolicy`| Function | Tuzhilkin Ivan | in progress | |`maxLines`| Function | Tuzhilkin Ivan | done | |`wordBreak`| Function | Tuzhilkin Ivan | in progress | |`lineBreakStrategy`| Function | Tuzhilkin Ivan | in progress | -|`decoration`| Function | Tuzhilkin Ivan | done | -|`letterSpacing`| Function | Tuzhilkin Ivan | done | -|`lineSpacing`| Function | Tuzhilkin Ivan | blocked IDL | +|`decoration`| Function | Tuzhilkin Ivan | in progress | +|`letterSpacing`| Function | Tuzhilkin Ivan | in progress | +|`lineSpacing`| Function | Tuzhilkin Ivan | in progress | |`lineHeight`| Function | Tuzhilkin Ivan | done | |`type`| Function | Tuzhilkin Ivan | done | |`enableAutoFill`| Function | Tuzhilkin Ivan | done | @@ -1183,7 +1183,7 @@ |`enablePreviewText`| Function | Tuzhilkin Ivan | done | |`enableHapticFeedback`| Function | | | |`inputFilter`| Function | Tuzhilkin Ivan | done | -|`showCounter`| Function | Tuzhilkin Ivan | blocked AceEngine | +|`showCounter`| Function | Tuzhilkin Ivan | in progress | |`customKeyboard`| Function | Tuzhilkin Ivan | blocked IDL | |*TextClock*| *Component* | Pavelyev Ivan | in progress | |`setTextClockOptions`| Function | Pavelyev Ivan | in progress | @@ -1219,7 +1219,7 @@ |`fontSize`| Function | Spirin Andrey | done | |`fontStyle`| Function | Spirin Andrey | done | |`fontWeight`| Function | Spirin Andrey | done | -|`fontFamily`| Function | Spirin Andrey | in progress | +|`fontFamily`| Function | Spirin Andrey | done | |`onCopy`| Function | Spirin Andrey | in progress | |`onCut`| Function | Spirin Andrey | in progress | |`onPaste`| Function | Spirin Andrey | in progress | @@ -1235,7 +1235,7 @@ |`showError`| Function | Spirin Andrey | done | |`showUnit`| Function | Spirin Andrey | blocked IDL | |`showUnderline`| Function | Spirin Andrey | done | -|`underlineColor`| Function | Spirin Andrey | in progress | +|`underlineColor`| Function | Spirin Andrey | done | |`selectionMenuHidden`| Function | Spirin Andrey | done | |`barState`| Function | Spirin Andrey | done | |`maxLines`| Function | Spirin Andrey | done | @@ -1250,7 +1250,7 @@ |`decoration`| Function | Spirin Andrey | done | |`letterSpacing`| Function | Spirin Andrey | done | |`lineHeight`| Function | Spirin Andrey | done | -|`passwordRules`| Function | Spirin Andrey | in progress | +|`passwordRules`| Function | Spirin Andrey | done | |`fontFeature`| Function | Spirin Andrey | done | |`showPassword`| Function | Spirin Andrey | done | |`onSecurityStateChange`| Function | Spirin Andrey | in progress | @@ -1278,7 +1278,7 @@ |`divider`| Function | Ekaterina Stepanova | done | |`gradientHeight`| Function | Ekaterina Stepanova | done | |*TextTimer*| *Component* | Ekaterina Stepanova | blocked | -|`setTextTimerOptions`| Function | Ekaterina Stepanova | in progress | +|`setTextTimerOptions`| Function | Ekaterina Stepanova | done | |`format`| Function | Ekaterina Stepanova | done | |`fontColor`| Function | Ekaterina Stepanova | done | |`fontSize`| Function | Ekaterina Stepanova | done | @@ -1289,13 +1289,13 @@ |`textShadow`| Function | Ekaterina Stepanova | blocked AceEngine | |`contentModifier`| Function | Ekaterina Stepanova | blocked IDL | |*TimePicker*| *Component* | Ekaterina Stepanova | blocked | -|`setTimePickerOptions`| Function | Ekaterina Stepanova | blocked IDL | +|`setTimePickerOptions`| Function | Ekaterina Stepanova | in progress | |`useMilitaryTime`| Function | Ekaterina Stepanova | done | |`loop`| Function | Ekaterina Stepanova | done | |`disappearTextStyle`| Function | Ekaterina Stepanova | done | |`textStyle`| Function | Ekaterina Stepanova | done | |`selectedTextStyle`| Function | Ekaterina Stepanova | done | -|`dateTimeOptions`| Function | Ekaterina Stepanova | blocked IDL | +|`dateTimeOptions`| Function | Ekaterina Stepanova | in progress | |`onChange`| Function | Ekaterina Stepanova | done | |`enableHapticFeedback`| Function | Ekaterina Stepanova | done | |*Toggle*| *Component* | Morozov Sergey | blocked | @@ -1325,7 +1325,7 @@ |`enableAnalyzer`| Function | Erokhin Ilya | done | |`analyzerConfig`| Function | Erokhin Ilya | blocked AceEngine | |*Web*| *Component* | Erokhin Ilya | in progress | -|`setWebOptions`| Function | Erokhin Ilya | blocked IDL | +|`setWebOptions`| Function | Erokhin Ilya | in progress | |`javaScriptAccess`| Function | Erokhin Ilya | done | |`fileAccess`| Function | Erokhin Ilya | done | |`onlineImageAccess`| Function | Erokhin Ilya | done | @@ -1431,7 +1431,7 @@ |`onNativeEmbedVisibilityChange`| Function | Erokhin Ilya | done | |`onNativeEmbedGestureEvent`| Function | Erokhin Ilya | in progress | |`copyOptions`| Function | Erokhin Ilya | done | -|`onOverrideUrlLoading`| Function | Erokhin Ilya | blocked | +|`onOverrideUrlLoading`| Function | Erokhin Ilya | blocked IDL | |`textAutosizing`| Function | Erokhin Ilya | done | |`enableNativeMediaPlayer`| Function | Erokhin Ilya | done | |`enableSmoothDragResize`| Function | Erokhin Ilya | done | @@ -1439,22 +1439,22 @@ |`onRenderProcessResponding`| Function | Erokhin Ilya | done | |`selectionMenuOptions`| Function | Erokhin Ilya | in progress | |`onViewportFitChanged`| Function | Erokhin Ilya | done | -|`onInterceptKeyboardAttach`| Function | Erokhin Ilya | blocked | +|`onInterceptKeyboardAttach`| Function | Erokhin Ilya | blocked IDL | |`onAdsBlocked`| Function | Erokhin Ilya | in progress | |`keyboardAvoidMode`| Function | Erokhin Ilya | done | |`editMenuOptions`| Function | Erokhin Ilya | in progress | |`enableHapticFeedback`| Function | Erokhin Ilya | done | |`registerNativeEmbedRule`| Function | Erokhin Ilya | done | -|`bindSelectionMenu`| Function | | | -|*WindowScene*| *Component* | | | -|`setWindowSceneOptions`| Function | | | -|`attractionEffect`| Function | | | -|*XComponent*| *Component* | | | -|`setXComponentOptions`| Function | | | -|`onLoad`| Function | | | -|`onDestroy`| Function | | | -|`enableAnalyzer`| Function | | | -|`enableSecure`| Function | | | +|`bindSelectionMenu`| Function | Erokhin Ilya | in progress | +|*WindowScene*| *Component* | Spirin Andrey | in progress | +|`setWindowSceneOptions`| Function | Spirin Andrey | in progress | +|`attractionEffect`| Function | Spirin Andrey | in progress | +|*XComponent*| *Component* | | | +|`setXComponentOptions`| Function | | | +|`onLoad`| Function | | | +|`onDestroy`| Function | | | +|`enableAnalyzer`| Function | | | +|`enableSecure`| Function | | | |*SideBarContainer*| *Component* | Dmitry A Smirnov | blocked | |`setSideBarContainerOptions`| Function | Dmitry A Smirnov | done | |`showSideBar`| Function | Dmitry A Smirnov | done | @@ -1468,10 +1468,10 @@ |`sideBarPosition`| Function | Dmitry A Smirnov | done | |`divider`| Function | Dmitry A Smirnov | done | |`minContentWidth`| Function | Dmitry A Smirnov | done | -|*RemoteWindow*| *Component* | | | -|`setRemoteWindowOptions`| Function | | | +|*RemoteWindow*| *Component* | Spirin Andrey | in progress | +|`setRemoteWindowOptions`| Function | Spirin Andrey | in progress | |*WaterFlow*| *Component* | Kovalev Sergey | in progress | -|`setWaterFlowOptions`| Function | Kovalev Sergey | blocked IDL | +|`setWaterFlowOptions`| Function | Kovalev Sergey | in progress | |`columnsTemplate`| Function | Kovalev Sergey | done | |`itemConstraintSize`| Function | Kovalev Sergey | done | |`rowsTemplate`| Function | Kovalev Sergey | done | @@ -1486,30 +1486,30 @@ |`onReachEnd`| Function | Kovalev Sergey | in progress | |`onScrollFrameBegin`| Function | Kovalev Sergey | in progress | |`onScrollIndex`| Function | Kovalev Sergey | in progress | -|*UIExtensionComponent*| *Component* | | | -|`setUIExtensionComponentOptions`| Function | | | -|`onRemoteReady`| Function | | | -|`onReceive`| Function | | | -|`onResult`| Function | | | -|`onRelease`| Function | | | -|`onError`| Function | | | -|`onTerminated`| Function | | | +|*UIExtensionComponent*| *Component* | | | +|`setUIExtensionComponentOptions`| Function | | | +|`onRemoteReady`| Function | | | +|`onReceive`| Function | | | +|`onResult`| Function | | | +|`onRelease`| Function | | | +|`onError`| Function | | | +|`onTerminated`| Function | | | |*LinearIndicator*| *Component* | Kovalev Sergey | in progress | |`setLinearIndicatorOptions`| Function | Kovalev Sergey | in progress | |`indicatorStyle`| Function | Kovalev Sergey | in progress | |`indicatorLoop`| Function | Kovalev Sergey | in progress | |`onChange`| Function | Kovalev Sergey | in progress | -|*ActionSheet*| *Class* | | | -|`show`| Function | | | -|*AlertDialog*| *Class* | | | -|`show`| Function | | | +|*ActionSheet*| *Class* | | | +|`show`| Function | | | +|*AlertDialog*| *Class* | | | +|`show`| Function | | | |*CalendarController*| *Class* | Maksimov Nikita | in progress | |`backToToday`| Function | Maksimov Nikita | in progress | |`goTo`| Function | Maksimov Nikita | in progress | -|*CalendarPickerDialog*| *Class* | | | -|`show`| Function | | | -|*CanvasGradient*| *Class* | | | -|`addColorStop`| Function | | | +|*CalendarPickerDialog*| *Class* | | | +|`show`| Function | | | +|*CanvasGradient*| *Class* | | | +|`addColorStop`| Function | | | |*CanvasPath*| *Class* | Lobah Mikhail | in progress | |`arc`| Function | Lobah Mikhail | in progress | |`arcTo`| Function | Lobah Mikhail | in progress | @@ -1520,24 +1520,24 @@ |`moveTo`| Function | Lobah Mikhail | in progress | |`quadraticCurveTo`| Function | Lobah Mikhail | in progress | |`rect`| Function | Lobah Mikhail | in progress | -|*Path2D*| *Class* | | | -|`addPath`| Function | | | +|*Path2D*| *Class* | | | +|`addPath`| Function | | | |*CanvasPattern*| *Class* | Vadim Voronov | in progress | |`setTransform`| Function | Vadim Voronov | in progress | -|*ImageBitmap*| *Class* | | | -|`close`| Function | | | -|`getHeight`| Function | | | -|`getWidth`| Function | | | +|*ImageBitmap*| *Class* | Pavelyev Ivan | in progress | +|`close`| Function | Pavelyev Ivan | in progress | +|`getHeight`| Function | Pavelyev Ivan | in progress | +|`getWidth`| Function | Pavelyev Ivan | in progress | |*CanvasRenderer*| *Class* | Vadim Voronov | in progress | |`drawImage`| Function | Vadim Voronov | blocked IDL | |`beginPath`| Function | Vadim Voronov | done | -|`clip`| Function | Vadim Voronov | in progress | -|`fill`| Function | Vadim Voronov | in progress | +|`clip`| Function | Vadim Voronov | blocked IDL | +|`fill`| Function | Vadim Voronov | blocked IDL | |`stroke`| Function | Vadim Voronov | in progress | -|`createLinearGradient`| Function | Vadim Voronov | in progress | -|`createPattern`| Function | Vadim Voronov | in progress | -|`createRadialGradient`| Function | Vadim Voronov | in progress | -|`createConicGradient`| Function | Vadim Voronov | in progress | +|`createLinearGradient`| Function | Vadim Voronov | blocked IDL | +|`createPattern`| Function | Vadim Voronov | blocked IDL | +|`createRadialGradient`| Function | Vadim Voronov | blocked IDL | +|`createConicGradient`| Function | Vadim Voronov | blocked IDL | |`createImageData`| Function | Vadim Voronov | blocked IDL | |`getImageData`| Function | Vadim Voronov | blocked IDL | |`getPixelMap`| Function | Vadim Voronov | in progress | @@ -1550,21 +1550,21 @@ |`restore`| Function | Vadim Voronov | done | |`save`| Function | Vadim Voronov | done | |`fillText`| Function | Vadim Voronov | done | -|`measureText`| Function | Vadim Voronov | in progress | +|`measureText`| Function | Vadim Voronov | blocked IDL | |`strokeText`| Function | Vadim Voronov | done | -|`getTransform`| Function | Vadim Voronov | in progress | +|`getTransform`| Function | Vadim Voronov | blocked IDL | |`resetTransform`| Function | Vadim Voronov | done | |`rotate`| Function | Vadim Voronov | done | |`scale`| Function | Vadim Voronov | done | -|`setTransform`| Function | Vadim Voronov | done | +|`setTransform`| Function | Vadim Voronov | in progress | |`transform`| Function | Vadim Voronov | done | |`translate`| Function | Vadim Voronov | done | -|`setPixelMap`| Function | Vadim Voronov | blocked IDL | +|`setPixelMap`| Function | Vadim Voronov | in progress | |`transferFromImageBitmap`| Function | Vadim Voronov | in progress | |`saveLayer`| Function | Vadim Voronov | done | |`restoreLayer`| Function | Vadim Voronov | done | |`reset`| Function | Vadim Voronov | done | -|`getGlobalAlpha`| Function | Vadim Voronov | in progress | +|`getGlobalAlpha`| Function | Vadim Voronov | blocked AceEngine | |`setGlobalAlpha`| Function | Vadim Voronov | done | |`getGlobalCompositeOperation`| Function | Vadim Voronov | blocked IDL | |`setGlobalCompositeOperation`| Function | Vadim Voronov | done | @@ -1572,38 +1572,38 @@ |`setStrokeStyle`| Function | Vadim Voronov | in progress | |`getFilter`| Function | Vadim Voronov | blocked IDL | |`setFilter`| Function | Vadim Voronov | done | -|`getImageSmoothingEnabled`| Function | Vadim Voronov | in progress | -|`setImageSmoothingEnabled`| Function | Vadim Voronov | in progress | -|`getImageSmoothingQuality`| Function | Vadim Voronov | in progress | -|`setImageSmoothingQuality`| Function | Vadim Voronov | in progress | -|`getLineCap`| Function | Vadim Voronov | in progress | -|`setLineCap`| Function | Vadim Voronov | in progress | -|`getLineDashOffset`| Function | Vadim Voronov | in progress | -|`setLineDashOffset`| Function | Vadim Voronov | in progress | -|`getLineJoin`| Function | Vadim Voronov | in progress | -|`setLineJoin`| Function | Vadim Voronov | in progress | -|`getLineWidth`| Function | Vadim Voronov | in progress | -|`setLineWidth`| Function | Vadim Voronov | in progress | -|`getMiterLimit`| Function | Vadim Voronov | in progress | -|`setMiterLimit`| Function | Vadim Voronov | in progress | -|`getShadowBlur`| Function | Vadim Voronov | in progress | -|`setShadowBlur`| Function | Vadim Voronov | in progress | +|`getImageSmoothingEnabled`| Function | Vadim Voronov | blocked AceEngine | +|`setImageSmoothingEnabled`| Function | Vadim Voronov | done | +|`getImageSmoothingQuality`| Function | Vadim Voronov | blocked IDL | +|`setImageSmoothingQuality`| Function | Vadim Voronov | blocked IDL | +|`getLineCap`| Function | Vadim Voronov | blocked IDL | +|`setLineCap`| Function | Vadim Voronov | blocked IDL | +|`getLineDashOffset`| Function | Vadim Voronov | blocked AceEngine | +|`setLineDashOffset`| Function | Vadim Voronov | done | +|`getLineJoin`| Function | Vadim Voronov | blocked IDL | +|`setLineJoin`| Function | Vadim Voronov | blocked IDL | +|`getLineWidth`| Function | Vadim Voronov | blocked AceEngine | +|`setLineWidth`| Function | Vadim Voronov | done | +|`getMiterLimit`| Function | Vadim Voronov | blocked AceEngine | +|`setMiterLimit`| Function | Vadim Voronov | done | +|`getShadowBlur`| Function | Vadim Voronov | blocked AceEngine | +|`setShadowBlur`| Function | Vadim Voronov | done | |`getShadowColor`| Function | Vadim Voronov | blocked IDL | -|`setShadowColor`| Function | Vadim Voronov | in progress | -|`getShadowOffsetX`| Function | Vadim Voronov | in progress | -|`setShadowOffsetX`| Function | Vadim Voronov | in progress | -|`getShadowOffsetY`| Function | Vadim Voronov | in progress | -|`setShadowOffsetY`| Function | Vadim Voronov | in progress | -|`getDirection`| Function | Vadim Voronov | in progress | -|`setDirection`| Function | Vadim Voronov | in progress | +|`setShadowColor`| Function | Vadim Voronov | done | +|`getShadowOffsetX`| Function | Vadim Voronov | blocked AceEngine | +|`setShadowOffsetX`| Function | Vadim Voronov | done | +|`getShadowOffsetY`| Function | Vadim Voronov | blocked AceEngine | +|`setShadowOffsetY`| Function | Vadim Voronov | done | +|`getDirection`| Function | Vadim Voronov | blocked IDL | +|`setDirection`| Function | Vadim Voronov | blocked IDL | |`getFont`| Function | Vadim Voronov | blocked IDL | |`setFont`| Function | Vadim Voronov | in progress | -|`getTextAlign`| Function | Vadim Voronov | in progress | -|`setTextAlign`| Function | Vadim Voronov | in progress | -|`getTextBaseline`| Function | Vadim Voronov | in progress | -|`setTextBaseline`| Function | Vadim Voronov | in progress | -|*CanvasRenderingContext2D*| *Class* | Vadim Voronov | blocked | -|`toDataURL`| Function | Vadim Voronov | blocked IDL | +|`getTextAlign`| Function | Vadim Voronov | blocked IDL | +|`setTextAlign`| Function | Vadim Voronov | blocked IDL | +|`getTextBaseline`| Function | Vadim Voronov | blocked IDL | +|`setTextBaseline`| Function | Vadim Voronov | blocked IDL | +|*CanvasRenderingContext2D*| *Class* | Vadim Voronov | in progress | +|`toDataURL`| Function | Vadim Voronov | in progress | |`startImageAnalyzer`| Function | Vadim Voronov | done | |`stopImageAnalyzer`| Function | Vadim Voronov | done | |`onOnAttach`| Function | Vadim Voronov | in progress | @@ -1612,99 +1612,94 @@ |`offOnDetach`| Function | Vadim Voronov | in progress | |`getHeight`| Function | Vadim Voronov | done | |`getWidth`| Function | Vadim Voronov | done | -|*DrawingRenderingContext*| *Class* | Vadim Voronov | blocked | -|`invalidate`| Function | Vadim Voronov | blocked IDL | -|*ICurve*| *Class* | | | -|`interpolate`| Function | | | -|*DrawModifier*| *Class* | | | -|`drawBehind`| Function | | | -|`drawContent`| Function | | | -|`drawFront`| Function | | | -|`invalidate`| Function | | | -|*TransitionEffect*| *Class* | | | -|`translate`| Function | | | -|`rotate`| Function | | | -|`scale`| Function | | | -|`opacity`| Function | | | -|`move`| Function | | | -|`asymmetric`| Function | | | -|`animation`| Function | | | -|`combine`| Function | | | -|*PixelMapMock*| *Class* | | | -|`release`| Function | | | -|*ProgressMask*| *Class* | | | -|`updateProgress`| Function | | | -|`updateColor`| Function | | | -|`enableBreathingAnimation`| Function | | | -|*AttributeModifier*| *Class* | | | -|`applyNormalAttribute`| Function | | | -|`applyPressedAttribute`| Function | | | -|`applyFocusedAttribute`| Function | | | -|`applyDisabledAttribute`| Function | | | -|`applySelectedAttribute`| Function | | | -|*ContentModifier*| *Class* | | | -|`applyContent`| Function | | | -|*Measurable*| *Class* | | | -|`measure`| Function | | | -|`getMargin`| Function | | | -|`getPadding`| Function | | | -|`getBorderWidth`| Function | | | -|*View*| *Class* | | | -|`create`| Function | | | -|*TextContentControllerBase*| *Class* | | | -|`getCaretOffset`| Function | | | -|`getTextContentRect`| Function | | | -|`getTextContentLineCount`| Function | | | -|*DynamicNode*| *Class* | | | -|`onMove`| Function | | | -|*ChildrenMainSize*| *Class* | Morozov Sergey | in progress | +|*DrawingRenderingContext*| *Class* | Vadim Voronov | in progress | +|`invalidate`| Function | Vadim Voronov | in progress | +|*ICurve*| *Class* | | | +|`interpolate`| Function | | | +|*DrawModifier*| *Class* | | | +|`drawBehind`| Function | | | +|`drawContent`| Function | | | +|`drawFront`| Function | | | +|`invalidate`| Function | | | +|*TransitionEffect*| *Class* | | | +|`translate`| Function | | | +|`rotate`| Function | | | +|`scale`| Function | | | +|`opacity`| Function | | | +|`move`| Function | | | +|`asymmetric`| Function | | | +|`animation`| Function | | | +|`combine`| Function | | | +|*PixelMapMock*| *Class* | | | +|`release`| Function | | | +|*ProgressMask*| *Class* | | | +|`updateProgress`| Function | | | +|`updateColor`| Function | | | +|`enableBreathingAnimation`| Function | | | +|*AttributeModifier*| *Class* | | | +|`applyNormalAttribute`| Function | | | +|`applyPressedAttribute`| Function | | | +|`applyFocusedAttribute`| Function | | | +|`applyDisabledAttribute`| Function | | | +|`applySelectedAttribute`| Function | | | +|*ContentModifier*| *Class* | | | +|`applyContent`| Function | | | +|*View*| *Class* | | | +|`create`| Function | | | +|*TextContentControllerBase*| *Class* | | | +|`getCaretOffset`| Function | | | +|`getTextContentRect`| Function | | | +|`getTextContentLineCount`| Function | | | +|*DynamicNode*| *Class* | | | +|`onMove`| Function | | | +|*ChildrenMainSize*| *Class* | Morozov Sergey | blocked Arkoala | |`splice`| Function | Morozov Sergey | in progress | |`update`| Function | Morozov Sergey | in progress | -|`getChildDefaultSize`| Function | Morozov Sergey | in progress | -|*GestureModifier*| *Class* | | | -|`applyGesture`| Function | | | -|*AbstractProperty*| *Class* | | | -|`get`| Function | | | -|`set`| Function | | | -|`info`| Function | | | -|*IPropertySubscriber*| *Class* | | | -|`id`| Function | | | -|`aboutToBeDeleted`| Function | | | -|*ISinglePropertyChangeSubscriber*| *Class* | | | -|`hasChanged`| Function | | | -|*SubscribaleAbstract*| *Class* | | | -|`notifyPropertyHasChanged`| Function | | | -|`addOwningProperty`| Function | | | -|`removeOwningProperty`| Function | | | -|`removeOwningPropertyById`| Function | | | -|*ContextMenu*| *Class* | | | -|`close`| Function | | | +|`getChildDefaultSize`| Function | Morozov Sergey | blocked Arkoala | +|*GestureModifier*| *Class* | | | +|`applyGesture`| Function | | | +|*AbstractProperty*| *Class* | | | +|`get`| Function | | | +|`set`| Function | | | +|`info`| Function | | | +|*IPropertySubscriber*| *Class* | | | +|`id`| Function | | | +|`aboutToBeDeleted`| Function | | | +|*ISinglePropertyChangeSubscriber*| *Class* | | | +|`hasChanged`| Function | | | +|*SubscribaleAbstract*| *Class* | | | +|`notifyPropertyHasChanged`| Function | | | +|`addOwningProperty`| Function | | | +|`removeOwningProperty`| Function | | | +|`removeOwningPropertyById`| Function | | | +|*ContextMenu*| *Class* | | | +|`close`| Function | | | |*CustomDialogController*| *Class* | Erokhin Ilya | blocked | |`open`| Function | Erokhin Ilya | blocked IDL | |`close`| Function | Erokhin Ilya | blocked IDL | -|*DatePickerDialog*| *Class* | | | -|`show`| Function | | | -|*PanGestureOptions*| *Class* | | | -|`setDirection`| Function | | | -|`setDistance`| Function | | | -|`setFingers`| Function | | | -|`getDirection`| Function | | | -|*ScrollableTargetInfo*| *Class* | | | -|`isBegin`| Function | | | -|`isEnd`| Function | | | -|*EventTargetInfo*| *Class* | | | -|`getId`| Function | | | -|*GestureRecognizer*| *Class* | | | -|`getTag`| Function | | | -|`getType`| Function | | | -|`isBuiltIn`| Function | | | -|`setEnabled`| Function | | | -|`isEnabled`| Function | | | -|`getState`| Function | | | -|`getEventTargetInfo`| Function | | | -|`isValid`| Function | | | -|*PanRecognizer*| *Class* | | | -|`getPanGestureOptions`| Function | | | +|*DatePickerDialog*| *Class* | | | +|`show`| Function | | | +|*PanGestureOptions*| *Class* | | | +|`setDirection`| Function | | | +|`setDistance`| Function | | | +|`setFingers`| Function | | | +|`getDirection`| Function | | | +|*ScrollableTargetInfo*| *Class* | | | +|`isBegin`| Function | | | +|`isEnd`| Function | | | +|*EventTargetInfo*| *Class* | | | +|`getId`| Function | | | +|*GestureRecognizer*| *Class* | Kovalev Sergey | in progress | +|`getTag`| Function | Kovalev Sergey | blocked IDL | +|`getType`| Function | Kovalev Sergey | blocked IDL | +|`isBuiltIn`| Function | Kovalev Sergey | in progress | +|`setEnabled`| Function | Kovalev Sergey | in progress | +|`isEnabled`| Function | Kovalev Sergey | in progress | +|`getState`| Function | Kovalev Sergey | in progress | +|`getEventTargetInfo`| Function | Kovalev Sergey | blocked IDL | +|`isValid`| Function | Kovalev Sergey | in progress | +|*PanRecognizer*| *Class* | | | +|`getPanGestureOptions`| Function | | | |*ImageAnalyzerController*| *Class* | Vadim Voronov | blocked | |`getImageAnalyzerSupportTypes`| Function | Vadim Voronov | blocked IDL | |*ListScroller*| *Class* | Morozov Sergey | blocked | @@ -1712,31 +1707,31 @@ |`scrollToItemInGroup`| Function | Morozov Sergey | done | |`closeAllSwipeActions`| Function | Morozov Sergey | blocked IDL | |`getVisibleListContentInfo`| Function | Morozov Sergey | blocked IDL | -|*Matrix2D*| *Class* | | | -|`identity`| Function | | | -|`invert`| Function | | | -|`multiply`| Function | | | -|`rotate`| Function | | | -|`translate`| Function | | | -|`scale`| Function | | | -|`getScaleX`| Function | | | -|`setScaleX`| Function | | | -|`getRotateY`| Function | | | -|`setRotateY`| Function | | | -|`getRotateX`| Function | | | -|`setRotateX`| Function | | | -|`getScaleY`| Function | | | -|`setScaleY`| Function | | | -|`getTranslateX`| Function | | | -|`setTranslateX`| Function | | | -|`getTranslateY`| Function | | | -|`setTranslateY`| Function | | | -|*NavDestinationContext*| *Class* | | | -|`getConfigInRouteMap`| Function | | | -|`setPathInfo`| Function | | | -|`setPathStack`| Function | | | -|`getNavDestinationId`| Function | | | -|`setNavDestinationId`| Function | | | +|*Matrix2D*| *Class* | | | +|`identity`| Function | | | +|`invert`| Function | | | +|`multiply`| Function | | | +|`rotate`| Function | | | +|`translate`| Function | | | +|`scale`| Function | | | +|`getScaleX`| Function | | | +|`setScaleX`| Function | | | +|`getRotateY`| Function | | | +|`setRotateY`| Function | | | +|`getRotateX`| Function | | | +|`setRotateX`| Function | | | +|`getScaleY`| Function | | | +|`setScaleY`| Function | | | +|`getTranslateX`| Function | | | +|`setTranslateX`| Function | | | +|`getTranslateY`| Function | | | +|`setTranslateY`| Function | | | +|*NavDestinationContext*| *Class* | | | +|`getConfigInRouteMap`| Function | | | +|`setPathInfo`| Function | | | +|`setPathStack`| Function | | | +|`getNavDestinationId`| Function | | | +|`setNavDestinationId`| Function | | | |*NavPathStack*| *Class* | Morozov Sergey | in progress | |`pushPath`| Function | Morozov Sergey | in progress | |`pushDestination`| Function | Morozov Sergey | in progress | @@ -1762,14 +1757,14 @@ |`size`| Function | Morozov Sergey | in progress | |`disableAnimation`| Function | Morozov Sergey | in progress | |`setInterception`| Function | Morozov Sergey | in progress | -|*NavigationTransitionProxy*| *Class* | | | -|`finishTransition`| Function | | | -|`cancelTransition`| Function | | | -|`updateTransition`| Function | | | -|`setFrom`| Function | | | -|`setTo`| Function | | | -|`getIsInteractive`| Function | | | -|`setIsInteractive`| Function | | | +|*NavigationTransitionProxy*| *Class* | | | +|`finishTransition`| Function | | | +|`cancelTransition`| Function | | | +|`updateTransition`| Function | | | +|`setFrom`| Function | | | +|`setTo`| Function | | | +|`getIsInteractive`| Function | | | +|`setIsInteractive`| Function | | | |*PatternLockController*| *Class* | Dmitry A Smirnov | done | |`reset`| Function | Dmitry A Smirnov | done | |`setChallengeResult`| Function | Dmitry A Smirnov | done | @@ -1808,7 +1803,7 @@ |`fling`| Function | Erokhin Ilya | done | |`scrollPage`| Function | Erokhin Ilya | done | |`currentOffset`| Function | Erokhin Ilya | blocked IDL | -|`scrollToIndex`| Function | Erokhin Ilya | blocked IDL | +|`scrollToIndex`| Function | Erokhin Ilya | in progress | |`scrollBy`| Function | Erokhin Ilya | done | |`isAtEnd`| Function | Erokhin Ilya | done | |`getItemRect`| Function | Erokhin Ilya | blocked IDL | @@ -1847,10 +1842,10 @@ |`setFrom`| Function | | | |`getTo`| Function | | | |`setTo`| Function | | | -|*TextController*| *Class* | | | -|`closeSelectionMenu`| Function | | | -|`setStyledString`| Function | | | -|`getLayoutManager`| Function | | | +|*TextController*| *Class* | | | +|`closeSelectionMenu`| Function | | | +|`setStyledString`| Function | | | +|`getLayoutManager`| Function | | | |*TextAreaController*| *Class* | Tuzhilkin Ivan | in progress | |`caretPosition`| Function | Tuzhilkin Ivan | in progress | |`setTextSelection`| Function | Tuzhilkin Ivan | in progress | @@ -1858,24 +1853,24 @@ |*TextClockController*| *Class* | Pavelyev Ivan | in progress | |`start`| Function | Pavelyev Ivan | in progress | |`stop`| Function | Pavelyev Ivan | in progress | -|*TextBaseController*| *Class* | | | -|`setSelection`| Function | | | -|`closeSelectionMenu`| Function | | | -|`getLayoutManager`| Function | | | -|*TextEditControllerEx*| *Class* | | | -|`isEditing`| Function | | | -|`stopEditing`| Function | | | -|`setCaretOffset`| Function | | | -|`getCaretOffset`| Function | | | -|`getPreviewText`| Function | | | -|*StyledStringController*| *Class* | | | -|`setStyledString`| Function | | | -|`getStyledString`| Function | | | -|*LayoutManager*| *Class* | | | -|`getLineCount`| Function | | | -|`getGlyphPositionAtCoordinate`| Function | | | -|`getLineMetrics`| Function | | | -|`getRectsForRange`| Function | | | +|*TextBaseController*| *Class* | | | +|`setSelection`| Function | | | +|`closeSelectionMenu`| Function | | | +|`getLayoutManager`| Function | | | +|*TextEditControllerEx*| *Class* | | | +|`isEditing`| Function | | | +|`stopEditing`| Function | | | +|`setCaretOffset`| Function | | | +|`getCaretOffset`| Function | | | +|`getPreviewText`| Function | | | +|*StyledStringController*| *Class* | | | +|`setStyledString`| Function | | | +|`getStyledString`| Function | | | +|*LayoutManager*| *Class* | | | +|`getLineCount`| Function | | | +|`getGlyphPositionAtCoordinate`| Function | | | +|`getLineMetrics`| Function | | | +|`getRectsForRange`| Function | | | |*EditMenuOptions*| *Class* | Erokhin Ilya | in progress | |`onCreateMenu`| Function | Erokhin Ilya | in progress | |`onMenuItemClick`| Function | Erokhin Ilya | in progress | @@ -1883,14 +1878,14 @@ |`caretPosition`| Function | Spirin Andrey | in progress | |`setTextSelection`| Function | Spirin Andrey | in progress | |`stopEditing`| Function | Spirin Andrey | in progress | -|*TextPickerDialog*| *Class* | | | -|`show`| Function | | | -|*TextTimerController*| *Class* | Ekaterina Stepanova | in progress | -|`start`| Function | Ekaterina Stepanova | in progress | -|`pause`| Function | Ekaterina Stepanova | in progress | -|`reset`| Function | Ekaterina Stepanova | in progress | -|*TimePickerDialog*| *Class* | | | -|`show`| Function | | | +|*TextPickerDialog*| *Class* | | | +|`show`| Function | | | +|*TextTimerController*| *Class* | Ekaterina Stepanova | done | +|`start`| Function | Ekaterina Stepanova | done | +|`pause`| Function | Ekaterina Stepanova | done | +|`reset`| Function | Ekaterina Stepanova | done | +|*TimePickerDialog*| *Class* | | | +|`show`| Function | | | |*VideoController*| *Class* | Erokhin Ilya | done | |`start`| Function | Erokhin Ilya | done | |`pause`| Function | Erokhin Ilya | done | @@ -2023,58 +2018,58 @@ |`backward`| Function | Erokhin Ilya | done | |`forward`| Function | Erokhin Ilya | done | |`getCookieManager`| Function | Erokhin Ilya | done | -|*XComponentController*| *Class* | | | -|`getXComponentSurfaceId`| Function | | | -|`getXComponentContext`| Function | | | -|`setXComponentSurfaceSize`| Function | | | -|`setXComponentSurfaceRect`| Function | | | -|`getXComponentSurfaceRect`| Function | | | -|`setXComponentSurfaceRotation`| Function | | | -|`getXComponentSurfaceRotation`| Function | | | -|`onSurfaceCreated`| Function | | | -|`onSurfaceChanged`| Function | | | -|`onSurfaceDestroyed`| Function | | | -|`startImageAnalyzer`| Function | | | -|`stopImageAnalyzer`| Function | | | -|*WaterFlowSections*| *Class* | | | -|`splice`| Function | | | -|`push`| Function | | | -|`update`| Function | | | -|`values`| Function | | | -|`length`| Function | | | -|*UIExtensionProxy*| *Class* | | | -|`send`| Function | | | -|`sendSync`| Function | | | -|`onAsyncReceiverRegister`| Function | | | -|`onSyncReceiverRegister`| Function | | | -|`offAsyncReceiverRegister`| Function | | | -|`offSyncReceiverRegister`| Function | | | -|*StyledString*| *Class* | | | -|`getString`| Function | | | -|`getStyles`| Function | | | -|`equals`| Function | | | -|`subStyledString`| Function | | | -|`fromHtml`| Function | | | -|`toHtml`| Function | | | -|`marshalling`| Function | | | -|`unmarshalling`| Function | | | -|`getLength`| Function | | | -|*MutableStyledString*| *Class* | | | -|`replaceString`| Function | | | -|`insertString`| Function | | | -|`removeString`| Function | | | -|`replaceStyle`| Function | | | -|`setStyle`| Function | | | -|`removeStyle`| Function | | | -|`removeStyles`| Function | | | -|`clearStyles`| Function | | | -|`replaceStyledString`| Function | | | -|`insertStyledString`| Function | | | -|`appendStyledString`| Function | | | -|*CustomSpan*| *Class* | Politov Mikhail | in progress | -|`onMeasure`| Function | Politov Mikhail | in progress | -|`onDraw`| Function | Politov Mikhail | in progress | -|`invalidate`| Function | Politov Mikhail | in progress | +|*XComponentController*| *Class* | | | +|`getXComponentSurfaceId`| Function | | | +|`getXComponentContext`| Function | | | +|`setXComponentSurfaceSize`| Function | | | +|`setXComponentSurfaceRect`| Function | | | +|`getXComponentSurfaceRect`| Function | | | +|`setXComponentSurfaceRotation`| Function | | | +|`getXComponentSurfaceRotation`| Function | | | +|`onSurfaceCreated`| Function | | | +|`onSurfaceChanged`| Function | | | +|`onSurfaceDestroyed`| Function | | | +|`startImageAnalyzer`| Function | | | +|`stopImageAnalyzer`| Function | | | +|*WaterFlowSections*| *Class* | | | +|`splice`| Function | | | +|`push`| Function | | | +|`update`| Function | | | +|`values`| Function | | | +|`length`| Function | | | +|*UIExtensionProxy*| *Class* | | | +|`send`| Function | | | +|`sendSync`| Function | | | +|`onAsyncReceiverRegister`| Function | | | +|`onSyncReceiverRegister`| Function | | | +|`offAsyncReceiverRegister`| Function | | | +|`offSyncReceiverRegister`| Function | | | +|*StyledString*| *Class* | | | +|`getString`| Function | | | +|`getStyles`| Function | | | +|`equals`| Function | | | +|`subStyledString`| Function | | | +|`fromHtml`| Function | | | +|`toHtml`| Function | | | +|`marshalling`| Function | | | +|`unmarshalling`| Function | | | +|`getLength`| Function | | | +|*MutableStyledString*| *Class* | | | +|`replaceString`| Function | | | +|`insertString`| Function | | | +|`removeString`| Function | | | +|`replaceStyle`| Function | | | +|`setStyle`| Function | | | +|`removeStyle`| Function | | | +|`removeStyles`| Function | | | +|`clearStyles`| Function | | | +|`replaceStyledString`| Function | | | +|`insertStyledString`| Function | | | +|`appendStyledString`| Function | | | +|*CustomSpan*| *Class* | Politov Mikhail | blocked IDL | +|`onMeasure`| Function | Politov Mikhail | blocked IDL | +|`onDraw`| Function | Politov Mikhail | blocked IDL | +|`invalidate`| Function | Politov Mikhail | blocked IDL | |*LinearIndicatorController*| *Class* | Kovalev Sergey | in progress | |`setProgress`| Function | Kovalev Sergey | in progress | |`start`| Function | Kovalev Sergey | in progress | -- Gitee From 0e0b2884a7c3b23ab7fba2ace4eaa616b08fdd20 Mon Sep 17 00:00:00 2001 From: scherbatiyalexander Date: Fri, 15 Nov 2024 16:18:59 +0000 Subject: [PATCH 16/53] !975 Comment out predefined RectWidthStyle namespase * Comment out predefined RectWidthStyle namespase --- doc/CUSTOMOBJECT.md | 10 +++++++++- predefined/src/arkui-external.idl | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/CUSTOMOBJECT.md b/doc/CUSTOMOBJECT.md index 3d1b941d..a38896f9 100644 --- a/doc/CUSTOMOBJECT.md +++ b/doc/CUSTOMOBJECT.md @@ -33,12 +33,20 @@ node . --dts2idl --input-dir ./interface_sdk-js/api,./interface_sdk-js/api/\@int - find an idl declaration for necessary CustomObject in the `full-idl` dir. For example `RectWidthStyle` declaration is placed in the file `@ohos.graphics.text.idl`: ``` +[Namespace=text] dictionary RectWidthStyle { number TIGHT; number MAX; }; ``` - - copy the `RectWidthStyle` idl declaration to [predefined/src/arkui-external.idl](../predefined/src/arkui-external.idl) file +- comment out the namespace if it exists +``` +/*[Namespace=text]*/ +dictionary RectWidthStyle { + number TIGHT; + number MAX; +}; +``` - push the changes with the idl declaration to the separate branch to check that it passes CI. - push the branch diff --git a/predefined/src/arkui-external.idl b/predefined/src/arkui-external.idl index 0ab3f669..a20a343b 100644 --- a/predefined/src/arkui-external.idl +++ b/predefined/src/arkui-external.idl @@ -15,13 +15,13 @@ interface NodeController {}; [Entity=Class, Interfaces="AttributeModifier", ParentTypeArguments=""] interface TextModifier {}; -[Namespace=text] +/*[Namespace=text]*/ dictionary RectWidthStyle { number TIGHT; number MAX; }; -[Namespace=text] +/*[Namespace=text]*/ dictionary RectHeightStyle { number TIGHT; number MAX; -- Gitee From 79aebf2ebfaccb532864088afa8decbf35ac161e Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Sat, 16 Nov 2024 10:45:08 +0000 Subject: [PATCH 17/53] !980 Handle onWIllScroll/onDidScroll in less intrusive manner * Small cleanup * Better fix for onWillScroll --- external | 2 +- src/IDLVisitor.ts | 17 +++++++++++++++-- .../idl/IdlPeerGeneratorVisitor.ts | 9 --------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/external b/external index babc2e8e..f2b27daa 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit babc2e8ea96f60ef0dd713b84f6061cb146c6658 +Subproject commit f2b27daaa9e0848e3135a3d4598b4eddee5a6549 diff --git a/src/IDLVisitor.ts b/src/IDLVisitor.ts index f01468a5..2695a69b 100644 --- a/src/IDLVisitor.ts +++ b/src/IDLVisitor.ts @@ -1060,10 +1060,24 @@ export class IDLVisitor implements GenericVisitor { this.computeDeprecatedExtendAttributes(property, extendedAttributes) if (ts.isMethodDeclaration(property) || ts.isMethodSignature(property)) { if (!this.isCommonMethodUsedAsProperty(property)) throw new Error("Wrong") + let type = this.serializeType(property.parameters[0].type, nameSuggestion?.extend(nameOrNull(property.parameters[0].name)!)) + if ((escapedName == "onWillScroll" || escapedName == "onDidScroll") && ts.isClassDeclaration(property.parent)) { + let parentName = identName(property.parent.name) + if (parentName == "ScrollableCommonMethod" || parentName == "ScrollAttribute") { + /** + * ScrollableCommonMethod has a method `onWillScroll(handler: Optional): T;` + * ScrollAttribute extends ScrollableCommonMethod and overrides this method as + * `onWillScroll(handler: ScrollOnWillScrollCallback): ScrollAttribute;`. So that override is not + * valid and cannot be correctly processed so we force ScrollOnWillScrollCallback as parameter type. + */ + type = idl.createUnionType([idl.createReferenceType("ScrollOnWillScrollCallback"), idl.IDLUndefinedType]) + console.log(`WARNING: forcing type of ${parentName}.${escapedName} to ScrollOnWillScrollCallback|undefined`) + } + } extendedAttributes.push({ name: idl.IDLExtendedAttributes.CommonMethod }) return idl.createProperty( escapedName, - this.serializeType(property.parameters[0].type, nameSuggestion?.extend(nameOrNull(property.parameters[0].name)!)), + type, false, false, isDefined(property.parameters[0].questionToken), { @@ -1179,7 +1193,6 @@ export class IDLVisitor implements GenericVisitor { this.computeDeprecatedExtendAttributes(method, extendedAttributes) this.computeExportAttribute(method, extendedAttributes) let [methodName, escapedMethodName] = escapeName(nameOrNull(method.name) ?? "_unknown") - let dtsNameAttributeAccounted: boolean = !!extendedAttributes.find(ea => ea.name == idl.IDLExtendedAttributes.DtsName) const methodParameters = method.parameters.filter((param, paramIndex) : boolean => { const paramName = nameOrNull(param.name) diff --git a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts index bf590532..dccdfde0 100644 --- a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts +++ b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts @@ -695,15 +695,6 @@ class PeersGenerator { private processProperty(prop: idl.IDLProperty, peer: PeerClass, parentName?: string): PeerMethod | undefined { if (PeerGeneratorConfig.ignorePeerMethod.includes(prop.name)) return - if (prop.name === "onWillScroll" || prop.name === "onDidScroll") { - /** - * ScrollableCommonMethod has a method `onWillScroll(handler: Optional): T;` - * ScrollAttribute extends ScrollableCommonMethod and overrides this method as - * `onWillScroll(handler: ScrollOnWillScrollCallback): ScrollAttribute;`. So that override is not - * valid and cannot be correctly processed and we want to stub this for now. - */ - prop.type = idl.IDLAnyType - } this.library.requestType(prop.type, this.library.shouldGenerateComponent(peer.componentName)) const originalParentName = parentName ?? peer.originalClassName! const argConvertor = this.library.typeConvertor("value", prop.type, prop.isOptional) -- Gitee From 002da9ca0f4936fdf5a72dc507f29cfbdcd3039a Mon Sep 17 00:00:00 2001 From: zakalyukinalexander_ac40 Date: Mon, 18 Nov 2024 08:17:42 +0000 Subject: [PATCH 18/53] update doc/DEMOS_STATUS.md. Signed-off-by: zakalyukinalexander_ac40 --- doc/DEMOS_STATUS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/DEMOS_STATUS.md b/doc/DEMOS_STATUS.md index 56bd9ea6..8bcc1450 100644 --- a/doc/DEMOS_STATUS.md +++ b/doc/DEMOS_STATUS.md @@ -152,8 +152,8 @@ | `scrollBar` | Function | | WON | Kirill Berezin | in progress | | | Medium | | `onScroll` | Function | | WON | Kirill Berezin | done | | | Medium | | `onScrollEdge` | Function | | WON | Kirill Berezin | in progress | | | Medium | -| Video | Component | | | Erokhin Ilya | blocked | | | | -| `controller, src` | Options | | WON | Erokhin Ilya | blocked AceEngine| | | Low | +| Video | Component | | | Erokhin Ilya | done | | | | +| `controller, src` | Options | | WON | Erokhin Ilya | done | | | Low | | `autoPlay` | Function | | WON | Erokhin Ilya | done | | | Low | | Search | Component | | | Evstigneev Roman | in progress | | | | | `placeholderColor` | Function | | WON | Evstigneev Roman | done | | | Low | -- Gitee From 024e7c65278d3cae8a86e80d3c5e6bc053996ac3 Mon Sep 17 00:00:00 2001 From: pavelmironchik Date: Mon, 18 Nov 2024 09:06:40 +0000 Subject: [PATCH 19/53] !978 Remove default CI npm registry to optimize packages install --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 348b693d..d92c47fe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,6 @@ variables: .setup: script: - - npm config set registry https://repo.huaweicloud.com/repository/npm/ - npm config set @ohos:registry https://repo.harmonyos.com/npm/ - npm config set @koalaui:registry https://nexus.bz-openlab.ru:10443/repository/koala-npm/ - npm config set @panda:registry https://nexus.bz-openlab.ru:10443/repository/koala-npm/ -- Gitee From bd06eee479b2b310ae5c6b7f2fbd7156216f0cc1 Mon Sep 17 00:00:00 2001 From: scherbatiyalexander Date: Mon, 18 Nov 2024 10:22:16 +0000 Subject: [PATCH 20/53] =?UTF-8?q?!981=20Fix=20component=20methods=20return?= =?UTF-8?q?=20type=20index-full.d.ts=20*=20Fix=20empty=20type=20params=20a?= =?UTF-8?q?rray=20check=20for=20dts=20property=20printing=20*=20Check=20fo?= =?UTF-8?q?r=20this=20return=20type=20for=20component=20methods=20*=20Remo?= =?UTF-8?q?ve=20serializeTypeOrThis()=20from=20IDLVisitor=20to=20not=20cha?= =?UTF-8?q?nge=20the=20idl=20typ=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/IDLVisitor.ts | 32 +------------------ src/from-idl/DtsPrinter.ts | 3 +- .../idl/IdlPeerGeneratorVisitor.ts | 10 +++--- 3 files changed, 9 insertions(+), 36 deletions(-) diff --git a/src/IDLVisitor.ts b/src/IDLVisitor.ts index 2695a69b..d27f3509 100644 --- a/src/IDLVisitor.ts +++ b/src/IDLVisitor.ts @@ -797,36 +797,6 @@ export class IDLVisitor implements GenericVisitor { } } - - // Check if particular place is suitable for conversion of return type to `this` type. - private isSuitableForThisConversion(owner: ts.ClassDeclaration | ts.ObjectTypeDeclaration | ts.InterfaceDeclaration | ts.Node) { - let result = false - if (ts.isClassDeclaration(owner)) - result ||= isCommonMethodOrSubclass(this.typeChecker, owner) - if (ts.isInterfaceDeclaration(owner) || ts.isClassDeclaration(owner)) - result ||= PeerGeneratorConfig.builderClasses.includes(identName(owner.name)!) - return result - } - - private serializeTypeOrThis( - method: ts.MethodDeclaration | ts.MethodSignature | ts.FunctionDeclaration | ts.CallSignatureDeclaration | ts.ConstructorDeclaration | ts.ConstructSignatureDeclaration | ts.IndexSignatureDeclaration, - nameSuggestion?: NameSuggestion - ): idl.IDLType { - let type = this.serializeType(method.type, nameSuggestion) - - if (!this.isSuitableForThisConversion(method.parent)) return type - - let className = this.ownerName(method) - // We use `this` IDL type when converting builder methods of UI nodes or similar types. - let retTypeName = idl.isNamedNode(type) ? idl.forceAsNamedNode(type).name : undefined - const isMethodStatic = method.modifiers?.some(mod => mod.kind === ts.SyntaxKind.StaticKeyword) - - if (!isMethodStatic && ((retTypeName == className) || retTypeName === 'T')) - return idl.IDLThisType - else - return type - } - serializeType(type: ts.TypeNode | undefined, nameSuggestion?: NameSuggestion): idl.IDLType { if (type == undefined) return idl.IDLUndefinedType // TODO: can we have implicit types in d.ts? @@ -1277,7 +1247,7 @@ export class IDLVisitor implements GenericVisitor { }) } this.computeClassMemberExtendedAttributes(method as ts.ClassElement, methodName, escapedMethodName, extendedAttributes) - let returnType = this.serializeTypeOrThis(method, nameSuggestion?.extend('ret')) + const returnType = this.serializeType(method.type, nameSuggestion?.extend('ret')) return idl.createMethod( escapedMethodName, methodParameters.map(it => this.serializeParameter(it, nameSuggestion)), diff --git a/src/from-idl/DtsPrinter.ts b/src/from-idl/DtsPrinter.ts index 933325e1..84d04334 100644 --- a/src/from-idl/DtsPrinter.ts +++ b/src/from-idl/DtsPrinter.ts @@ -184,7 +184,8 @@ export class CustomPrintVisitor { const isCommonMethod = hasExtAttribute(node, IDLExtendedAttributes.CommonMethod) let isProtected = hasExtAttribute(node, IDLExtendedAttributes.Protected) if (isCommonMethod) { - const returnType = this.currentInterface?.typeParameters ? this.currentInterface.typeParameters[0] : this.currentInterface!.name + const typeParams = this.currentInterface?.typeParameters + const returnType = typeParams && typeParams.length > 0 ? typeParams[0] : this.currentInterface!.name this.print(`${getName(node)}(value: ${this.printTypeForTS(node.type, undefined, undefined, isCommonMethod)}): ${returnType};`) } else if (hasExtAttribute(node, IDLExtendedAttributes.Accessor)) { const accessorName = getExtAttribute(node, IDLExtendedAttributes.Accessor) diff --git a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts index dccdfde0..eed77952 100644 --- a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts +++ b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts @@ -715,17 +715,18 @@ class PeersGenerator { // E.g. ButtonInterface instead of ButtonAttribute const isCallSignature = idl.isCallable(method) const methodName = isCallSignature ? `set${peer.componentName}Options` : method.name - if (isCallSignature) method.returnType = idl.IDLVoidType + const retType = method.returnType! + const isThisRet = isCallSignature || idl.isNamedNode(retType) && (retType.name === peer.originalClassName || retType.name === "T") const originalParentName = parentName ?? peer.originalClassName! const argConvertors = method.parameters.map(param => generateArgConvertor(this.library, param)) method.parameters.forEach(param => { this.library.requestType(param.type!, this.library.shouldGenerateComponent(peer.componentName)) }) - const signature = generateSignature(method) + const signature = generateSignature(method, isThisRet ? idl.IDLThisType : retType) return new PeerMethod( originalParentName, argConvertors, - generateRetConvertor(method.returnType), + generateRetConvertor(isThisRet ? idl.IDLVoidType : retType), isCallSignature, new Method(methodName!, signature, method.isStatic ? [MethodModifier.STATIC] : [])) } @@ -1327,9 +1328,10 @@ export function isSourceDecl(node: idl.IDLEntry): boolean { function generateSignature( method: idl.IDLCallable | idl.IDLMethod | idl.IDLConstructor, + returnType?: idl.IDLType ): NamedMethodSignature { return new NamedMethodSignature( - method.returnType!, + returnType ?? method.returnType!, method.parameters.map(it => maybeOptional(it.type!, it.isOptional)), method.parameters.map(it => it.name) ) -- Gitee From d2e97dd034fb66c31a72a8efbfd930b2a48c3346 Mon Sep 17 00:00:00 2001 From: Aleksandr Veselov Date: Mon, 18 Nov 2024 10:47:36 +0000 Subject: [PATCH 21/53] !971 Fix TS and native generation for xml --- demos/xml/.gitignore | 1 + demos/xml/generated/ts/CallbacksChecker.ts | 4 +- demos/xml/generated/ts/DeserializerBase.ts | 3 +- demos/xml/generated/ts/ResourceManager.ts | 2 - demos/xml/generated/ts/SerializerBase.ts | 2 +- demos/xml/generated/ts/types.ts | 3 +- demos/xml/generated/ts/xml.ts | 35 ++- demos/xml/generated/ts/xmlNative.ts | 39 ++- demos/xml/generated/ts/xmlSerializer.ts | 68 +++--- demos/xml/generated/xml.cc | 150 +++--------- demos/xml/generated/xml.h | 2 + demos/xml/meson.build | 1 + demos/xml/src/cpp/xmlImpl.cc | 124 ++++++++++ demos/xml/src/index.ts | 1 + demos/xml/tsconfig.json | 2 +- src/peer-generation/FileGenerators.ts | 33 +-- src/peer-generation/ImportsCollector.ts | 4 + .../writers/TsLanguageWriter.ts | 9 +- src/peer-generation/OhosGenerator.ts | 180 ++++++++++---- .../printers/SerializerPrinter.ts | 79 ++++-- src/peer-generation/printers/SourceFile.ts | 28 ++- templates/ts/CallbacksChecker.ts | 40 +++ templates/ts/DeserializerBase.ts | 231 ++++++++++++++++++ templates/ts/OHOSNativeModule_template.ts | 2 +- templates/ts/OHOSPeer_template.ts | 2 +- templates/ts/ResourceManager.ts | 65 +++++ templates/ts/SerializerBase.ts | 44 ++-- templates/ts/types.ts | 3 +- 28 files changed, 855 insertions(+), 302 deletions(-) create mode 100644 demos/xml/src/cpp/xmlImpl.cc create mode 100644 templates/ts/CallbacksChecker.ts create mode 100644 templates/ts/DeserializerBase.ts create mode 100644 templates/ts/ResourceManager.ts diff --git a/demos/xml/.gitignore b/demos/xml/.gitignore index 65f096a6..37ff3a21 100644 --- a/demos/xml/.gitignore +++ b/demos/xml/.gitignore @@ -1,3 +1,4 @@ build node_modules .cache +generated/*_template.cc diff --git a/demos/xml/generated/ts/CallbacksChecker.ts b/demos/xml/generated/ts/CallbacksChecker.ts index 71276a62..a4416344 100644 --- a/demos/xml/generated/ts/CallbacksChecker.ts +++ b/demos/xml/generated/ts/CallbacksChecker.ts @@ -1,6 +1,6 @@ -import { Deserializer } from "./xmlSerializer"; -import { deserializeAndCallCallback } from "./xmlSerializer" +import { float32, int32, pointer, Finalizable } from "./types" import { ResourceHolder } from "./ResourceManager" +import { Deserializer, deserializeAndCallCallback } from "./xmlSerializer" import { getXMLNativeModule } from "./xmlNative" enum CallbackEventKind { diff --git a/demos/xml/generated/ts/DeserializerBase.ts b/demos/xml/generated/ts/DeserializerBase.ts index e5ddebc3..cbdb8989 100644 --- a/demos/xml/generated/ts/DeserializerBase.ts +++ b/demos/xml/generated/ts/DeserializerBase.ts @@ -12,8 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {float32, int32 } from "./types" -import {pointer} from "./types" +import {float32, int32, pointer} from "./types" import {RuntimeType, Tags, CallbackResource } from "./SerializerBase"; // import { Length } from "@arkoala/arkui" diff --git a/demos/xml/generated/ts/ResourceManager.ts b/demos/xml/generated/ts/ResourceManager.ts index 1b980a49..c5248bcb 100644 --- a/demos/xml/generated/ts/ResourceManager.ts +++ b/demos/xml/generated/ts/ResourceManager.ts @@ -15,8 +15,6 @@ import { int32 } from "./types" -// todo maybe move this class to @koalaui/interop ? - export type ResourceId = int32 interface ResourceInfo { diff --git a/demos/xml/generated/ts/SerializerBase.ts b/demos/xml/generated/ts/SerializerBase.ts index 74d5de42..d3ae5332 100644 --- a/demos/xml/generated/ts/SerializerBase.ts +++ b/demos/xml/generated/ts/SerializerBase.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { float32, int32, pointer } from "./types" +import { float32, int32, pointer, Finalizable } from "./types" import { getXMLNativeModule as nativeModule, CallbackKind } from "./xmlNative" import { ResourceHolder, ResourceId } from "./ResourceManager" diff --git a/demos/xml/generated/ts/types.ts b/demos/xml/generated/ts/types.ts index a3c400db..8a60088b 100644 --- a/demos/xml/generated/ts/types.ts +++ b/demos/xml/generated/ts/types.ts @@ -1,6 +1,7 @@ export type pointer = bigint export type int32 = number export type float32 = number -export type EventType = number export type KPointer = pointer export type Finalizable = { ptr: pointer } + +export const nullptr: pointer = BigInt(0) diff --git a/demos/xml/generated/ts/xml.ts b/demos/xml/generated/ts/xml.ts index c4378d14..c4050ffd 100644 --- a/demos/xml/generated/ts/xml.ts +++ b/demos/xml/generated/ts/xml.ts @@ -1,7 +1,7 @@ -import { pointer, int32, EventType, KPointer, Finalizable } from "./types" -import { Tags, RuntimeType, runtimeType, isInstanceOf, unsafeCast } from "./SerializerBase" -import { Serializer } from "./xmlSerializer" - +import { pointer, int32, KPointer, Finalizable } from "./types" +import { Tags, RuntimeType, runtimeType, isInstanceOf, unsafeCast } from "./SerializerBase" +import { Serializer } from "./xmlSerializer" + import { XMLNativeModule, getXMLNativeModule, @@ -11,7 +11,22 @@ export interface ParseOptions { ignoreNameSpace?: boolean tagValueCallbackFunction?: ((name: string, value: string) => boolean) attributeValueCallbackFunction?: ((name: string, value: string) => boolean) - tokenValueCallbackFunction?: ((eventType: EventType, value: ParseInfo) => boolean) + tokenValueCallbackFunction?: ((eventType: xml.EventType, value: ParseInfo) => boolean) +} +export namespace xml { + export enum EventType { + START_DOCUMENT = 0, + END_DOCUMENT = 1, + START_TAG = 2, + END_TAG = 3, + TEXT = 4, + CDSECT = 5, + COMMENT = 6, + DOCDECL = 7, + INSTRUCTION = 8, + ENTITY_REFERENCE = 9, + WHITESPACE = 10, + } } export interface XmlSerializerInterface { setAttributes(name: string, value: string): void @@ -102,12 +117,14 @@ export class XmlSerializer implements XmlSerializerInterface { } export class ParseInfo implements ParseInfoInterface { private peer: KPointer - constructor() { - this.peer = getXMLNativeModule()._ParseInfo_ctor() - } getPeer(): Finalizable | undefined { return { ptr: this.peer } } + static construct(ptr: KPointer): ParseInfo { + const objParseInfo: ParseInfo = new ParseInfo() + objParseInfo.peer = ptr + return objParseInfo + } getColumnNumber(): number { const result = getXMLNativeModule()._ParseInfo_getColumnNumber(this.peer) return result @@ -172,4 +189,4 @@ export class XmlPullParser implements XmlPullParserInterface { getXMLNativeModule()._XmlPullParser_parse(this.peer, thisSerializer.asArray(), thisSerializer.length()); thisSerializer.release(); } -} +} diff --git a/demos/xml/generated/ts/xmlNative.ts b/demos/xml/generated/ts/xmlNative.ts index a78e3ea3..80259b2c 100644 --- a/demos/xml/generated/ts/xmlNative.ts +++ b/demos/xml/generated/ts/xmlNative.ts @@ -1,10 +1,10 @@ -import { pointer, int32, EventType, KPointer } from "./types" - +import { pointer, int32, KPointer, Finalizable } from "./types" + export enum CallbackKind { - Kind_Callback_Boolean_Void = 0, + Kind_Callback_Boolean_void, Kind_Callback_EventType_ParseInfo_Boolean = 1, Kind_Callback_String_String_Boolean = 2, - Kind_Callback_Void = 3 + Kind_Callback_void = 3, } export interface XMLNativeModule { _XmlSerializer_setAttributes(self: KPointer, name: string, value: string): void @@ -29,7 +29,6 @@ export interface XMLNativeModule { _ParseInfo_getAttributeCount(self: KPointer): number _XmlPullParser_parse(self: KPointer, thisArray: Uint8Array, thisLength: int32): void _XmlSerializer_ctor(thisArray: Uint8Array, thisLength: int32): KPointer - _ParseInfo_ctor(): KPointer _XmlPullParser_ctor(buffer: string, thisArray: Uint8Array, thisLength: int32): KPointer _CallCallback(callbackKind: int32, args: Uint8Array, argsSize: int32): void _CallCallbackResourceHolder(holder: KPointer, resourceId: int32): void @@ -37,18 +36,18 @@ export interface XMLNativeModule { _CheckArkoalaCallbackEvent(buffer: Uint8Array, bufferLength: int32): int32 _HoldArkoalaResource(resourceId: int32): void _ReleaseArkoalaResource(resourceId: int32): void -} - -type NativeModuleType = XMLNativeModule -let theModule: NativeModuleType | undefined = undefined - -declare const LOAD_NATIVE: NativeModuleType - -export function getXMLNativeModule(): NativeModuleType { - if (theModule) return theModule - theModule = LOAD_NATIVE as NativeModuleType - if (!theModule) - throw new Error("Cannot load native module") - return theModule -} - +} + +type NativeModuleType = XMLNativeModule +let theModule: NativeModuleType | undefined = undefined + +declare const LOAD_NATIVE: NativeModuleType + +export function getXMLNativeModule(): NativeModuleType { + if (theModule) return theModule + theModule = LOAD_NATIVE as NativeModuleType + if (!theModule) + throw new Error("Cannot load native module") + return theModule +} + diff --git a/demos/xml/generated/ts/xmlSerializer.ts b/demos/xml/generated/ts/xmlSerializer.ts index 824d9ed7..4d1d6038 100644 --- a/demos/xml/generated/ts/xmlSerializer.ts +++ b/demos/xml/generated/ts/xmlSerializer.ts @@ -13,24 +13,25 @@ * limitations under the License. */ -import { SerializerBase, Tags, RuntimeType, runtimeType, isInstanceOf, CallbackResource } from "./SerializerBase" +import { SerializerBase, RuntimeType, runtimeType, CallbackResource } from "./SerializerBase" import { DeserializerBase } from "./DeserializerBase" -import { EventType, int32, KPointer } from "./types" +import { int32, KPointer, nullptr } from "./types" import { getXMLNativeModule, CallbackKind } from "./xmlNative" -import { ParseInfo, ParseOptions } from "./xml" +import { xml, ParseInfo, ParseOptions } from "./xml" import { ResourceHolder } from "./ResourceManager" export class Serializer extends SerializerBase { - private static cache: Serializer | undefined = undefined + private static cache?: Serializer | undefined = undefined static hold(): Serializer { - let serializer = Serializer.cache - if ((serializer) == (undefined)) + if (!(Serializer.cache != undefined)) { - serializer = new Serializer() - Serializer.cache = serializer + Serializer.cache = new Serializer() } + let serializer = (Serializer.cache)! if (serializer.isHolding) - throw new Error("Serializer is already being held. Check if you had released is before") + { + throw new Error("Serializer is already being held. Check if you had released is before") + } serializer.isHolding = true return serializer } @@ -42,9 +43,10 @@ export class Serializer extends SerializerBase { writeParseInfo(value: ParseInfo): void { let valueSerializer: Serializer = this const peer = value.getPeer() - if (peer != undefined) { - valueSerializer.writePointer(peer.ptr); - } + let ptr: KPointer = nullptr + if (peer != undefined) + ptr = peer.ptr + valueSerializer.writePointer(ptr); } writeParseOptions(value: ParseOptions): void { let valueSerializer: Serializer = this @@ -92,10 +94,10 @@ export class Serializer extends SerializerBase { } export class Deserializer extends DeserializerBase { - readCallback_EventType_ParseInfo_Boolean(): ((eventType: EventType, value: ParseInfo) => boolean) { + readCallback_EventType_ParseInfo_Boolean(): ((eventType: xml.EventType, value: ParseInfo) => boolean) { const _resource: CallbackResource = this.readCallbackResource() const _call: KPointer = this.readPointer() - return (eventType: EventType, value: ParseInfo): boolean => { const _argsSerializer: Serializer = Serializer.hold(); _argsSerializer.writeInt32(_resource.resourceId);; _argsSerializer.writePointer(_call);; _argsSerializer.writeInt32(eventType); _argsSerializer.writeParseInfo(value);; let _continuationValue: boolean | undefined|undefined; const _continuationCallback: ((value: boolean) => void) = (value: boolean): void => { _continuationValue = value; }; _argsSerializer.holdAndWriteCallback(_continuationCallback); getXMLNativeModule()._CallCallback(CallbackKind.Kind_Callback_EventType_ParseInfo_Boolean, _argsSerializer.asArray(), _argsSerializer.length());; _argsSerializer.release();; return (_continuationValue as boolean); } + return (eventType: xml.EventType, value: ParseInfo): boolean => { const _argsSerializer: Serializer = Serializer.hold(); _argsSerializer.writeInt32(_resource.resourceId);; _argsSerializer.writePointer(_call);; _argsSerializer.writeInt32(eventType); _argsSerializer.writeParseInfo(value);; let _continuationValue: boolean | undefined|undefined; const _continuationCallback: ((value: boolean) => void) = (value: boolean): void => { _continuationValue = value; }; _argsSerializer.holdAndWriteCallback(_continuationCallback); getXMLNativeModule()._CallCallback(CallbackKind.Kind_Callback_EventType_ParseInfo_Boolean, _argsSerializer.asArray(), _argsSerializer.length());; _argsSerializer.release();; return (_continuationValue as boolean); } } readCallback_String_String_Boolean(): ((name: string, value: string) => boolean) { const _resource: CallbackResource = this.readCallbackResource() @@ -108,21 +110,20 @@ export class Deserializer extends DeserializerBase { let value: {byteLength?: number} = {byteLength: byteLength_result} return (value as ArrayBuffer) } - readCallback_Void(): (() => void) { + readCallback_void(): (() => void) { const _resource: CallbackResource = this.readCallbackResource() const _call: KPointer = this.readPointer() - return (): void => { const _argsSerializer: Serializer = Serializer.hold(); _argsSerializer.writeInt32(_resource.resourceId);; _argsSerializer.writePointer(_call);; getXMLNativeModule()._CallCallback(CallbackKind.Kind_Callback_Void, _argsSerializer.asArray(), _argsSerializer.length());; _argsSerializer.release();; return; } + return (): void => { const _argsSerializer: Serializer = Serializer.hold(); _argsSerializer.writeInt32(_resource.resourceId);; _argsSerializer.writePointer(_call);; getXMLNativeModule()._CallCallback(CallbackKind.Kind_Callback_void, _argsSerializer.asArray(), _argsSerializer.length());; _argsSerializer.release();; return; } } - readCallback_Boolean_Void(): ((value: boolean) => void) { + readCallback_Boolean_void(): ((value: boolean) => void) { const _resource: CallbackResource = this.readCallbackResource() const _call: KPointer = this.readPointer() - return (value: boolean): void => { const _argsSerializer: Serializer = Serializer.hold(); _argsSerializer.writeInt32(_resource.resourceId);; _argsSerializer.writePointer(_call);; _argsSerializer.writeBoolean(value); getXMLNativeModule()._CallCallback(CallbackKind.Kind_Callback_Boolean_Void, _argsSerializer.asArray(), _argsSerializer.length());; _argsSerializer.release();; return; } + return (value: boolean): void => { const _argsSerializer: Serializer = Serializer.hold(); _argsSerializer.writeInt32(_resource.resourceId);; _argsSerializer.writePointer(_call);; _argsSerializer.writeBoolean(value); getXMLNativeModule()._CallCallback(CallbackKind.Kind_Callback_Boolean_void, _argsSerializer.asArray(), _argsSerializer.length());; _argsSerializer.release();; return; } } readParseInfo(): ParseInfo { - throw "todo" - // let valueDeserializer: Deserializer = this - // let ptr: KPointer = valueDeserializer.readPointer() - // return ParseInfo.(ptr) + let valueDeserializer: Deserializer = this + let ptr: KPointer = valueDeserializer.readPointer() + return ParseInfo.construct(ptr) } readParseOptions(): ParseOptions { let valueDeserializer: Deserializer = this @@ -155,18 +156,17 @@ export class Deserializer extends DeserializerBase { } const attributeValueCallbackFunction_result: ((name: string, value: string) => boolean) | undefined|undefined = attributeValueCallbackFunction_buf const tokenValueCallbackFunction_buf_runtimeType = (valueDeserializer.readInt8() as int32) - let tokenValueCallbackFunction_buf: ((eventType: EventType, value: ParseInfo) => boolean) | undefined|undefined + let tokenValueCallbackFunction_buf: ((eventType: xml.EventType, value: ParseInfo) => boolean) | undefined|undefined if ((RuntimeType.UNDEFINED) != (tokenValueCallbackFunction_buf_runtimeType)) { tokenValueCallbackFunction_buf = valueDeserializer.readCallback_EventType_ParseInfo_Boolean() } - const tokenValueCallbackFunction_result: ((eventType: EventType, value: ParseInfo) => boolean) | undefined|undefined = tokenValueCallbackFunction_buf - let value: {supportDoctype?: boolean, ignoreNameSpace?: boolean, tagValueCallbackFunction?: ((name: string, value: string) => boolean), attributeValueCallbackFunction?: ((name: string, value: string) => boolean), tokenValueCallbackFunction?: ((eventType: EventType, value: ParseInfo) => boolean)} = {supportDoctype: supportDoctype_result,ignoreNameSpace: ignoreNameSpace_result,tagValueCallbackFunction: tagValueCallbackFunction_result,attributeValueCallbackFunction: attributeValueCallbackFunction_result,tokenValueCallbackFunction: tokenValueCallbackFunction_result} + const tokenValueCallbackFunction_result: ((eventType: xml.EventType, value: ParseInfo) => boolean) | undefined|undefined = tokenValueCallbackFunction_buf + let value: {supportDoctype?: boolean, ignoreNameSpace?: boolean, tagValueCallbackFunction?: ((name: string, value: string) => boolean), attributeValueCallbackFunction?: ((name: string, value: string) => boolean), tokenValueCallbackFunction?: ((eventType: xml.EventType, value: ParseInfo) => boolean)} = {supportDoctype: supportDoctype_result,ignoreNameSpace: ignoreNameSpace_result,tagValueCallbackFunction: tagValueCallbackFunction_result,attributeValueCallbackFunction: attributeValueCallbackFunction_result,tokenValueCallbackFunction: tokenValueCallbackFunction_result} return (value as ParseOptions) } } - -export function deserializeAndCallCallback_Boolean_Void(thisDeserializer: Deserializer) { +export function deserializeAndCallCallback_Boolean_void(thisDeserializer: Deserializer) { const _resourceId: int32 = thisDeserializer.readInt32() const _call = (ResourceHolder.instance().get(_resourceId) as ((value: boolean) => void)) let value: boolean = thisDeserializer.readBoolean() @@ -174,10 +174,10 @@ export function deserializeAndCallCallback_Boolean_Void(thisDeserializer: Deseri } export function deserializeAndCallCallback_EventType_ParseInfo_Boolean(thisDeserializer: Deserializer) { const _resourceId: int32 = thisDeserializer.readInt32() - const _call = (ResourceHolder.instance().get(_resourceId) as ((eventType: EventType, value: ParseInfo) => boolean)) - let eventType: EventType = (thisDeserializer.readInt32() as EventType) + const _call = (ResourceHolder.instance().get(_resourceId) as ((eventType: xml.EventType, value: ParseInfo) => boolean)) + let eventType: xml.EventType = (thisDeserializer.readInt32() as xml.EventType) let value: ParseInfo = (thisDeserializer.readParseInfo() as ParseInfo) - let _continuation: ((value: boolean) => void) = thisDeserializer.readCallback_Boolean_Void() + let _continuation: ((value: boolean) => void) = thisDeserializer.readCallback_Boolean_void() _continuation(_call(eventType, value)); } export function deserializeAndCallCallback_String_String_Boolean(thisDeserializer: Deserializer) { @@ -185,10 +185,10 @@ export function deserializeAndCallCallback_String_String_Boolean(thisDeserialize const _call = (ResourceHolder.instance().get(_resourceId) as ((name: string, value: string) => boolean)) let name: string = (thisDeserializer.readString() as string) let value: string = (thisDeserializer.readString() as string) - let _continuation: ((value: boolean) => void) = thisDeserializer.readCallback_Boolean_Void() + let _continuation: ((value: boolean) => void) = thisDeserializer.readCallback_Boolean_void() _continuation(_call(name, value)); } -export function deserializeAndCallCallback_Void(thisDeserializer: Deserializer) { +export function deserializeAndCallCallback_void(thisDeserializer: Deserializer) { const _resourceId: int32 = thisDeserializer.readInt32() const _call = (ResourceHolder.instance().get(_resourceId) as (() => void)) _call(); @@ -196,9 +196,9 @@ export function deserializeAndCallCallback_Void(thisDeserializer: Deserializer) export function deserializeAndCallCallback(thisDeserializer: Deserializer) { const kind: CallbackKind = (thisDeserializer.readInt32() as CallbackKind) switch (kind) { - case CallbackKind.Kind_Callback_Boolean_Void: return deserializeAndCallCallback_Boolean_Void(thisDeserializer); + case CallbackKind.Kind_Callback_Boolean_void: return deserializeAndCallCallback_Boolean_void(thisDeserializer); case CallbackKind.Kind_Callback_EventType_ParseInfo_Boolean: return deserializeAndCallCallback_EventType_ParseInfo_Boolean(thisDeserializer); case CallbackKind.Kind_Callback_String_String_Boolean: return deserializeAndCallCallback_String_String_Boolean(thisDeserializer); - case CallbackKind.Kind_Callback_Void: return deserializeAndCallCallback_Void(thisDeserializer); + case CallbackKind.Kind_Callback_void: return deserializeAndCallCallback_void(thisDeserializer); } } \ No newline at end of file diff --git a/demos/xml/generated/xml.cc b/demos/xml/generated/xml.cc index 2abaeb81..c899f32a 100644 --- a/demos/xml/generated/xml.cc +++ b/demos/xml/generated/xml.cc @@ -20,8 +20,6 @@ #include "DeserializerBase.h" #include -#include "parser_impl.h" - CustomDeserializer * DeserializerBase::customDeserializers = nullptr; typedef enum CallbackKind { @@ -527,7 +525,7 @@ class Deserializer : public DeserializerBase { { Deserializer& valueDeserializer = *this; void* ptr = valueDeserializer.readPointer(); - return { .ptr = ptr }; + return { ptr }; } OH_ParseOptions readParseOptions() { @@ -576,107 +574,33 @@ class Deserializer : public DeserializerBase { return static_cast(value); } }; -OH_XML_XmlSerializerHandle XmlSerializer_constructImpl(const OH_Union_ArrayBuffer_DataView* buffer, const Opt_String* encoding) { - return {}; -} -void XmlSerializer_destructImpl(OH_XML_XmlSerializerHandle thiz) { -} -void XmlSerializer_setAttributesImpl(OH_NativePointer thisPtr, const OH_String* name, const OH_String* value) { -} -void XmlSerializer_addEmptyElementImpl(OH_NativePointer thisPtr, const OH_String* name) { -} -void XmlSerializer_setDeclarationImpl(OH_NativePointer thisPtr) { -} -void XmlSerializer_startElementImpl(OH_NativePointer thisPtr, const OH_String* name) { -} -void XmlSerializer_endElementImpl(OH_NativePointer thisPtr) { -} -void XmlSerializer_setNamespaceImpl(OH_NativePointer thisPtr, const OH_String* prefix, const OH_String* namespace_) { -} -void XmlSerializer_setCommentImpl(OH_NativePointer thisPtr, const OH_String* text) { -} -void XmlSerializer_setCDATAImpl(OH_NativePointer thisPtr, const OH_String* text) { -} -void XmlSerializer_setTextImpl(OH_NativePointer thisPtr, const OH_String* text) { -} -void XmlSerializer_setDocTypeImpl(OH_NativePointer thisPtr, const OH_String* text) { -} -OH_Number ParseInfo_getColumnNumberImpl(OH_NativePointer thisPtr) { - return {}; -} -OH_Number ParseInfo_getDepthImpl(OH_NativePointer thisPtr) { - return {}; -} -OH_Number ParseInfo_getLineNumberImpl(OH_NativePointer thisPtr) { - return {}; -} -OH_String ParseInfo_getNameImpl(OH_NativePointer thisPtr) { - return {}; -} -OH_String ParseInfo_getNamespaceImpl(OH_NativePointer thisPtr) { - return {}; -} -OH_String ParseInfo_getPrefixImpl(OH_NativePointer thisPtr) { - return {}; -} -OH_String ParseInfo_getTextImpl(OH_NativePointer thisPtr) { - return {}; -} -OH_Boolean ParseInfo_isEmptyElementTagImpl(OH_NativePointer thisPtr) { - return {}; -} -OH_Boolean ParseInfo_isWhitespaceImpl(OH_NativePointer thisPtr) { - return {}; -} -OH_Number ParseInfo_getAttributeCountImpl(OH_NativePointer thisPtr) { - return {}; -} -OH_XML_XmlPullParserHandle XmlPullParser_constructImpl(const OH_String* buffer, const Opt_String* encoding) { - const ExpatParser* parser = new ExpatParser(*buffer); - return (OH_XML_XmlPullParserHandle) parser; -} -void XmlPullParser_destructImpl(OH_XML_XmlPullParserHandle thiz) { - const ExpatParser* parser = (ExpatParser*) thiz; - delete parser; -} - -void temp_hold(int resId) {} -void temp_release(int resId) {} -void temp_call(const OH_Int32 resourceId, const OH_Boolean value) {} - -void XmlPullParser_parseImpl(OH_NativePointer thisPtr, const OH_ParseOptions* option) { - ExpatParser* parser = (ExpatParser*) thisPtr; - if (option->tagValueCallbackFunction.tag != OH_TAG_UNDEFINED) { - parser->setTagValueCallback([&](const char* name, const char* value) { - auto callback = &(option->tagValueCallbackFunction.value); - callback->call(callback->resource.resourceId, name, value, { - { - 1, - temp_hold, - temp_release, - }, - temp_call, - }); - }); - } - if (option->attributeValueCallbackFunction.tag != OH_TAG_UNDEFINED) { - parser->setAttributeValueCallback([&](const char* name, const char* value) { - auto callback = &(option->attributeValueCallbackFunction.value); - callback->call(callback->resource.resourceId, name, value, { - { - 1, - temp_hold, - temp_release, - }, - temp_call, - }); - }); - } - // TODO handle other properties from ParseOptions - parser->parse(); - parser->reset(); -} - +OH_XML_XmlSerializerHandle XmlSerializer_constructImpl(const OH_Union_ArrayBuffer_DataView* buffer, const Opt_String* encoding); +void XmlSerializer_destructImpl(OH_XML_XmlSerializerHandle thiz); +void XmlSerializer_setAttributesImpl(OH_NativePointer thisPtr, const OH_String* name, const OH_String* value); +void XmlSerializer_addEmptyElementImpl(OH_NativePointer thisPtr, const OH_String* name); +void XmlSerializer_setDeclarationImpl(OH_NativePointer thisPtr); +void XmlSerializer_startElementImpl(OH_NativePointer thisPtr, const OH_String* name); +void XmlSerializer_endElementImpl(OH_NativePointer thisPtr); +void XmlSerializer_setNamespaceImpl(OH_NativePointer thisPtr, const OH_String* prefix, const OH_String* namespace_); +void XmlSerializer_setCommentImpl(OH_NativePointer thisPtr, const OH_String* text); +void XmlSerializer_setCDATAImpl(OH_NativePointer thisPtr, const OH_String* text); +void XmlSerializer_setTextImpl(OH_NativePointer thisPtr, const OH_String* text); +void XmlSerializer_setDocTypeImpl(OH_NativePointer thisPtr, const OH_String* text); +OH_XML_ParseInfoHandle ParseInfo_constructImpl(); +void ParseInfo_destructImpl(OH_XML_ParseInfoHandle thiz); +OH_Number ParseInfo_getColumnNumberImpl(OH_NativePointer thisPtr); +OH_Number ParseInfo_getDepthImpl(OH_NativePointer thisPtr); +OH_Number ParseInfo_getLineNumberImpl(OH_NativePointer thisPtr); +OH_String ParseInfo_getNameImpl(OH_NativePointer thisPtr); +OH_String ParseInfo_getNamespaceImpl(OH_NativePointer thisPtr); +OH_String ParseInfo_getPrefixImpl(OH_NativePointer thisPtr); +OH_String ParseInfo_getTextImpl(OH_NativePointer thisPtr); +OH_Boolean ParseInfo_isEmptyElementTagImpl(OH_NativePointer thisPtr); +OH_Boolean ParseInfo_isWhitespaceImpl(OH_NativePointer thisPtr); +OH_Number ParseInfo_getAttributeCountImpl(OH_NativePointer thisPtr); +OH_XML_XmlPullParserHandle XmlPullParser_constructImpl(const OH_String* buffer, const Opt_String* encoding); +void XmlPullParser_destructImpl(OH_XML_XmlPullParserHandle thiz); +void XmlPullParser_parseImpl(OH_NativePointer thisPtr, const OH_ParseOptions* option); const OH_XML_XmlSerializerModifier* OH_XML_XmlSerializerModifierImpl() { const static OH_XML_XmlSerializerModifier instance = { &XmlSerializer_constructImpl, @@ -696,6 +620,8 @@ const OH_XML_XmlSerializerModifier* OH_XML_XmlSerializerModifierImpl() { } const OH_XML_ParseInfoModifier* OH_XML_ParseInfoModifierImpl() { const static OH_XML_ParseInfoModifier instance = { + &ParseInfo_constructImpl, + &ParseInfo_destructImpl, &ParseInfo_getColumnNumberImpl, &ParseInfo_getDepthImpl, &ParseInfo_getLineNumberImpl, @@ -811,15 +737,15 @@ void impl_XmlSerializer_setDocType(OH_NativePointer thisPtr, const KStringPtr& t } KOALA_INTEROP_V2(XmlSerializer_setDocType, OH_NativePointer, KStringPtr) -// OH_NativePointer impl_ParseInfo_ctor() { -// return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->construct(); -// } -// KOALA_INTEROP_0(ParseInfo_ctor, OH_NativePointer) +OH_NativePointer impl_ParseInfo_ctor() { + return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->construct(); +} +KOALA_INTEROP_0(ParseInfo_ctor, OH_NativePointer) -// OH_NativePointer impl_ParseInfo_getFinalizer() { -// return (OH_NativePointer) &GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->destruct; -// } -// KOALA_INTEROP_0(ParseInfo_getFinalizer, OH_NativePointer) +OH_NativePointer impl_ParseInfo_getFinalizer() { + return (OH_NativePointer) &GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->destruct; +} +KOALA_INTEROP_0(ParseInfo_getFinalizer, OH_NativePointer) OH_Int32 impl_ParseInfo_getColumnNumber(OH_NativePointer thisPtr) { return GetXMLAPIImpl(XML_API_VERSION)->ParseInfo()->getColumnNumber(thisPtr).i32; diff --git a/demos/xml/generated/xml.h b/demos/xml/generated/xml.h index 2e4bb823..8804589f 100644 --- a/demos/xml/generated/xml.h +++ b/demos/xml/generated/xml.h @@ -237,6 +237,8 @@ typedef struct OH_XML_XmlSerializerModifier { struct OH_XML_ParseInfoHandleOpaque; typedef struct OH_XML_ParseInfoHandleOpaque* OH_XML_ParseInfoHandle; typedef struct OH_XML_ParseInfoModifier { + OH_XML_ParseInfoHandle (*construct)(); + void (*destruct)(OH_XML_ParseInfoHandle thiz); OH_Number (*getColumnNumber)(OH_NativePointer thisPtr); OH_Number (*getDepth)(OH_NativePointer thisPtr); OH_Number (*getLineNumber)(OH_NativePointer thisPtr); diff --git a/demos/xml/meson.build b/demos/xml/meson.build index 0ba56d85..cbf23125 100644 --- a/demos/xml/meson.build +++ b/demos/xml/meson.build @@ -21,6 +21,7 @@ include_dirs = [ sources = [ 'generated/xml.cc', + 'src/cpp/xmlImpl.cc', external_interop_dir / 'common-interop.cc', external_interop_dir / 'interop-logging.cc', ] diff --git a/demos/xml/src/cpp/xmlImpl.cc b/demos/xml/src/cpp/xmlImpl.cc new file mode 100644 index 00000000..2a212cc7 --- /dev/null +++ b/demos/xml/src/cpp/xmlImpl.cc @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2024 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. + */ + +#include "xml.h" +#include "parser_impl.h" + +OH_XML_XmlSerializerHandle XmlSerializer_constructImpl(const OH_Union_ArrayBuffer_DataView* buffer, const Opt_String* encoding) { + return {}; +} +void XmlSerializer_destructImpl(OH_XML_XmlSerializerHandle thiz) { +} +void XmlSerializer_setAttributesImpl(OH_NativePointer thisPtr, const OH_String* name, const OH_String* value) { +} +void XmlSerializer_addEmptyElementImpl(OH_NativePointer thisPtr, const OH_String* name) { +} +void XmlSerializer_setDeclarationImpl(OH_NativePointer thisPtr) { +} +void XmlSerializer_startElementImpl(OH_NativePointer thisPtr, const OH_String* name) { +} +void XmlSerializer_endElementImpl(OH_NativePointer thisPtr) { +} +void XmlSerializer_setNamespaceImpl(OH_NativePointer thisPtr, const OH_String* prefix, const OH_String* namespace_) { +} +void XmlSerializer_setCommentImpl(OH_NativePointer thisPtr, const OH_String* text) { +} +void XmlSerializer_setCDATAImpl(OH_NativePointer thisPtr, const OH_String* text) { +} +void XmlSerializer_setTextImpl(OH_NativePointer thisPtr, const OH_String* text) { +} +void XmlSerializer_setDocTypeImpl(OH_NativePointer thisPtr, const OH_String* text) { +} +OH_XML_ParseInfoHandle ParseInfo_constructImpl() { + return {}; +} +void ParseInfo_destructImpl(OH_XML_ParseInfoHandle thiz) { +} +OH_Number ParseInfo_getColumnNumberImpl(OH_NativePointer thisPtr) { + return {}; +} +OH_Number ParseInfo_getDepthImpl(OH_NativePointer thisPtr) { + return {}; +} +OH_Number ParseInfo_getLineNumberImpl(OH_NativePointer thisPtr) { + return {}; +} +OH_String ParseInfo_getNameImpl(OH_NativePointer thisPtr) { + return {}; +} +OH_String ParseInfo_getNamespaceImpl(OH_NativePointer thisPtr) { + return {}; +} +OH_String ParseInfo_getPrefixImpl(OH_NativePointer thisPtr) { + return {}; +} +OH_String ParseInfo_getTextImpl(OH_NativePointer thisPtr) { + return {}; +} +OH_Boolean ParseInfo_isEmptyElementTagImpl(OH_NativePointer thisPtr) { + return {}; +} +OH_Boolean ParseInfo_isWhitespaceImpl(OH_NativePointer thisPtr) { + return {}; +} +OH_Number ParseInfo_getAttributeCountImpl(OH_NativePointer thisPtr) { + return {}; +} + +OH_XML_XmlPullParserHandle XmlPullParser_constructImpl(const OH_String* buffer, const Opt_String* encoding) { + const ExpatParser* parser = new ExpatParser(*buffer); + return (OH_XML_XmlPullParserHandle) parser; +} +void XmlPullParser_destructImpl(OH_XML_XmlPullParserHandle thiz) { + const ExpatParser* parser = (ExpatParser*) thiz; + delete parser; +} + +void temp_hold(int resId) {} +void temp_release(int resId) {} +void temp_call(const OH_Int32 resourceId, const OH_Boolean value) {} + +void XmlPullParser_parseImpl(OH_NativePointer thisPtr, const OH_ParseOptions* option) { + ExpatParser* parser = (ExpatParser*) thisPtr; + if (option->tagValueCallbackFunction.tag != OH_TAG_UNDEFINED) { + parser->setTagValueCallback([&](const char* name, const char* value) { + auto callback = &(option->tagValueCallbackFunction.value); + callback->call(callback->resource.resourceId, name, value, { + { + 1, + temp_hold, + temp_release, + }, + temp_call, + }); + }); + } + if (option->attributeValueCallbackFunction.tag != OH_TAG_UNDEFINED) { + parser->setAttributeValueCallback([&](const char* name, const char* value) { + auto callback = &(option->attributeValueCallbackFunction.value); + callback->call(callback->resource.resourceId, name, value, { + { + 1, + temp_hold, + temp_release, + }, + temp_call, + }); + }); + } + // TODO handle other properties from ParseOptions + parser->parse(); + parser->reset(); +} diff --git a/demos/xml/src/index.ts b/demos/xml/src/index.ts index 0b095ead..c732ffee 100644 --- a/demos/xml/src/index.ts +++ b/demos/xml/src/index.ts @@ -30,6 +30,7 @@ enum EventType { })(); const sampleXml = String.raw`Hello124World` +console.log(`PARSING ${sampleXml}`) const parser = new XmlPullParser(sampleXml) parser.parse({ ignoreNameSpace: true, diff --git a/demos/xml/tsconfig.json b/demos/xml/tsconfig.json index ad1a519b..8ee7d690 100644 --- a/demos/xml/tsconfig.json +++ b/demos/xml/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ESNext", "module": "ESNext", - "moduleResolution": "Bundler", + "moduleResolution": "node", "outDir": "build/ts", "sourceMap": true, "rootDirs": ["src", "generated/ts"] diff --git a/src/peer-generation/FileGenerators.ts b/src/peer-generation/FileGenerators.ts index 59707aef..de691b1b 100644 --- a/src/peer-generation/FileGenerators.ts +++ b/src/peer-generation/FileGenerators.ts @@ -19,7 +19,7 @@ import { PrimitiveType } from "./ArkPrimitiveType" import { camelCaseToUpperSnakeCase } from "../util" import { CppLanguageWriter, createLanguageWriter, LanguageWriter, Method, MethodSignature, NamedMethodSignature, PrinterLike } from "./LanguageWriters" import { PeerGeneratorConfig } from "./PeerGeneratorConfig"; -import { writeDeserializer, writeSerializer } from "./printers/SerializerPrinter" +import { writeDeserializer, writeDeserializerFile, writeSerializer, writeSerializerFile } from "./printers/SerializerPrinter" import { SELECTOR_ID_PREFIX, writeConvertors } from "./printers/ConvertorsPrinter" import { ArkoalaInstall, LibaceInstall } from "../Install" import { ImportsCollector } from "./ImportsCollector" @@ -30,7 +30,7 @@ import { printCallbacksKinds, printCallbacksKindsImports, printDeserializeAndCal import { createReferenceType, IDLVoidType, toIDLType } from "../idl" import { createEmptyReferenceResolver, getReferenceResolver, ReferenceResolver } from "./ReferenceResolver" import { MethodArgPrintHint } from "./LanguageWriters/LanguageWriter" -import { SourceFile } from "./printers/SourceFile" +import { SourceFile, TsSourceFile } from "./printers/SourceFile" export const warning = "WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION!" @@ -299,21 +299,22 @@ export function makeTSSerializer(library: PeerLibrary): LanguageWriter { return printer } -export function makeSerializerForOhos(library: PeerLibrary, nativeModule: { name: string, path: string }, declarationPath?: string): LanguageWriter { +export function makeSerializerForOhos(library: PeerLibrary, nativeModule: { name: string, path: string }, declarationPath?: string): SourceFile { // TODO Add Java and migrate arkoala code if (library.language == Language.TS || library.language == Language.ARKTS) { - let printer = createLanguageWriter(library.language, getReferenceResolver(library)) - printer.nativeModuleAccessor = nativeModule.name - printer.writeLines(cStyleCopyright) - const imports = new ImportsCollector() - imports.addFeatures(["SerializerBase", "Tags", "RuntimeType", "runtimeType", "isInstanceOf"], "./SerializerBase") - imports.addFeatures(["int32"], "./types") - imports.addFeatures([nativeModule.name, "CallbackKind"], nativeModule.path) - imports.print(printer, '') - writeSerializer(library, printer, "", declarationPath) - writeDeserializer(library, printer, "", declarationPath) - printer.concat(makeDeserializeAndCall(library, Language.TS, nativeModule.path).content) - return printer + const destFile = new TsSourceFile("Serializer" + library.language.extension, getReferenceResolver(library)) + destFile.content.nativeModuleAccessor = nativeModule.name + destFile.imports.addFeatures(["SerializerBase", "RuntimeType", "runtimeType", "CallbackResource"], "./SerializerBase") + destFile.imports.addFeatures(["DeserializerBase" ], "./DeserializerBase") + destFile.imports.addFeatures(["int32", "KPointer", "nullptr"], "./types") + destFile.imports.addFeatures([nativeModule.name, "CallbackKind"], nativeModule.path) + writeSerializerFile(library, destFile, "", declarationPath) + writeDeserializerFile(library, destFile, "", declarationPath) + const deserializeCallImpls = makeDeserializeAndCall(library, Language.TS, nativeModule.path) as TsSourceFile + deserializeCallImpls.imports.clear() // TODO fix dependencies + deserializeCallImpls.imports.addFeatures(["ResourceHolder"], "./ResourceManager") + destFile.merge(deserializeCallImpls) + return destFile } else { throw new Error(`unsupported language ${library.language}`) } @@ -387,7 +388,7 @@ ${serializers.getOutput().join("\n")} export function makeTSDeserializer(library: PeerLibrary): string { const deserializer = createLanguageWriter(Language.TS, library) - writeDeserializer(library, deserializer) + writeDeserializer(library, deserializer, "") return `${cStyleCopyright} import { runtimeType, Tags, RuntimeType, SerializerBase, CallbackResource } from "./SerializerBase" import { MaterializedBase } from "./../MaterializedBase" diff --git a/src/peer-generation/ImportsCollector.ts b/src/peer-generation/ImportsCollector.ts index b19c901e..32a271bb 100644 --- a/src/peer-generation/ImportsCollector.ts +++ b/src/peer-generation/ImportsCollector.ts @@ -44,6 +44,10 @@ export class ImportsCollector { } } + clear() { + this.moduleToFeatures.clear() + } + print(printer: LanguageWriter, currentModule: string) { const currentModuleDir = path.dirname(currentModule) this.moduleToFeatures.forEach((features, module) => { diff --git a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts index 37c85a8f..27b83205 100644 --- a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts @@ -231,7 +231,14 @@ export class TSLanguageWriter extends LanguageWriter { return `export function ${name}(${args.join(", ")})` } writeEnum(name: string, members: { name: string, stringId: string | undefined, numberId: number }[], op: (writer: LanguageWriter) => void): void { - throw new Error("WriteEnum for TS is not implemented") + this.printer.print(`export enum ${name} {`) + this.printer.pushIndent() + for (const { name, numberId } of members) { + // TODO handle string enums + this.printer.print(`${name} = ${numberId},`) + } + this.printer.popIndent() + this.printer.print("}") } writeFieldDeclaration(name: string, type: idl.IDLType, modifiers: FieldModifier[]|undefined, optional: boolean, initExpr?: LanguageExpression): void { const init = initExpr != undefined ? ` = ${initExpr.asString()}` : `` diff --git a/src/peer-generation/OhosGenerator.ts b/src/peer-generation/OhosGenerator.ts index 3b0cf026..614d8bea 100644 --- a/src/peer-generation/OhosGenerator.ts +++ b/src/peer-generation/OhosGenerator.ts @@ -15,21 +15,22 @@ import * as fs from 'fs' import * as path from 'path' -import { createContainerType, createReferenceType, forceAsNamedNode, hasExtAttribute, IDLCallback, IDLConstructor, IDLEntry, IDLEnum, IDLExtendedAttributes, IDLI32Type, IDLInterface, IDLMethod, IDLNumberType, IDLParameter, IDLPointerType, IDLType, IDLU8Type, IDLVoidType, isCallback, isClass, isConstructor, isContainerType, isEnum, isInterface, isMethod, isReferenceType, isType, isUnionType, maybeOptional } from '../idl' +import { createConstructor, createContainerType, createReferenceType, createTypeParameterReference, forceAsNamedNode, getExtAttribute, hasExtAttribute, IDLCallback, IDLConstructor, IDLEntry, IDLEnum, IDLExtendedAttributes, IDLI32Type, IDLInterface, IDLMethod, IDLNumberType, IDLParameter, IDLPointerType, IDLType, IDLU8Type, IDLUint8ArrayType, IDLVoidType, isCallback, isClass, isConstructor, isContainerType, isEnum, isInterface, isMethod, isReferenceType, isType, isUnionType, maybeOptional } from '../idl' import { IndentedPrinter } from "../IndentedPrinter" import { PeerLibrary } from './PeerLibrary' import { Language } from '../Language' -import { capitalize } from '../util' +import { capitalize, getOrPut } from '../util' import { ArgConvertor, generateCallbackAPIArguments } from './ArgConvertors' import { PrimitiveType } from './ArkPrimitiveType' import { makeDeserializeAndCall, makeSerializerForOhos, readLangTemplate } from './FileGenerators' import { qualifiedName } from './idl/common' import { isMaterialized } from './idl/IdlPeerGeneratorVisitor' import { StructPrinter } from './printers/StructPrinter' -import { CppLanguageWriter, createLanguageWriter, ExpressionStatement, FieldModifier, LanguageExpression, LanguageWriter, Method, MethodSignature, NamedMethodSignature } from './LanguageWriters' +import { CppLanguageWriter, createLanguageWriter, ExpressionStatement, FieldModifier, LanguageExpression, LanguageWriter, Method, MethodModifier, MethodSignature, NamedMethodSignature } from './LanguageWriters' import { printBridgeCcForOHOS } from './printers/BridgeCcPrinter' import { printCallbacksKinds, printManagedCaller } from './printers/CallbacksPrinter' import { writeDeserializer, writeSerializer } from './printers/SerializerPrinter' +import { CppSourceFile, SourceFile } from './printers/SourceFile' class NameType { constructor(public name: string, public type: string) {} @@ -42,7 +43,7 @@ interface SignatureDescriptor { } class OHOSVisitor { - + implementationStubsFile: CppSourceFile hWriter = new CppLanguageWriter(new IndentedPrinter(), this.library) cppWriter = new CppLanguageWriter(new IndentedPrinter(), this.library) @@ -59,8 +60,18 @@ class OHOSVisitor { callbackInterfaces = new Array() constructor(protected library: PeerLibrary) { - this.peerWriter = createLanguageWriter(this.library.language, this.library) - this.nativeWriter = createLanguageWriter(this.library.language, this.library) + if (this.library.files.length == 0) + throw new Error("No files in library") + + this.libraryName = this.library.files.filter(f => !f.isPredefined)[0].packageName().toUpperCase() + this.library.name = this.libraryName + + this.peerWriter = createLanguageWriter(library.language, library) + this.nativeWriter = createLanguageWriter(library.language, library) + + const fileNamePrefix = this.libraryName.toLowerCase() + this.implementationStubsFile = new CppSourceFile(`${fileNamePrefix}Impl_template${Language.CPP.extension}`, library) + this.implementationStubsFile.addInclude(`${fileNamePrefix}.h`) } private static knownBasicTypes = new Set(['ArrayBuffer', 'DataView']) @@ -117,7 +128,11 @@ class OHOSVisitor { _c.print(`const static ${name} instance = {`) _c.pushIndent() _h.pushIndent() - clazz.constructors.forEach((ctor, index) => { + let ctors = [...clazz.constructors] + if (ctors.length == 0) { + ctors.push(createConstructor([], undefined)) // Add empty fake constructor + } + ctors.forEach((ctor, index) => { let name = `construct${(index > 0) ? index.toString() : ""}` let params = ctor.parameters.map(it => new NameType(_h.escapeKeyword(it.name), this.mapType(it.type!))) let argConvertors = ctor.parameters.map(param => generateArgConvertor(this.library, param)) @@ -127,7 +142,7 @@ class OHOSVisitor { _c.print(`&${implName},`) this.impls.set(implName, { params, returnType: handleType, paramsCString: cppArgs}) }) - if (clazz.constructors.length > 0) { + { let destructName = `${clazz.name}_destructImpl` let params = [new NameType("thiz", handleType)] _h.print(`void (*destruct)(${params.map(it => `${it.type} ${it.name}`).join(", ")});`) @@ -184,13 +199,17 @@ class OHOSVisitor { private writeImpls() { let _ = this.cppWriter + let _stubs = this.implementationStubsFile.content this.impls.forEach((signature, name) => { - _.print(`${signature.returnType} ${name}(${signature.paramsCString ?? signature.params.map(it => `${it.type} ${it.name}`).join(", ")}) {`) - _.pushIndent() - if (signature.returnType != "void") - _.print('return {};') - _.popIndent() - _.print(`}`) + const declaration = `${signature.returnType} ${name}(${signature.paramsCString ?? signature.params.map(it => `${it.type} ${it.name}`).join(", ")})` + _.print(`${declaration};`) + _stubs.print(`${declaration} {`) + _stubs.pushIndent() + if (signature.returnType != "void") { + _stubs.print('return {};') + } + _stubs.popIndent() + _stubs.print(`}`) }) } @@ -287,24 +306,48 @@ class OHOSVisitor { writer.writeNativeMethodDeclaration(`_${it.name}_${method.name}`, signature) // TODO temporarily removed _${this.libraryName} prefix }) }) + // TODO TBD do we need to provide declaration for "fake" constructor for interfaces? this.interfaces.forEach(it => { const ctors = it.constructors.map(it => ({ parameters: it.parameters, returnType: it.returnType })) - if (ctors.length === 0) { - ctors.push({ - returnType: IDLNumberType /* unused? */, - parameters: [] - }) - } ctors.forEach(ctor => { const signature = makePeerCallSignature(this.library, ctor.parameters, IDLPointerType) writer.writeNativeMethodDeclaration(`_${it.name}_ctor`, signature) }) }) - writer.writeNativeMethodDeclaration("_GetManagerCallbackCaller", - NamedMethodSignature.make( - IDLPointerType, - [{ name: "kind", type: createReferenceType("CallbackKind") }] - ) + writer.writeNativeMethodDeclaration("_CallCallback", + NamedMethodSignature.make(IDLVoidType, [ + { name: "callbackKind", type: IDLI32Type }, + { name: "args", type: IDLUint8ArrayType }, + { name: "argsSize", type: IDLI32Type }, + ]) + ) + writer.writeNativeMethodDeclaration("_CallCallbackResourceHolder", + NamedMethodSignature.make(IDLVoidType, [ + { name: "holder", type: IDLPointerType }, + { name: "resourceId", type: IDLI32Type }, + ]) + ) + writer.writeNativeMethodDeclaration("_CallCallbackResourceReleaser", + NamedMethodSignature.make(IDLVoidType, [ + { name: "releaser", type: IDLPointerType }, + { name: "resourceId", type: IDLI32Type }, + ]) + ) + writer.writeNativeMethodDeclaration("_CheckArkoalaCallbackEvent", + NamedMethodSignature.make(IDLI32Type, [ + { name: "buffer", type: IDLUint8ArrayType }, + { name: "bufferLength", type: IDLI32Type }, + ]) + ) + writer.writeNativeMethodDeclaration("_HoldArkoalaResource", + NamedMethodSignature.make(IDLVoidType, [ + { name: "resourceId", type: IDLI32Type } + ]) + ) + writer.writeNativeMethodDeclaration("_ReleaseArkoalaResource", + NamedMethodSignature.make(IDLVoidType, [ + { name: "resourceId", type: IDLI32Type } + ]) ) }) } @@ -327,6 +370,27 @@ class OHOSVisitor { }) }) }) + const enumsByNS: Map> = new Map(); + this.enums.forEach(e => { + const ns = getExtAttribute(e, IDLExtendedAttributes.Namespace) ?? "" + const enums = getOrPut(enumsByNS, ns, () => new Set()) + enums.add(e) + }) + for (const [ns, enums] of enumsByNS) { + let hasNs = this.peerWriter.language === Language.TS && !!ns + if (hasNs) { + this.peerWriter.print(`export namespace ${ns} {`) + this.peerWriter.pushIndent() + } + for (const e of enums) { + let members = e.elements.map((m, i) => ({ name: m.name, numberId: i, stringId: undefined })) + this.peerWriter.writeEnum(e.name, members, (writer) => {}) + } + if (hasNs) { + this.peerWriter.popIndent() + this.peerWriter.print(`}`) + } + } this.interfaces.forEach(int => { this.peerWriter.writeInterface(`${int.name}Interface`, writer => { int.methods.forEach(method => { @@ -339,12 +403,6 @@ class OHOSVisitor { this.peerWriter.writeClass(`${int.name}`, writer => { writer.writeFieldDeclaration('peer', IDLPointerType, [FieldModifier.PRIVATE], false) const ctors = int.constructors.map(it => ({ parameters: it.parameters, returnType: it.returnType })) - if (ctors.length === 0) { - ctors.push({ - parameters: [], - returnType: IDLVoidType - }) - } ctors.forEach(ctor => { const signature = writer.makeNamedSignature(ctor.returnType ?? IDLVoidType, ctor.parameters) // TODO remove duplicated code from writePeerMethod (PeersPrinter.ts) @@ -398,12 +456,30 @@ class OHOSVisitor { }) }) + // extra memebers from MaterializerPrinter.ts + // TODO refactor MaterializedPrinter to generate OHOS peers + // write getPeer() method const getPeerSig = new MethodSignature(maybeOptional(createReferenceType("Finalizable"), true),[]) writer.writeMethodImplementation(new Method("getPeer", getPeerSig), writer => { // TODO add better (platform-agnostic) way to return Finalizable writer.writeStatement(writer.makeReturn(writer.makeString("{ ptr: this.peer }"))) }) + + // write construct(ptr: number) method + if (ctors.length === 0) { + const typeArguments = int.typeParameters + const clazzRefType = createReferenceType(int.name, typeArguments?.map(createTypeParameterReference)) + const constructSig = new NamedMethodSignature(clazzRefType, [IDLPointerType], ["ptr"]) + writer.writeMethodImplementation(new Method("construct", constructSig, [MethodModifier.STATIC], typeArguments), writer => { + const objVar = `obj${int.name}` + writer.writeStatement(writer.makeAssign(objVar, clazzRefType, writer.makeNewObject(int.name), true)) + writer.writeStatement( + writer.makeAssign(`${objVar}.peer`, undefined, writer.makeString(`ptr`), false) + ) + writer.writeStatement(writer.makeReturn(writer.makeString(objVar))) + }) + } int.methods.forEach(method => { const signature = writer.makeNamedSignature(method.returnType, method.parameters) @@ -511,12 +587,6 @@ class OHOSVisitor { } execute(outDir: string, managedOutDir: string) { - if (this.library.files.length == 0) - throw new Error("No files in library") - - this.libraryName = this.library.files.filter(f => !f.isPredefined)[0].packageName().toUpperCase() - this.library.name = this.libraryName - console.log(`GENERATE OHOS API for ${this.libraryName}`) this.library.files.forEach(file => { @@ -526,11 +596,11 @@ class OHOSVisitor { if (isInterface(entry) || isClass(entry)) { if (isMaterialized(entry)) { this.interfaces.push(entry) - } else if (isEnum(entry)) { - this.enums.push(entry) } else { this.data.push(entry) } + } else if (isEnum(entry)) { + this.enums.push(entry) } entry.scope?.forEach(it => { if (isCallback(it)) @@ -581,6 +651,9 @@ class OHOSVisitor { this.hWriter.printTo(path.join(outDir, `${fileNamePrefix}.h`)) this.cppWriter.printTo(path.join(outDir, `${fileNamePrefix}.cc`)) + fs.writeFileSync(path.join(outDir, this.implementationStubsFile.name), + this.implementationStubsFile.printToString() + ) fs.writeFileSync(path.join(outDir, `SerializerBase.h`), readLangTemplate(`ohos_SerializerBase.h`, Language.CPP) .replaceAll("%NATIVE_API_HEADER_PATH%", `${fileNamePrefix}.h`) @@ -590,18 +663,39 @@ class OHOSVisitor { .replaceAll("%NATIVE_API_HEADER_PATH%", `${fileNamePrefix}.h`) ) - const nativeModuleInfo = { + const managedCodeModuleInfo = { name: `get${this.libraryName}NativeModule`, path: `./${fileNamePrefix}Native`, + serializerPath: `./${fileNamePrefix}Serializer` } - const serializerText = makeSerializerForOhos(this.library, nativeModuleInfo, fileNamePrefix).getOutput().join("\n") + + const serializerText = makeSerializerForOhos(this.library, managedCodeModuleInfo, fileNamePrefix).printToString() fs.writeFileSync(path.join(managedOutDir, `${fileNamePrefix}${ext}`), peerText, 'utf-8') fs.writeFileSync(path.join(managedOutDir, `${fileNamePrefix}Serializer${ext}`), serializerText, 'utf-8') fs.writeFileSync(path.join(managedOutDir, `types${ext}`), readLangTemplate(`types${ext}`, this.library.language)) fs.writeFileSync(path.join(managedOutDir, `SerializerBase${ext}`), readLangTemplate(`SerializerBase${ext}`, this.library.language) - .replaceAll("%NATIVE_MODULE_ACCESSOR%", nativeModuleInfo.name) - .replaceAll("%NATIVE_MODULE_PATH%", nativeModuleInfo.path) + .replaceAll("%NATIVE_MODULE_ACCESSOR%", managedCodeModuleInfo.name) + .replaceAll("%NATIVE_MODULE_PATH%", managedCodeModuleInfo.path) + ) + fs.writeFileSync(path.join(managedOutDir, `DeserializerBase${ext}`), + readLangTemplate(`DeserializerBase${ext}`, this.library.language) + .replaceAll("%NATIVE_MODULE_ACCESSOR%", managedCodeModuleInfo.name) + .replaceAll("%NATIVE_MODULE_PATH%", managedCodeModuleInfo.path) + ) + fs.writeFileSync(path.join(managedOutDir, `CallbacksChecker${ext}`), + readLangTemplate(`CallbacksChecker${ext}`, this.library.language) + .replaceAll("%NATIVE_MODULE_ACCESSOR%", managedCodeModuleInfo.name) + .replaceAll("%NATIVE_MODULE_PATH%", managedCodeModuleInfo.path) + .replaceAll("%SERIALIZER_PATH%", managedCodeModuleInfo.serializerPath) + ) + fs.writeFileSync(path.join(managedOutDir, `DeserializerBase${ext}`), + readLangTemplate(`DeserializerBase${ext}`, this.library.language) + .replaceAll("%NATIVE_MODULE_ACCESSOR%", managedCodeModuleInfo.name) + .replaceAll("%NATIVE_MODULE_PATH%", managedCodeModuleInfo.path) + ) + fs.writeFileSync(path.join(managedOutDir, `ResourceManager${ext}`), + readLangTemplate(`ResourceManager${ext}`, this.library.language) ) } } diff --git a/src/peer-generation/printers/SerializerPrinter.ts b/src/peer-generation/printers/SerializerPrinter.ts index 46911190..fc7e9cd7 100644 --- a/src/peer-generation/printers/SerializerPrinter.ts +++ b/src/peer-generation/printers/SerializerPrinter.ts @@ -38,14 +38,19 @@ import { IDLEntry } from "../../idl"; import { convertDeclaration } from '../LanguageWriters/nameConvertor'; import { collectMaterializedImports } from '../Materialized'; import { generateCallbackKindAccess } from '../ArgConvertors'; -import { ModifierFlags } from 'typescript'; +import { createSourceFile, ModifierFlags } from 'typescript'; +import { SourceFile, TsSourceFile } from './SourceFile'; class IdlSerializerPrinter { constructor( private readonly library: PeerLibrary, - private readonly writer: LanguageWriter, + private readonly destFile: SourceFile, ) {} + private get writer(): LanguageWriter { + return this.destFile.content + } + private generateInterfaceSerializer(target: idl.IDLInterface, prefix: string = "") { const methodName = this.library.getInteropName(target) this.library.setCurrentContext(`write${methodName}()`) @@ -139,7 +144,7 @@ class IdlSerializerPrinter { prefix = PrimitiveType.Prefix + this.library.libraryPrefix const serializerDeclarations = getSerializers(this.library, createSerializerDependencyFilter(this.writer.language)) - printIdlImports(this.library, serializerDeclarations, this.writer, declarationPath) + printIdlImports(this.library, serializerDeclarations, this.destFile, declarationPath) // just a separator if (this.writer.language == Language.JAVA) { this.writer.print("import java.util.function.Supplier;") @@ -195,9 +200,13 @@ class IdlSerializerPrinter { class IdlDeserializerPrinter {///converge w/ IdlSerP? constructor( private readonly library: PeerLibrary, - private readonly writer: LanguageWriter, + private readonly destFile: SourceFile, ) {} + private get writer(): LanguageWriter { + return this.destFile.content + } + private generateInterfaceDeserializer(target: idl.IDLInterface, prefix: string = "") { const methodName = this.library.getInteropName(target) const type = idl.createReferenceType(target.name) @@ -377,7 +386,7 @@ class IdlDeserializerPrinter {///converge w/ IdlSerP? } const serializerDeclarations = getSerializers(this.library, createSerializerDependencyFilter(this.writer.language)) - printIdlImports(this.library, serializerDeclarations, this.writer, declarationPath) + printIdlImports(this.library, serializerDeclarations, this.destFile, declarationPath) this.writer.print("") this.writer.writeClass(className, writer => { if (ctorSignature) { @@ -395,12 +404,26 @@ class IdlDeserializerPrinter {///converge w/ IdlSerP? } } -export function writeSerializer(library: PeerLibrary, writer: LanguageWriter, prefix: string, declarationPath?: string) { - new IdlSerializerPrinter(library, writer).print(prefix, declarationPath) +export function writeSerializer(library: PeerLibrary, writer: LanguageWriter, prefix: string) { + const destFile = SourceFile.make("peers/Serializer" + writer.language.extension, writer.language, library) + writeSerializerFile(library, destFile, prefix) + destFile.printImports(writer) + writer.concat(destFile.content) +} + +export function writeSerializerFile(library: PeerLibrary, destFile: SourceFile, prefix: string, declarationPath?: string) { + new IdlSerializerPrinter(library, destFile).print(prefix, declarationPath) +} + +export function writeDeserializer(library: PeerLibrary, writer: LanguageWriter, prefix: string) { + const destFile = SourceFile.make("peers/Deserializer" + writer.language.extension, writer.language, library) + writeDeserializerFile(library, destFile, prefix) + destFile.printImports(writer) + writer.concat(destFile.content) } -export function writeDeserializer(library: PeerLibrary, writer: LanguageWriter, prefix = "", declarationPath?: string) { - const printer = new IdlDeserializerPrinter(library, writer) +export function writeDeserializerFile(library: PeerLibrary, destFile: SourceFile, prefix: string, declarationPath?: string) { + const printer = new IdlDeserializerPrinter(library, destFile) printer.print(prefix, declarationPath) } @@ -415,35 +438,44 @@ function getSerializers(library: PeerLibrary, dependencyFilter: DependencyFilter }) } -function printIdlImports(library: PeerLibrary, serializerDeclarations: SerializableTarget[], writer: LanguageWriter, declarationPath?: string) { - const collector = new ImportsCollector() - - if (writer.language === Language.TS) { +function printIdlImports(library: PeerLibrary, serializerDeclarations: SerializableTarget[], destFile: SourceFile, declarationPath?: string) { + if (destFile.language === Language.TS) { + const collector = (destFile as TsSourceFile).imports for (let [module, {dependencies, declarations}] of makeSyntheticDeclarationsFiles()) { declarations.forEach(it => collector.addFeature(it.name!, module)) } - for (let builder of library.builderClasses.keys()) { - collector.addFeature(builder, `Ark${builder}Builder`) + if (!declarationPath) { + for (let builder of library.builderClasses.keys()) { + collector.addFeature(builder, `Ark${builder}Builder`) + } + collector.addFeature(`Finalizable`, `Finalizable`) + collectMaterializedImports(collector, library) } - collector.addFeature(`Finalizable`, `Finalizable`) - collectMaterializedImports(collector, library) if (declarationPath) { // This is used for OHOS library generation only // TODO Check for compatibility! const makeFeature = (node: idl.IDLEntry) => { - return { + let features = [] + // Enums of OHOS are accessed through namespaces, not directly + let ns = idl.getExtAttribute(node, idl.IDLExtendedAttributes.Namespace) + if (ns) { + features.push({ feature: ns, module: `./${declarationPath}` }) // TODO resolve + } + features.push({ feature: convertDeclaration(DeclarationNameConvertor.I, node), module: `./${declarationPath}` // TODO resolve - } + }) + return features } serializerDeclarations.filter(it => it.fileName) .filter(it => !idl.isCallback(it) && !(library.files.find(f => f.originalFilename == it.fileName)?.isPredefined)) - .map(makeFeature) + .flatMap(makeFeature) .forEach(it => collector.addFeature(it.feature, it.module)) } } - else if (writer.language === Language.ARKTS) { + else if (destFile.language === Language.ARKTS) { + const collector = new ImportsCollector() collector.addFeature("TypeChecker", "#components") collector.addFeature(`KPointer`, `@koalaui/interop`) @@ -458,10 +490,9 @@ function printIdlImports(library: PeerLibrary, serializerDeclarations: Serializa for (let builder of library.builderClasses.keys()) { collector.addFeature(builder, `Ark${builder}Builder`) } + // TODO Refactor to remove dependency on hardcoded paths + collector.print(destFile.content, (declarationPath ? "." : "./peers/") + `Serializer.${destFile.language.extension}`) } - - // TODO Refactor to remove dependency on hardcoded paths - collector.print(writer, (declarationPath ? "." : "./peers/") + `Serializer.${writer.language.extension}`) } function createSerializerDependencyFilter(language: Language): DependencyFilter { diff --git a/src/peer-generation/printers/SourceFile.ts b/src/peer-generation/printers/SourceFile.ts index d6ec24c5..e6aa94c3 100644 --- a/src/peer-generation/printers/SourceFile.ts +++ b/src/peer-generation/printers/SourceFile.ts @@ -50,6 +50,8 @@ export abstract class SourceFile { } public abstract printToString(): string; + // TODO make protected + public abstract printImports(writer: LanguageWriter): void; protected abstract onMerge(file: this): void; } @@ -90,12 +92,7 @@ export class CppSourceFile extends SourceFile { fileWriter.print(`#ifndef ${includeGuard}\n#define ${includeGuard}\n`) } - for (const include of this.includes) { - fileWriter.writeInclude(include) - } - for (const include of this.globalIncludes) { - fileWriter.writeGlobalInclude(include) - } + this.printImports(fileWriter) fileWriter.print("") fileWriter.concat(this.content) @@ -105,6 +102,17 @@ export class CppSourceFile extends SourceFile { return fileWriter.getOutput().join("\n") } + + public printImports(writer: LanguageWriter): void { + if (!(writer instanceof CppLanguageWriter)) throw new TypeError("illegal language writer") + + for (const include of this.includes) { + writer.writeInclude(include) + } + for (const include of this.globalIncludes) { + writer.writeGlobalInclude(include) + } + } } export class TsSourceFile extends SourceFile { @@ -128,11 +136,16 @@ export class TsSourceFile extends SourceFile { public printToString(): string { let fileWriter = createLanguageWriter(Language.TS, this.resolver) as TSLanguageWriter fileWriter.print(cStyleCopyright) - this.imports.print(fileWriter, this.moduleName) + this.printImports(fileWriter) fileWriter.print("") fileWriter.concat(this.content) return fileWriter.getOutput().join("\n") } + + public printImports(writer: LanguageWriter): void { + if (!(writer instanceof TSLanguageWriter)) throw new TypeError("illegal language writer") + this.imports.print(writer, this.moduleName) + } } /** @deprecated Each destination language should have its own SourceFile implementation */ @@ -140,5 +153,6 @@ export class GenericSourceFile extends SourceFile { public printToString(): string { return this.content.getOutput().join("\n") } + public printImports(writer: LanguageWriter): void {} protected onMerge(file: this): void {} } \ No newline at end of file diff --git a/templates/ts/CallbacksChecker.ts b/templates/ts/CallbacksChecker.ts new file mode 100644 index 00000000..7d98decd --- /dev/null +++ b/templates/ts/CallbacksChecker.ts @@ -0,0 +1,40 @@ +import { float32, int32, pointer, Finalizable } from "./types" +import { ResourceHolder } from "./ResourceManager" +import { Deserializer, deserializeAndCallCallback } from "%SERIALIZER_PATH%" +import { %NATIVE_MODULE_ACCESSOR% } from "%NATIVE_MODULE_PATH%" + +enum CallbackEventKind { + Event_CallCallback = 0, + Event_HoldManagedResource = 1, + Event_ReleaseManagedResource = 2, +} + +const bufferSize = 1024 +const buffer = new Uint8Array(bufferSize) +const deserializer = new Deserializer(buffer.buffer, bufferSize) +export function checkArkoalaCallbacks() { + while (true) { + let result = %NATIVE_MODULE_ACCESSOR%()._CheckArkoalaCallbackEvent(buffer, bufferSize) + if (result == 0) break + + deserializer.resetCurrentPosition() + const eventKind = deserializer.readInt32() as CallbackEventKind + switch (eventKind) { + case CallbackEventKind.Event_CallCallback: { + deserializeAndCallCallback(deserializer) + break; + } + case CallbackEventKind.Event_HoldManagedResource: { + const resourceId = deserializer.readInt32() + ResourceHolder.instance().hold(resourceId) + break; + } + case CallbackEventKind.Event_ReleaseManagedResource: { + const resourceId = deserializer.readInt32() + ResourceHolder.instance().release(resourceId) + break; + } + default: throw new Error(`Unknown callback event kind ${eventKind}`) + } + } +} diff --git a/templates/ts/DeserializerBase.ts b/templates/ts/DeserializerBase.ts new file mode 100644 index 00000000..cbdb8989 --- /dev/null +++ b/templates/ts/DeserializerBase.ts @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2024 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 {float32, int32, pointer} from "./types" +import {RuntimeType, Tags, CallbackResource } from "./SerializerBase"; +// import { Length } from "@arkoala/arkui" + +export class DeserializerBase { + private position = 0 + private readonly buffer: ArrayBuffer + private readonly length: int32 + private view: DataView + private static textDecoder = new TextDecoder() + private static customDeserializers: CustomDeserializer | undefined = undefined + + static registerCustomDeserializer(deserializer: CustomDeserializer) { + let current = DeserializerBase.customDeserializers + if (current == undefined) { + DeserializerBase.customDeserializers = deserializer + } else { + while (current.next != undefined) { + current = current.next + } + current.next = deserializer + } + } + + constructor(buffer: ArrayBuffer, length: int32) { + this.buffer = buffer + this.length = length + this.view = new DataView(this.buffer) + } + + static get( + factory: (args: Uint8Array, length: int32) => T, + args: Uint8Array, length: int32): T { + + // TBD: Use cache + return factory(args, length); + } + + asArray(position?: number, length?: number): Uint8Array { + return new Uint8Array(this.buffer, position, length) + } + + currentPosition(): int32 { + return this.position + } + + resetCurrentPosition(): void { + this.position = 0 + } + + private checkCapacity(value: int32) { + if (value > this.length) { + throw new Error(`${value} is less than remaining buffer length`) + } + } + + readInt8(): int32 { + this.checkCapacity(1) + const value = this.view.getInt8(this.position) + this.position += 1 + return value + } + + readInt32(): int32 { + this.checkCapacity(4) + const value = this.view.getInt32(this.position, true) + this.position += 4 + return value + } + + // readInt64(): int64 { + // this.checkCapacity(8) + // const value = this.view.getBigInt64(this.position, true) + // this.position += 8 + // return Number(value) + // } + + readPointer(): pointer { + this.checkCapacity(8) + const value = this.view.getBigInt64(this.position, true) + this.position += 8 + return value + } + + readFloat32(): float32 { + this.checkCapacity(4) + const value = this.view.getFloat32(this.position, true) + this.position += 4 + return value + } + + readBoolean(): boolean { + this.checkCapacity(1) + const value = this.view.getInt8(this.position) + this.position += 1 + return value == 1 + } + + readFunction(): any { + // TODO: not exactly correct. + const id = this.readInt32() + return id + } + + readMaterialized(): object { + const ptr = this.readPointer() + return { ptr: ptr } + } + + readString(): string { + const length = this.readInt32() + this.checkCapacity(length) + // read without null-terminated byte + const value = DeserializerBase.textDecoder.decode(this.asArray(this.position, length - 1)); + this.position += length + return value + } + + readCustomObject(kind: string): any { + let current = DeserializerBase.customDeserializers + while (current) { + if (current.supports(kind)) { + return current.deserialize(this, kind) + } + current = current.next + } + // consume tag + const tag = this.readInt8() + return undefined + } + + readNumber(): number | undefined { + const tag = this.readInt8() + switch (tag) { + case Tags.UNDEFINED: + return undefined; + case Tags.INT32: + return this.readInt32() + case Tags.FLOAT32: + return this.readFloat32() + default: + throw new Error(`Unknown number tag: ${tag}`) + break + } + } + + // readLength(): Length | undefined { + // this.checkCapacity(1) + // const valueType = this.readInt8() + // switch (valueType) { + // case RuntimeType.OBJECT: + // return { + // id: this.readInt32(), + // bundleName: "", + // moduleName: "" + // } + // case RuntimeType.STRING: + // return this.readString() + // case RuntimeType.NUMBER: + // return this.readFloat32() + // } + // return undefined + // } + + readCallbackResource(): CallbackResource { + return { + resourceId: this.readInt32(), + hold: this.readPointer(), + release: this.readPointer(), + } + } + + static lengthUnitFromInt(unit: int32): string { + let suffix: string + switch (unit) { + case 0: + suffix = "px" + break + case 1: + suffix = "vp" + break + case 3: + suffix = "%" + break + case 4: + suffix = "lpx" + break + default: + suffix = "" + } + return suffix + } +} + +export abstract class CustomDeserializer { + protected constructor(protected supported: Array) { + } + + supports(kind: string): boolean { + return this.supported.includes(kind) + } + + abstract deserialize(serializer: DeserializerBase, kind: string): any + + next: CustomDeserializer | undefined = undefined +} + +class DateDeserializer extends CustomDeserializer { + constructor() { + super(["Date"]); + } + + deserialize(serializer: DeserializerBase, kind: string): any { + return new Date(serializer.readString()) + } +} +DeserializerBase.registerCustomDeserializer(new DateDeserializer()) diff --git a/templates/ts/OHOSNativeModule_template.ts b/templates/ts/OHOSNativeModule_template.ts index 01beb2bd..3ca314d0 100644 --- a/templates/ts/OHOSNativeModule_template.ts +++ b/templates/ts/OHOSNativeModule_template.ts @@ -1,4 +1,4 @@ -import { pointer, int32, EventType, KPointer, Finalizable } from "./types" +import { pointer, int32, KPointer, Finalizable } from "./types" %NATIVE_MODULE_CONTENT% diff --git a/templates/ts/OHOSPeer_template.ts b/templates/ts/OHOSPeer_template.ts index 971baae3..99f4997c 100644 --- a/templates/ts/OHOSPeer_template.ts +++ b/templates/ts/OHOSPeer_template.ts @@ -1,4 +1,4 @@ -import { pointer, int32, EventType, KPointer, Finalizable } from "./types" +import { pointer, int32, KPointer, Finalizable } from "./types" import { Tags, RuntimeType, runtimeType, isInstanceOf, unsafeCast } from "./SerializerBase" import { Serializer } from "%SERIALIZER_PATH%" diff --git a/templates/ts/ResourceManager.ts b/templates/ts/ResourceManager.ts new file mode 100644 index 00000000..c5248bcb --- /dev/null +++ b/templates/ts/ResourceManager.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2022-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. + */ + +import { int32 } from "./types" + +export type ResourceId = int32 + +interface ResourceInfo { + resource: object + holdersCount: int32 +} + +export class ResourceHolder { + private static nextResourceId: ResourceId = 100 + private resources: Map = new Map() + private static _instance: ResourceHolder|undefined = undefined + static instance(): ResourceHolder { + if (ResourceHolder._instance == undefined) { + ResourceHolder._instance = new ResourceHolder() + } + return ResourceHolder._instance! + } + + public hold(resourceId: ResourceId) { + if (!this.resources.has(resourceId)) + throw new Error(`Resource ${resourceId} does not exists, can not hold`) + this.resources.get(resourceId)!.holdersCount++ + } + + public release(resourceId: ResourceId) { + if (!this.resources.has(resourceId)) + throw new Error(`Resource ${resourceId} does not exists, can not release`) + const resource = this.resources.get(resourceId)! + resource.holdersCount-- + if (resource.holdersCount <= 0) + this.resources.delete(resourceId) + } + + public registerAndHold(resource: object): ResourceId { + const resourceId = ResourceHolder.nextResourceId++ + this.resources.set(resourceId, { + resource: resource, + holdersCount: 1, + }) + return resourceId + } + + public get(resourceId: ResourceId): object { + if (!this.resources.has(resourceId)) + throw new Error(`Resource ${resourceId} does not exists`) + return this.resources.get(resourceId)!.resource + } +} diff --git a/templates/ts/SerializerBase.ts b/templates/ts/SerializerBase.ts index 38e8ff2c..2fdf1aea 100644 --- a/templates/ts/SerializerBase.ts +++ b/templates/ts/SerializerBase.ts @@ -14,6 +14,7 @@ */ import { float32, int32, pointer, Finalizable } from "./types" import { %NATIVE_MODULE_ACCESSOR% as nativeModule, CallbackKind } from "%NATIVE_MODULE_PATH%" +import { ResourceHolder, ResourceId } from "./ResourceManager" /** * Value representing possible JS runtime object type. @@ -86,6 +87,12 @@ export abstract class CustomSerializer { next: CustomSerializer | undefined = undefined } +export interface CallbackResource { + resourceId: int32 + hold: pointer + release: pointer +} + export class SerializerBase { private position = 0 private buffer: ArrayBuffer @@ -134,36 +141,25 @@ export class SerializerBase { this.view = new DataView(resizedBuffer) } } - // TODO implement callback and check do we need this for a custom OHOS library - // private heldResources: ResourceId[] = [] - - holdAndWriteCallback(callback: object, kind: CallbackKind) { - this.writeInt32(42) + private heldResources: ResourceId[] = [] + holdAndWriteCallback(callback: object) { + const resourceId = ResourceHolder.instance().registerAndHold(callback) + this.heldResources.push(resourceId) + this.writeInt32(resourceId) this.writePointer(0n) this.writePointer(0n) this.writePointer(0n) - // const resourceId = ResourceManager.registerAndHold(callback) - // this.heldResources.push(resourceId) - // this.writeInt32(resourceId) - // this.writePointer(nativeModule()._GetManagedResourceHolder()) - // this.writePointer(nativeModule()._GetManagedResourceReleaser()) - // this.writePointer(nativeModule()._GetManagerCallbackCaller(kind)) } - - writeCallbackResource(resource: object /*CallbackResource*/) { - this.writeInt32(42) - this.writePointer(0n) - this.writePointer(0n) - // this.writeInt32(resource.resourceId) - // this.writePointer(resource.hold) - // this.writePointer(resource.release) + writeCallbackResource(resource: CallbackResource) { + this.writeInt32(resource.resourceId) + this.writePointer(resource.hold) + this.writePointer(resource.release) } - private releaseResources() { - // for (const resourceId of this.heldResources) - // ResourceManager.release(resourceId) - // // todo think about effective array clearing/pushing - // this.heldResources = [] + for (const resourceId of this.heldResources) + nativeModule()._ReleaseArkoalaResource(resourceId) + // todo think about effective array clearing/pushing + this.heldResources = [] } writeCustomObject(kind: string, value: any) { let current = SerializerBase.customSerializers diff --git a/templates/ts/types.ts b/templates/ts/types.ts index a3c400db..8a60088b 100644 --- a/templates/ts/types.ts +++ b/templates/ts/types.ts @@ -1,6 +1,7 @@ export type pointer = bigint export type int32 = number export type float32 = number -export type EventType = number export type KPointer = pointer export type Finalizable = { ptr: pointer } + +export const nullptr: pointer = BigInt(0) -- Gitee From 4b974265d49f32cbbcbb09d251e1520dda4eba8b Mon Sep 17 00:00:00 2001 From: pavelpozdeev Date: Mon, 18 Nov 2024 11:11:54 +0000 Subject: [PATCH 22/53] !962 CJ: expansion of interfaces --- cjpm.toml | 2 +- .../framework/cangjie/src/Ark_CustomObject.cj | 2 +- .../framework/cangjie/src/Ark_Object.cj | 6 +- .../framework/cangjie/src/Ark_Undefined.cj | 25 ++ .../framework/cangjie/src/SerializerBase.cj | 8 +- .../arkoala/framework/cangjie/src/index.cj | 60 +++- .../convertors/CJConvertors.ts | 10 +- .../writers/CJLanguageWriter.ts | 45 ++- .../printers/NativeModulePrinter.ts | 4 +- src/peer-generation/printers/PeersPrinter.ts | 15 +- .../printers/SerializerPrinter.ts | 13 +- tests/cangjie-subset/common.d.ts | 253 ++++++++++++++- tests/cangjie-subset/list.d.ts | 34 ++ tests/cangjie-subset/test.d.ts | 294 ++++++++++++++++++ 14 files changed, 729 insertions(+), 42 deletions(-) create mode 100644 peer_lib/sig/arkoala/framework/cangjie/src/Ark_Undefined.cj create mode 100644 tests/cangjie-subset/list.d.ts create mode 100644 tests/cangjie-subset/test.d.ts diff --git a/cjpm.toml b/cjpm.toml index 7c943d9d..e4ee456e 100644 --- a/cjpm.toml +++ b/cjpm.toml @@ -1,7 +1,7 @@ [dependencies] [package] - cjc-version = "0.53.4" + cjc-version = "0.56.4" compile-option = "-L ./native/build-cangjie-native-dummy -l NativeBridgeCJ" description = "config file for cj build" link-option = "" diff --git a/peer_lib/sig/arkoala/framework/cangjie/src/Ark_CustomObject.cj b/peer_lib/sig/arkoala/framework/cangjie/src/Ark_CustomObject.cj index efb5ef64..ca6569c6 100644 --- a/peer_lib/sig/arkoala/framework/cangjie/src/Ark_CustomObject.cj +++ b/peer_lib/sig/arkoala/framework/cangjie/src/Ark_CustomObject.cj @@ -22,7 +22,7 @@ import std.collection.* public open class DateCustomSerializer <: CustomSerializer { public DateCustomSerializer() { - super(Array(["Date"])) + super(["Date"]) } public func serialize(serializer: SerializerBase, value: Ark_CustomObject, kind: String): Unit { serializer.writeString("{}") diff --git a/peer_lib/sig/arkoala/framework/cangjie/src/Ark_Object.cj b/peer_lib/sig/arkoala/framework/cangjie/src/Ark_Object.cj index 193d6811..58e54c21 100644 --- a/peer_lib/sig/arkoala/framework/cangjie/src/Ark_Object.cj +++ b/peer_lib/sig/arkoala/framework/cangjie/src/Ark_Object.cj @@ -87,7 +87,11 @@ public abstract class Ark_Object { static func getRuntimeType(object: ?T): RuntimeType where T <: Ark_Object { if(let Some(obj) <- object) { - return Ark_Object.getRuntimeType(object as Ark_Object) + let object = match (object) { + case Some(object) => object + case _ => throw Exception("Failed to case child class of Ark_Object to Ark_Object") + } + return object.runtimeType() } else { return RuntimeType.UNDEFINED diff --git a/peer_lib/sig/arkoala/framework/cangjie/src/Ark_Undefined.cj b/peer_lib/sig/arkoala/framework/cangjie/src/Ark_Undefined.cj new file mode 100644 index 00000000..95eebe18 --- /dev/null +++ b/peer_lib/sig/arkoala/framework/cangjie/src/Ark_Undefined.cj @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 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. + */ + + +// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! + +package idlize + +public class Ark_Undefined <: Ark_ObjectBase { + public func runtimeType(): RuntimeType { + return RuntimeType.UNDEFINED + } +} diff --git a/peer_lib/sig/arkoala/framework/cangjie/src/SerializerBase.cj b/peer_lib/sig/arkoala/framework/cangjie/src/SerializerBase.cj index 2501d749..e2db2dc3 100644 --- a/peer_lib/sig/arkoala/framework/cangjie/src/SerializerBase.cj +++ b/peer_lib/sig/arkoala/framework/cangjie/src/SerializerBase.cj @@ -69,10 +69,9 @@ public open class SerializerBase { static func registerCustomSerializer(serializer: CustomSerializer) { //TODO } - func resetCurrentPosition(): Unit { this.position = 0 } init() { - this.buffer = ArrayList(Array(96, item: 0)) + this.buffer = ArrayList(Array(96, repeat: UInt8(0))) } public func release() { this.isHolding = false @@ -111,7 +110,7 @@ public open class SerializerBase { // TODO } private func setBytes(position: Int64, value: T): Unit where T <: LittleEndianOrder{ - var arr = Array(100, item: 0) + var arr = Array(100, repeat: 0) let n = value.writeLittleEndian(arr) this.checkCapacity(n) for (i in 0..n) { @@ -203,10 +202,11 @@ public open class SerializerBase { } func writeString(value: String): Unit { this.checkCapacity(4 + value.size * 4 + 1) // length, data - this.writeInt32(Int32(value.size)) + this.writeInt32(Int32(value.size + 1)) for (i in 0..value.size) { this.setBytes(this.position, value[i]) } + this.writeInt8(Int8(0)) } // Length is an important common case. func writeLength(value: Ark_Length) { diff --git a/peer_lib/sig/arkoala/framework/cangjie/src/index.cj b/peer_lib/sig/arkoala/framework/cangjie/src/index.cj index 392c2202..94a669e5 100644 --- a/peer_lib/sig/arkoala/framework/cangjie/src/index.cj +++ b/peer_lib/sig/arkoala/framework/cangjie/src/index.cj @@ -22,7 +22,7 @@ import std.collection.* public func getNativeString(ptr: Int64): String { let length = NativeModule._StringLength(ptr) - var data = ArrayList(Array(Int64(length), item: 0)) + var data = ArrayList(Array(Int64(length), repeat: UInt8(0))) data = NativeModule._StringData(ptr, data, length) var result = StringBuilder() for (i in 0..length) { @@ -75,10 +75,66 @@ func peersTest(): Unit { println("CJ peer tests") // interface let buttonPeer = ArkButtonPeer.create(ArkUINodeType.Button, Option.None, 0) - let labelStyle = LabelStyle(None, 5.0, None, None, None, None) + let labelStyle = LabelStyle(Option.None, 5.0, Option.None, Option.None, Option.None, Option.None) checkResult("[Interface + Optional] ButtonPeer.labelStyle", { => buttonPeer.labelStyleAttribute(labelStyle) }, "labelStyle({.overflow={.tag=ARK_TAG_UNDEFINED, .value={}}, .maxLines={.tag=ARK_TAG_OBJECT, .value={.tag=102, .i32=5}}, .minFontSize={.tag=ARK_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=ARK_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=ARK_TAG_UNDEFINED, .value={}}, .font={.tag=ARK_TAG_UNDEFINED, .value={}}})") + // union + labelStyle.maxLines = Option.None + labelStyle.font = Font(Option.None, Union_FontWeight_Float64_String("param"), Option.None, Option.None) + checkResult("[Union] ButtonPeer.labelStyle", + { => buttonPeer.labelStyleAttribute(labelStyle) }, + "labelStyle({.overflow={.tag=ARK_TAG_UNDEFINED, .value={}}, .maxLines={.tag=ARK_TAG_UNDEFINED, .value={}}, .minFontSize={.tag=ARK_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=ARK_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=ARK_TAG_UNDEFINED, .value={}}, .font={.tag=ARK_TAG_OBJECT, .value={.size={.tag=ARK_TAG_UNDEFINED, .value={}}, .weight={.tag=ARK_TAG_OBJECT, .value={.selector=2, .value2={.chars=\"param\", .length=5}}}, .family={.tag=ARK_TAG_UNDEFINED, .value={}}, .style={.tag=ARK_TAG_UNDEFINED, .value={}}}}})"); + labelStyle.font = Font(Option.None, Union_FontWeight_Float64_String(FontWeight.BOLD), Option.None, Option.None) + checkResult("[Union + Enum] ButtonPeer.labelStyle", + { => buttonPeer.labelStyleAttribute(labelStyle) }, + "labelStyle({.overflow={.tag=ARK_TAG_UNDEFINED, .value={}}, .maxLines={.tag=ARK_TAG_UNDEFINED, .value={}}, .minFontSize={.tag=ARK_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=ARK_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=ARK_TAG_UNDEFINED, .value={}}, .font={.tag=ARK_TAG_OBJECT, .value={.size={.tag=ARK_TAG_UNDEFINED, .value={}}, .weight={.tag=ARK_TAG_OBJECT, .value={.selector=0, .value0=Ark_FontWeight(4)}}, .family={.tag=ARK_TAG_UNDEFINED, .value={}}, .style={.tag=ARK_TAG_UNDEFINED, .value={}}}}})"); + let resource = Resource("bundle_name", "module_name", 10.0, Option.None, 2000.0) + labelStyle.font = Font(Option.None, Option.None, Union_String_Resource(resource), Option.None) + checkResult("[Union + Resource] ButtonPeer.labelStyle", + { => buttonPeer.labelStyleAttribute(labelStyle) }, + "labelStyle({.overflow={.tag=ARK_TAG_UNDEFINED, .value={}}, .maxLines={.tag=ARK_TAG_UNDEFINED, .value={}}, .minFontSize={.tag=ARK_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=ARK_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=ARK_TAG_UNDEFINED, .value={}}, .font={.tag=ARK_TAG_OBJECT, .value={.size={.tag=ARK_TAG_UNDEFINED, .value={}}, .weight={.tag=ARK_TAG_UNDEFINED, .value={}}, .family={.tag=ARK_TAG_OBJECT, .value={.selector=1, .value1={.bundleName={.chars=\"bundle_name\", .length=11}, .moduleName={.chars=\"module_name\", .length=11}, .id={.tag=102, .i32=10}, .params={.tag=ARK_TAG_UNDEFINED, .value={}}, .type_={.tag=ARK_TAG_OBJECT, .value={.tag=102, .i32=2000}}}}}, .style={.tag=ARK_TAG_UNDEFINED, .value={}}}}})" + ) + // tuple + let peer = ArkTestPeer.create(ArkUINodeType.Test, Option.None, 0) + let options = BlurOptions(Tuple_Float64_Float64(1.0, 2.0)) + checkResult("[Tuple] TestPeer.backdropBlur", + { => peer.backdropBlurAttribute(42.0, options) }, + "backdropBlur({.tag=102, .i32=42}, {.tag=ARK_TAG_OBJECT, .value={.grayscale={.value0={.tag=102, .i32=1}, .value1={.tag=102, .i32=2}}}})"); + let tuple1 = Tuple_Float64_String_EnumDTS(5.5, "test", EnumDTS.ELEM_1) + checkResult("[Tuple + Enum] TestPeer.testTupleNumberStringEnum", + { => peer.testTupleNumberStringEnumAttribute(tuple1) }, + "testTupleNumberStringEnum({.value0={.tag=103, .f32=5.5}, .value1={.chars=\"test\", .length=4}, .value2=Ark_EnumDTS(1)})") + + // optional + let listPeer = ArkListPeer.create(ArkUINodeType.List, Option.None, 0); + checkResult("[Optional] ListPeer.someOptional", + { => listPeer.someOptionalAttribute(Union_Bool_Ark_Undefined(false)) }, + "someOptional({.selector=0, .value0=false})"); + + // enum + checkResult("[Enum] ButtonPeer.type", { => buttonPeer.typeAttribute(ButtonType.CAPSULE) }, "type(Ark_ButtonType(0))"); + let sheetOptions = SheetOptions(Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + Option.None, + SheetMode.EMBEDDED, + Option.None) + checkResult("[Enum + Interface] ButtonPeer.bindSheet", + { => buttonPeer.bindSheetAttribute(false, sheetOptions) }, + "bindSheet(false, {.tag=ARK_TAG_OBJECT, .value={.backgroundColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .height={.tag=ARK_TAG_UNDEFINED, .value={}}, .dragBar={.tag=ARK_TAG_UNDEFINED, .value={}}, .maskColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .detents={.tag=ARK_TAG_UNDEFINED, .value={}}, .blurStyle={.tag=ARK_TAG_UNDEFINED, .value={}}, .showClose={.tag=ARK_TAG_UNDEFINED, .value={}}, .preferType={.tag=ARK_TAG_UNDEFINED, .value={}}, .title={.tag=ARK_TAG_UNDEFINED, .value={}}, .enableOutsideInteractive={.tag=ARK_TAG_UNDEFINED, .value={}}, .width={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderWidth={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderColor={.tag=ARK_TAG_UNDEFINED, .value={}}, .borderStyle={.tag=ARK_TAG_UNDEFINED, .value={}}, .shadow={.tag=ARK_TAG_UNDEFINED, .value={}}, .mode={.tag=ARK_TAG_OBJECT, .value=Ark_SheetMode(1)}, .uiContext={.tag=ARK_TAG_UNDEFINED, .value={}}}})"); + } diff --git a/src/peer-generation/LanguageWriters/convertors/CJConvertors.ts b/src/peer-generation/LanguageWriters/convertors/CJConvertors.ts index 3bf6777d..b3a2165f 100644 --- a/src/peer-generation/LanguageWriters/convertors/CJConvertors.ts +++ b/src/peer-generation/LanguageWriters/convertors/CJConvertors.ts @@ -201,7 +201,7 @@ export class CJIDLNodeToStringConvertor extends IdlNameConvertorBase implements case 'KUint8ArrayPtr': return 'Int64' case 'KInt32ArrayPtr': return 'Int64' case 'KFloat32ArrayPtr': return 'Int64' - case 'KStringPtr': return 'Int64' + case 'KStringPtr': return 'String' case 'string': return 'String' case 'ArrayBuffer': return 'ArrayList' } @@ -222,9 +222,13 @@ export class CJIDLTypeToForeignStringConvertor extends CJIDLNodeToStringConverto return `CPointer<${this.convert(type.elementType[0])}>` } } - if (idl.isReferenceType(type) && super.convertType(type).startsWith('Array')) { + if (idl.isReferenceType(type)) { // Fix, actual mapping has to be due to IDLType - return `CPointer` + if (super.convertType(type).startsWith('Array')) + return `CPointer` + if (super.convertType(type) == 'String') { + return `CString` + } } return super.convertType(type) } diff --git a/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts index 82404d22..11ead94d 100644 --- a/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts @@ -76,6 +76,20 @@ export class CJCastExpression implements LanguageExpression { } } +export class CJMatchExpression implements LanguageExpression { + constructor(public matchValue: LanguageExpression, public matchCases: LanguageExpression[], public caseBlocks: LanguageExpression[]) {} + asString(): string { + let output: string[] = [] + output.push(`match (${this.matchValue.asString()}) {`) + for (let index in this.matchCases) { + output.push(`case ${this.matchCases[index].asString()} => ${this.caseBlocks[index].asString()} `) + } + output.push(`case _ => throw Exception(\"Unmatched pattern ${this.matchValue.asString()}\")`) + output.push(`}`) + return output.join('\n') + } +} + //////////////////////////////////////////////////////////////// // STATEMENTS // //////////////////////////////////////////////////////////////// @@ -148,6 +162,22 @@ class CJThrowErrorStatement implements LanguageStatement { } } +class CJCheckOptionalStatement implements LanguageStatement { + constructor( + public undefinedValue: string, + public optionalExpression: LanguageExpression, + public doStatement: LanguageStatement + ) { } + write(writer: LanguageWriter): void { + writer.print(`if (let Some(${this.optionalExpression.asString()}) <- ${this.optionalExpression.asString()}) {`) + writer.pushIndent() + this.doStatement.write(writer) + writer.popIndent() + writer.print('}') + } +} + + //////////////////////////////////////////////////////////////// // WRITER // @@ -228,7 +258,7 @@ export class CJLanguageWriter extends LanguageWriter { this.printer.print(`${modifiers ? modifiers.map((it) => MethodModifier[it].toLowerCase()).join(' ') + ' ' : ''}${className}(${signature.args.map((it, index) => `${signature.argName(index)}: ${idl.isOptionalType(it) ? '?' : ''}${this.stringifyType(it)}`).join(", ")}) {`) this.pushIndent() if (superCall) { - this.print(`super(${superCall.signature.args.map((_, i) => superCall?.signature.argName(i)).join(", ")});`) + this.print(`super(${superCall.signature.args.map((_, i) => superCall?.signature.argName(i)).join(", ")})`) } op(this) this.popIndent() @@ -290,10 +320,10 @@ export class CJLanguageWriter extends LanguageWriter { return new CJAssignStatement(variableName, type, expr, isDeclared, isConst) } makeClassInit(type: idl.IDLType, paramenters: LanguageExpression[]): LanguageExpression { - throw new Error(`TBD`) + throw new Error(`makeClassInit`) } makeArrayInit(type: idl.IDLContainerType): LanguageExpression { - throw new Error(`TBD`) + throw new Error(`makeArrayInit`) } makeMapInit(type: idl.IDLType): LanguageExpression { throw new Error(`TBD`) @@ -315,7 +345,7 @@ export class CJLanguageWriter extends LanguageWriter { return new ReturnStatement(expr) } makeCheckOptional(optional: LanguageExpression, doStatement: LanguageStatement): LanguageStatement { - throw new Error(`TBD`) + return new CJCheckOptionalStatement("undefined", optional, doStatement) } makeStatement(expr: LanguageExpression): LanguageStatement { return new ExpressionStatement(expr) @@ -341,6 +371,9 @@ export class CJLanguageWriter extends LanguageWriter { makeUndefined(): LanguageExpression { return this.makeString("Option.None") } + override makeUnwrapOptional(expression: LambdaExpression): LanguageExpression { + return new CJMatchExpression(expression, [this.makeString('Some(serializer)')], [this.makeString('serializer')]) + } makeValueFromOption(value: string, destinationConvertor: ArgConvertor): LanguageExpression { return this.makeString(`${value}`) } @@ -358,7 +391,7 @@ export class CJLanguageWriter extends LanguageWriter { return new StringExpression(`None<${value}>`) } getTagType(): IDLType { - return toIDLType("Tags"); + return toIDLType("Tags") } getRuntimeType(): IDLType { return IDLNumberType @@ -389,7 +422,7 @@ export class CJLanguageWriter extends LanguageWriter { throw new Error('Not yet implemented') } ordinalFromEnum(value: LanguageExpression, _: idl.IDLEnum): LanguageExpression { - throw new Error('Not yet implemented') + return value } makeEnumEntity(enumEntity: idl.IDLEnum, isExport: boolean): LanguageStatement { return new CJEnumEntityStatement(enumEntity, isExport) diff --git a/src/peer-generation/printers/NativeModulePrinter.ts b/src/peer-generation/printers/NativeModulePrinter.ts index a4fe2c99..bd842c84 100644 --- a/src/peer-generation/printers/NativeModulePrinter.ts +++ b/src/peer-generation/printers/NativeModulePrinter.ts @@ -225,7 +225,7 @@ class CJNativeModuleVisitor extends NativeModuleVisitor { printer.pushIndent() for(let param of parameters.args) { let ordinal = parameters.args.indexOf(param) - if (this.arrayLikeTypes.has(idl.forceAsNamedNode(param).name)) { + if (idl.isContainerType(param) || this.arrayLikeTypes.has(idl.forceAsNamedNode(param).name)) { functionCallArgs.push(`handle_${ordinal}.pointer`) printer.print(`let handle_${ordinal} = acquireArrayRawData(${parameters.argsNames[ordinal]}.toArray())`) } else if (this.stringLikeTypes.has(idl.forceAsNamedNode(param).name)) { @@ -252,7 +252,7 @@ class CJNativeModuleVisitor extends NativeModuleVisitor { } for(let param of parameters.args) { let ordinal = parameters.args.indexOf(param) - if (this.arrayLikeTypes.has(idl.forceAsNamedNode(param).name)) { + if (idl.isContainerType(param) || this.arrayLikeTypes.has(idl.forceAsNamedNode(param).name)) { printer.print(`releaseArrayRawData(handle_${ordinal})`) } else if (this.stringLikeTypes.has(idl.forceAsNamedNode(param).name)) { printer.print(`LibC.free(${parameters.argsNames[ordinal]})`) diff --git a/src/peer-generation/printers/PeersPrinter.ts b/src/peer-generation/printers/PeersPrinter.ts index a738c229..73da1ed6 100644 --- a/src/peer-generation/printers/PeersPrinter.ts +++ b/src/peer-generation/printers/PeersPrinter.ts @@ -330,19 +330,14 @@ class CJPeerFileVisitor extends PeerFileVisitor { } printFile(): void { - const isIDL = true const printer = createLanguageWriter(this.library.language, getReferenceResolver(this.library)) - this.file.peers.forEach(peer => { - const peerName = componentToPeerClass(peer.componentName) - this.printers.set(new TargetFile(peerName, ''), printer) + const targetBasename = renameDtsToPeer(path.basename(this.file.originalFilename), this.library.language, false) + this.printers.set(new TargetFile(targetBasename), printer) - this.printPackage(printer) + this.printPackage(printer) - if (isIDL) { - const idlPeer = peer as PeerClass - const imports = collectJavaImports(idlPeer.methods.flatMap(method => method.method.signature.args)) - printJavaImports(printer, imports) - } + printer.print("import std.collection.*") + this.file.peersToGenerate.forEach(peer => { this.printPeer(peer, printer) }) } diff --git a/src/peer-generation/printers/SerializerPrinter.ts b/src/peer-generation/printers/SerializerPrinter.ts index fc7e9cd7..a6d33b81 100644 --- a/src/peer-generation/printers/SerializerPrinter.ts +++ b/src/peer-generation/printers/SerializerPrinter.ts @@ -163,17 +163,8 @@ class IdlSerializerPrinter { writer.writeStatement(writer.makeCondition(writer.makeNot(writer.makeDefinedCheck('Serializer.cache')), writer.makeBlock([ writer.makeAssign("Serializer.cache", undefined, writer.makeString(`${writer.language == Language.CJ ? "" : "new "}Serializer()`), false) ]))) - if (writer.language != Language.CJ) { - writer.writeStatement(writer.makeAssign("serializer", undefined, - writer.makeUnwrapOptional(writer.makeString("Serializer.cache")), true, false)) - } else { - writer.print("var serializer = match (Serializer.cache) {") - writer.pushIndent() - writer.print("case Some(serializer) => serializer") - writer.print("case _ => throw Exception(\"Even after creating Serializer cache it is still undefined\")") - writer.popIndent() - writer.print("}") - } + writer.writeStatement(writer.makeAssign("serializer", undefined, + writer.makeUnwrapOptional(writer.makeString("Serializer.cache")), true, false)) writer.writeStatement(writer.makeCondition(writer.makeString("serializer.isHolding"), writer.makeBlock([writer.makeThrowError(("Serializer is already being held. Check if you had released is before"))])), ) diff --git a/tests/cangjie-subset/common.d.ts b/tests/cangjie-subset/common.d.ts index 9703a386..9dfe79fb 100644 --- a/tests/cangjie-subset/common.d.ts +++ b/tests/cangjie-subset/common.d.ts @@ -17,16 +17,85 @@ declare interface BlurOptions { grayscale: [number, number]; } +declare interface StateStyles { + + normal?: any; +} + declare class AttributeModifier {} + +declare interface BackgroundBlurStyleOptions extends BlurStyleOptions { + policy?: BlurStyleActivePolicy; + inactiveColor?: ResourceColor; +} + +declare enum DragPreviewMode { + AUTO = 1, + DISABLE_SCALE = 2, + ENABLE_DEFAULT_SHADOW = 3, + ENABLE_DEFAULT_RADIUS = 4, + } + +declare interface DragPreviewOptions { + mode?: DragPreviewMode | Array; + modifier?: ImageModifier; + numberBadge?: boolean | number; +} + +declare interface DragInteractionOptions { + + isMultiSelectionEnabled?: boolean; + + defaultAnimationBeforeLifting?: boolean; +} + +declare type ImageModifier = import('../api/arkui/ImageModifier').ImageModifier; // hack + +// declare type CustomBuilder = (() => any) | void; declare class CommonMethod { constructor(); + stateStyles(value: StateStyles): T; + + backdropBlur(value: number, options?: BlurOptions): T; + width(value: Length): T; height(value: Length): T; - backdropBlur(value: number, options?: BlurOptions): T; + key(value: string): T; + + restoreId(value: number): T; + + padding(value: Padding | Dimension): T; + + bindSheet(isShow: boolean, /* builder: CustomBuilder, */ options?: SheetOptions): T; + + backgroundBlurStyle(value: BlurStyle, options?: BackgroundBlurStyleOptions): T; + + dragPreviewOptions(value: DragPreviewOptions, options?: DragInteractionOptions): T; + + // linearGradient(value: { + // angle?: number | string; + // direction?: GradientDirection; + // colors: Array<[ResourceColor, number]>; + // repeating?: boolean; + // }): T; + + // border(value: BorderOptions): T; + + // onChildTouchTest(event: (value: Array) => string): T; + + // attributeModifier(modifier: AttributeModifier): T + + // gestureModifier(modifier: GestureModifier): T; + + // onGestureRecognizerJudgeBegin(callback: GestureRecognizerJudgeBeginCallback): T; + + // onClick(event: (event: ClickEvent) => void): T; + + // onClick(event: Callback, distanceThreshold: number): T; } declare interface Rectangle { @@ -44,3 +113,185 @@ declare enum BlurStyle { Thin = 0 } +declare enum BlurStyleActivePolicy { + /** + * The component has the blur effect only when the window is focused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLLOWS_WINDOW_ACTIVE_STATE = 0, + + /** + * The component always has the blur effect, regardless of whether the window is focused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ALWAYS_ACTIVE = 1, + + /** + * The component does not have the blur effect, regardless of whether the window is focused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ALWAYS_INACTIVE = 2, +} + +declare enum SheetSize { + MEDIUM, + LARGE, + FIT_CONTENT = 2, +} + +declare enum SheetType { + BOTTOM = 0, + CENTER = 1, + POPUP = 2, +} + +declare enum SheetMode { + OVERLAY = 0, + EMBEDDED = 1, +} + +declare interface SheetTitleOptions { + title: ResourceStr; + subtitle?: ResourceStr; +} + +declare enum ShadowStyle { + OUTER_DEFAULT_XS, + OUTER_DEFAULT_SM, + OUTER_DEFAULT_MD, + OUTER_DEFAULT_LG, + OUTER_FLOATING_SM, + OUTER_FLOATING_MD, +} + +declare enum ShadowType { + COLOR, + BLUR, +} +declare interface ShadowOptions { + radius: number | Resource; + type?: ShadowType; + color?: Color | string | Resource | ColoringStrategy; + offsetX?: number | Resource; + offsetY?: number | Resource; + fill?: boolean; +} + +declare interface SizeResult { + width: number, + height: number, +} + +declare type EdgeWidths = { + top?: Length; + right?: Length; + bottom?: Length; + left?: Length; +}; + +declare type EdgeWidth = EdgeWidths; + +declare type Padding = { + top?: Length; + right?: Length; + bottom?: Length; + left?: Length; +}; + +declare interface LocalizedEdgeWidths { + top?: LengthMetrics; + end?: LengthMetrics; + bottom?: LengthMetrics; + start?: LengthMetrics; +}; + +declare type EdgeColors = { + top?: ResourceColor; + right?: ResourceColor; + bottom?: ResourceColor; + left?: ResourceColor; +}; + +declare interface LocalizedEdgeColors { + top?: ResourceColor; + end?: ResourceColor; + bottom?: ResourceColor; + start?: ResourceColor; +}; + +declare type BorderRadiuses = { + topLeft?: Length; + topRight?: Length; + bottomLeft?: Length; + bottomRight?: Length; +}; + +declare interface LocalizedBorderRadiuses { + topStart?: LengthMetrics; + topEnd?: LengthMetrics; + bottomStart?: LengthMetrics; + bottomEnd?: LengthMetrics; +}; + +declare enum BorderStyle { + Dotted, + Dashed, + Solid, +} + +declare type EdgeStyles = { + top?: BorderStyle; + right?: BorderStyle; + bottom?: BorderStyle; + left?: BorderStyle; +}; +declare class ScrollableCommonMethod extends CommonMethod { + scrollBarWidth(value: number | string): T; +} + +declare interface BindOptions { + backgroundColor?: ResourceColor; + /*~onAppear?: () => void; + onDisappear?: () => void; + onWillAppear?: () => void; + onWillDisappear?: () => void;*/ +} + +declare type UIContext = import('../api/@ohos.arkui.UIContext').UIContext; // hack +declare interface SheetOptions extends BindOptions { + height?: SheetSize | Length; + dragBar?: boolean; + maskColor?: ResourceColor; + detents?: [(SheetSize | Length), (SheetSize | Length)?, (SheetSize | Length)?]; + blurStyle?: BlurStyle; + showClose?: boolean | Resource; + preferType?: SheetType; + title?: SheetTitleOptions /*| CustomBuilder*/; + //~shouldDismiss?: (sheetDismiss: SheetDismiss) => void; + //~onWillDismiss?: Callback; + //~onWillSpringBackWhenDismiss?: Callback; + enableOutsideInteractive?: boolean; + width?: Dimension; + borderWidth?: Dimension/*~ | EdgeWidths | LocalizedEdgeWidths*/; + borderColor?: ResourceColor/*~ | EdgeColors */| LocalizedEdgeColors; + borderStyle?: BorderStyle/*~ | EdgeStyles*/; + shadow?: ShadowOptions | ShadowStyle; + //~onHeightDidChange?: Callback; + mode?: SheetMode; + //~onDetentsDidChange?: Callback; + //~onWidthDidChange?: Callback; + //~onTypeDidChange?: Callback; + uiContext?: UIContext; +} diff --git a/tests/cangjie-subset/list.d.ts b/tests/cangjie-subset/list.d.ts new file mode 100644 index 00000000..4b499aef --- /dev/null +++ b/tests/cangjie-subset/list.d.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 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 interface VisibleListContentInfo { + index: number + itemIndexInGroup?: number +} + +declare type OnScrollVisibleContentChangeCallback = (start: VisibleListContentInfo, end: VisibleListContentInfo) => void; +declare type Optional = T | undefined + +declare interface ListInterface { + (): ListAttribute +} + +declare class ListAttribute extends ScrollableCommonMethod { + someOptional(param: Optional): ListAttribute + + //~onScrollVisibleContentChange(handler: OnScrollVisibleContentChangeCallback): ListAttribute; +} + +declare const List: ListInterface diff --git a/tests/cangjie-subset/test.d.ts b/tests/cangjie-subset/test.d.ts new file mode 100644 index 00000000..8cb1b1e2 --- /dev/null +++ b/tests/cangjie-subset/test.d.ts @@ -0,0 +1,294 @@ +declare enum EnumDTS { + ELEM_0 = 0, + ELEM_1 = 1, + ELEM_2 = 2, +} + +declare interface BooleanInterfaceDTS { + valBool: boolean +} + +declare interface NumberInterfaceDTS { + valNumber: number +} + +declare interface StringInterfaceDTS { + valString: string +} + +declare interface UnionInterfaceDTS { + + unionProp: number | boolean +} + +declare interface UnionOptionalInterfaceDTS { + + unionProp: string | undefined +} + +declare interface TupleInterfaceDTS { + + tuple: [number, boolean] +} + +declare interface OptionInterfaceDTS { + + tuple: [boolean?, number?] +} + +declare interface ArrayRefNumberInterfaceDTS { + + tuple: Array +} + +declare interface ArrayRefTuplesInterfaceDTS { + + tuple: Array<[boolean, number]> +} + +declare class ClassDTS { + + valBoolean: boolean +} + +// Non materialized class +// declare class ClassWithConstructorDTS { + +// constructor(valNumber: number, valString: string) +// } + +// Non materialized class +// declare class ClassWithConstructorAndFieldsDTS { + +// valNumber: number +// valBoolean: boolean + +// constructor(valNumber: number, valBoolean: boolean) +// } + +// Materialized class +// declare class ClassWithConstructorAndMethodsDTS { + +// constructor(valNumber: number, valString: string) + +// method(valNumber: number, valString: string): void +// } + +// Materialized class +// declare class ClassWithConstructorAndStaticMethodsDTS { + +// constructor(valNumber: number, valString: string) + +// static of(valNumber: number, valString: string): ClassWithConstructorAndStaticMethodsDTS +// } + +// Materialized class +// declare class ClassWithConstructorAndFieldsAndMethodsDTS { + +// valNumber: number +// valBoolean: boolean + +// constructor(valNumber: number, valBoolean: boolean) + +// method(valNumber: number, valString: string): void +// } + + +// Materialized class +// declare class ClassWithConstructorAndWithoutParamsDTS { + +// constructor() + +// static of(): ClassWithConstructorAndWithoutParamsDTS + +// method(): void +// } + +// Materialized class +// declare class ClassWithConstructorAndNonOptionalParamsDTS { + +// constructor(valNumber: number, valString: string) + +// static of(valNumber: number, valString: string): ClassWithConstructorAndNonOptionalParamsDTS + +// method(valBoolean: boolean, valString: string): void +// } + +// Materialized class +// declare class ClassWithConstructorAndSomeOptionalParamsDTS { + +// constructor(valNumber: number, valString?: string) + +// static of(valNumber: number, valString?: string): ClassWithConstructorAndSomeOptionalParamsDTS + +// method(valBoolean: boolean, valString?: string): void +// } + +// Materialized class +// declare class ClassWithConstructorAndAllOptionalParamsDTS { + +// constructor(valNumber?: number, valString?: string) + +// static of(valNumber?: number, valString?: string): ClassWithConstructorAndAllOptionalParamsDTS + +// method(valBoolean?: boolean, valString?: string): void +// } + +declare interface TestInterface { + (): TestAttribute +} +declare const Test: TestInterface + +// basic types: +// - boolean +// - number +// - string, +// - enum +// - function +// +// type | undefined // undefined +// type1 | type2 // union +// type[] // array +// [type1, type2] // tuple +// [type1?, type2?] // tuple optional +// [type1 | type2, (type3 | type 4)?] // tuple union +// Array // ArrayRef type +// Array<[type1, type2]> // ArrayRef tuple +declare class TestAttribute extends CommonMethod { + + // basic types + testBoolean(value: boolean): TestAttribute; + + testNumber(value: number): TestAttribute; + + testString(value: string): TestAttribute; + + testEnum(value: EnumDTS): TestAttribute + + // testFunction(value: (a: number) => boolean): TestAttribute; + + testBasicMix(v1: number, v2: string, v3: number): TestAttribute + + // undefined + + testBooleanUndefined(value: boolean | undefined): TestAttribute; + + testNumberUndefined(value: number | undefined): TestAttribute; + + testStringUndefined(value: string | undefined): TestAttribute; + + testEnumUndefined(value: EnumDTS | undefined): TestAttribute; + + // testFunctionUndefined(value: (a: number) => boolean | undefined): TestAttribute; + + // union + + testUnionNumberEnum(val: number | EnumDTS): TestAttribute + + testUnionBooleanString(val: boolean | string): TestAttribute + + testUnionStringNumber(val: string | number): TestAttribute + + testUnionBooleanStringNumberUndefined(val: boolean | string | number | undefined): TestAttribute + + testUnionWithGenericArray(value: number | Array): TestAttribute; + + testUnionWithArrayType(value: number | string[]): TestAttribute; + + // array + + testBooleanArray(value: boolean[]): TestAttribute; + + testNumberArray(value: number[]): TestAttribute; + + testStringArray(value: string[]): TestAttribute; + + testEnumArray(value: EnumDTS[]): TestAttribute + + // TBD: array of functions + // testFunctionArray(value: ((a: number) => boolean)[]): TestAttribute; + + testArrayMix(v1: number[], v2: string[], v3: EnumDTS[]): TestAttribute; + + // TBD: array of functions + //testArrayMix(v1: number[], v2: string[], v3: EnumDTS[], v4: ((a: number) => string)[]): TestAttribute; + + // tuple + + testTupleBooleanNumber(value: [boolean, number]): TestAttribute; + + testTupleNumberStringEnum(value: [number, string, EnumDTS]): TestAttribute; + + // tuple optional + + testTupleOptional(value: [number, string, boolean, EnumDTS]): TestAttribute; + + // tuple union + + testTupleUnion(value: [(number | string), (boolean | EnumDTS), (string | EnumDTS | boolean)]): TestAttribute; + + // Array + + testArrayRefBoolean(value: Array): TestAttribute + + testArrayRefNumber(value: Array): TestAttribute + + // testArrayTuple(value: Array<[number, boolean]>): TestAttribute + + // interface + + testBooleanInterface(value: BooleanInterfaceDTS): TestAttribute + + testNumberInterface(value: NumberInterfaceDTS): TestAttribute + + testStringInterface(value: StringInterfaceDTS): TestAttribute + + testUnionInterface(value: UnionInterfaceDTS): TestAttribute + + testUnionOptional(value: UnionOptionalInterfaceDTS): TestAttribute + + testTupleInterface(value: TupleInterfaceDTS): TestAttribute + + testOptionInterface(value: OptionInterfaceDTS): TestAttribute + + testArrayRefNumberInterface(value: ArrayRefNumberInterfaceDTS): TestAttribute + + // testArrayRefTupleInterface(value: ArrayRefTuplesInterfaceDTS) + + + // Boolean Interface + + testBooleanInterfaceOption(value?: BooleanInterfaceDTS): TestAttribute + // leads to es2panda segmentation fault + // testBooleanInterfaceTuple(value: [BooleanInterfaceDTS]): TestAttribute + + testBooleanInterfaceArray(value: BooleanInterfaceDTS[]): TestAttribute + + testBooleanInterfaceArrayRef(value: Array): TestAttribute + + testInterfaceMixed(v1: UnionInterfaceDTS, v2: number, v3: TupleInterfaceDTS): TestAttribute + + // Class + + // testClass(value: ClassDTS): TestAttribute + + // testClassWithConstructor(value: ClassWithConstructorDTS): TestAttribute + + // testClassWithConstructorAndFields(value: ClassWithConstructorAndFieldsDTS): TestAttribute + + // Materialized class + + // testClassWithConstructorAndMethods(value: ClassWithConstructorAndMethodsDTS): TestAttribute + + // testClassWithConstructorAndStaticMethods(value: ClassWithConstructorAndStaticMethodsDTS): TestAttribute + + // testClassWithConstructorAndFieldsAndMethods(value: ClassWithConstructorAndFieldsAndMethodsDTS): TestAttribute + + // testClassWithConstructorAndNonOptionalParams(value: ClassWithConstructorAndNonOptionalParamsDTS): TestAttribute + + // testClassWithConstructorAndSomeOptionalParams(value: ClassWithConstructorAndSomeOptionalParamsDTS): TestAttribute + + // testClassWithConstructorAndAllOptionalParams(value: ClassWithConstructorAndAllOptionalParamsDTS): TestAttribute + + // testClassWithConstructorAndWithoutParams(value: ClassWithConstructorAndWithoutParamsDTS): TestAttribute +} \ No newline at end of file -- Gitee From e1d64ed98c11aa2ce7b84499298112b40c9685aa Mon Sep 17 00:00:00 2001 From: tsvetkovaelena Date: Mon, 18 Nov 2024 11:20:09 +0000 Subject: [PATCH 23/53] !935 Extend arkts-subset --- tests/arkts-subset/ets/common.d.ts | 29 +++++++++++++++++++++ tests/arkts-subset/ets/enums.d.ts | 42 ++++++++++++++++++++++++++++++ tests/arkts-subset/ets/flex.d.ts | 40 ++++++++++++++++++++++++++++ tests/arkts-subset/ets/row.d.ts | 30 +++++++++++++++++++++ tests/arkts-subset/ets/units.d.ts | 6 +++++ 5 files changed, 147 insertions(+) create mode 100644 tests/arkts-subset/ets/flex.d.ts create mode 100644 tests/arkts-subset/ets/row.d.ts diff --git a/tests/arkts-subset/ets/common.d.ts b/tests/arkts-subset/ets/common.d.ts index 4176b0c9..ea74f92b 100644 --- a/tests/arkts-subset/ets/common.d.ts +++ b/tests/arkts-subset/ets/common.d.ts @@ -424,6 +424,19 @@ declare class CommonMethod { onClick(event: (event: ClickEvent) => void): T; onClick(event: Callback, distanceThreshold: number): T; + + /////////////// recently added /////////////// + + backgroundColor(value: ResourceColor): T; + + margin(value: Margin | Length | LocalizedMargin): T; + + clip(value: boolean): T; + + zIndex(value: number): T; + + aspectRatio(value: number): T; + } declare interface Rectangle { @@ -516,3 +529,19 @@ declare module 'commonAttribute'{ export { CommonAttribute }; } } + +/////////////// recently added /////////////// + +declare interface LightSource { + positionX: Dimension; + positionY: Dimension; + positionZ: Dimension; + intensity: number; + color?: ResourceColor; + } + +declare interface PointLightStyle { + lightSource?: LightSource; + illuminated?: IlluminatedType; + bloom?: number; + } diff --git a/tests/arkts-subset/ets/enums.d.ts b/tests/arkts-subset/ets/enums.d.ts index d972f2e5..a861362c 100644 --- a/tests/arkts-subset/ets/enums.d.ts +++ b/tests/arkts-subset/ets/enums.d.ts @@ -69,4 +69,46 @@ declare enum VerticalAlign { Top, Center, Bottom, +} + +/////////////// recently added /////////////// + +declare enum FlexDirection { + Row, + Column, + RowReverse, + ColumnReverse, +} + +declare enum FlexWrap { + NoWrap, + Wrap, + WrapReverse, +} + +declare enum FlexAlign { + Start, + Center, + End, + SpaceBetween, + SpaceAround, + SpaceEvenly, +} + +declare enum ItemAlign { + Auto, + Start, + Center, + End, + Baseline, + Stretch, +} + +declare enum IlluminatedType { + NONE = 0, + BORDER = 1, + CONTENT = 2, + BORDER_CONTENT = 3, + BLOOM_BORDER = 4, + BLOOM_BORDER_CONTENT = 5 } \ No newline at end of file diff --git a/tests/arkts-subset/ets/flex.d.ts b/tests/arkts-subset/ets/flex.d.ts new file mode 100644 index 00000000..66818f8d --- /dev/null +++ b/tests/arkts-subset/ets/flex.d.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 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 interface FlexOptions { + direction?: FlexDirection; + wrap?: FlexWrap; + justifyContent?: FlexAlign; + alignItems?: ItemAlign; + alignContent?: FlexAlign; + space?: FlexSpaceOptions; +} + +declare interface FlexSpaceOptions { + main?: LengthMetrics; + cross?: LengthMetrics; +} + +interface FlexInterface { + (value?: FlexOptions): FlexAttribute; +} + +declare class FlexAttribute extends CommonMethod { + pointLight(value: PointLightStyle): FlexAttribute; +} + +declare const Flex: FlexInterface; + +declare const FlexInstance: FlexAttribute; diff --git a/tests/arkts-subset/ets/row.d.ts b/tests/arkts-subset/ets/row.d.ts new file mode 100644 index 00000000..0be57945 --- /dev/null +++ b/tests/arkts-subset/ets/row.d.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 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 interface RowOptions { + space?: string | number; +} +interface RowInterface { + (options?: RowOptions): RowAttribute; +} + +declare class RowAttribute extends CommonMethod { + alignItems(value: VerticalAlign): RowAttribute; + justifyContent(value: FlexAlign): RowAttribute; + pointLight(value: PointLightStyle): RowAttribute; + reverse(isReversed: Optional): RowAttribute; +} +declare const Row: RowInterface; +declare const RowInstance: RowAttribute; diff --git a/tests/arkts-subset/ets/units.d.ts b/tests/arkts-subset/ets/units.d.ts index 74b8e994..2ad61005 100644 --- a/tests/arkts-subset/ets/units.d.ts +++ b/tests/arkts-subset/ets/units.d.ts @@ -73,3 +73,9 @@ declare interface Font { family?: string | Resource; style?: FontStyle; } + +/////////////// recently added /////////////// + +declare type Margin = Padding; + +declare type LocalizedMargin = LocalizedPadding; \ No newline at end of file -- Gitee From 85d0a9d89eba279006466221ee3fe3bcc3e6d1b4 Mon Sep 17 00:00:00 2001 From: scherbatiyalexander Date: Mon, 18 Nov 2024 12:11:40 +0000 Subject: [PATCH 24/53] !964 Doc for materialized classes unification for the TypeScript and Java languages * Update description for ctor() method * Update comments * Fix typos * Add doc with materialized classes serialization description --- doc/SERIALIZATION.md | 268 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 doc/SERIALIZATION.md diff --git a/doc/SERIALIZATION.md b/doc/SERIALIZATION.md new file mode 100644 index 00000000..0e8984a7 --- /dev/null +++ b/doc/SERIALIZATION.md @@ -0,0 +1,268 @@ +# Types Serialization + +## Materialized classes/interfaces + +Interfaces or classes which have methods needs to have a corresponding realization on the native level. +The special implementation for such class or interface is generated on the managed level which holds a pointer to the native structure. +An implementation for these classes/interfaces is named as materialized classes/interfaces +to distinguish them from builders or interfaces implemented by a user. + +Additional methods need to be implemented by Materialized classes/interfaces: + +- `private getFinalizer(): pointer` - Get the pointer to the native structure destroy method. +- `public getPeer(): Finalizable` - Get a peer which holds the pointer to the corresponding native structure. +It is used by the Serializer in the `write(...)` method. +- `public static make(ptr: poiner)` - Create a materialized class/interface from the given pointer. +Materialized classes/interfaces can be used as a method return type and it needs to have a way to construct them from the native pointer. +- `private ctor(): pointer` - Create a corresponding structure on the native level and get a pointer to it. + It seems that it should be added only to the materialized classes. Materialized interfaces are created only + they are returned from other methods. + +Implementation for methods from the original classes/interfaces are just proxy to the native methods. + +### Materialized interfaces + +Example: +``` +declare interface TextBaseController { + + setSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; + closeSelectionMenu(): void; + getLayoutManager(): LayoutManager; +} +``` + +Name for a materialized interface can be just an original name with `Impl` suffix +to separate interfaces and their implementations in Java. +The materialized interface implements the original interface and its methods. + +One additional private empty constructor needs to be added. + +``` +export class TextBaseControllerImpl implements TextBaseController { + peer?: Finalizable + getPeer(): Finalizable | undefined { + return this.peer + } + static getFinalizer(): KPointer { + return nativeModule()._TextBaseController_getFinalizer() + } + static make(ptr: pointer): TextBaseControllerImpl { + const objTextBaseController: TextBaseControllerImpl = new TextBaseControllerIml() + objTextBaseController.peer = new Finalizable(ptr, TextBaseControllerImpl.getFinalizer()) + return objTextBaseController + } + private constructor() { + // just an empty constructor + // there is no user code which creates this object by the constructor + // the new object is alway created by the make(ptr) call + } + ... +} +``` + +### Materializied classes + +For example : +``` +declare class CanvasRenderingContext2D extends CanvasRenderer { + + readonly height: number; + readonly width: number; + + constructor(settings?: RenderingContextSettings); + constructor(settings?: RenderingContextSettings, unit?: LengthMetricsUnit); + + toDataURL(type?: string, quality?: any): string; + ... +} +``` + +The main problem with materialized classes that they need to be implemented as is +with the given constructors and extends/implements declarations. +Additional public methods added to the materialized class are leaked to the public API +and it is under the question how to handle them properly. + +The name for the materialized class needs to be exact name of the original class. +Fields for a materialized class are generated as getters and setters. + +The materialized class needs to have a constructor which takes a pointer to the native side. +It is used by the static `make(ptr: pointer)` method to create a materialized object. +It can be implemented in Java which allows to have multiple constructors +but for TypeScript it means that the first constructor parameter type +needs to be union of the original parameter type with the pointer. + +The current approach is to add a constructor with all optional parameters +in the typescript. +The `make(ptr: pointer)` method then uses the constructor with no parameters +to create the materialized object and assigns the given pointer to the object. +It has a lack that if the original class allows a constructor with all optional parameters +the native structure will be created twice, by the constructor and by the method that calls `make(pointer)`. +It is under the question which way it is better to construct a materialized object which have a constructor +with all optional params. + +Original `d.ts` declaration: +``` +declare class CanvasPath { + moveTo(x: number, y: number): void; +} + +declare class CanvasRenderer extends CanvasPath { + ... +} + +declare class CanvasRenderingContext2D extends CanvasRenderer { + + readonly height: number; + readonly width: number; + + constructor(settings?: RenderingContextSettings); + constructor(settings?: RenderingContextSettings, unit?: LengthMetricsUnit); + + toDataURL(type?: string, quality?: any): string; + ... +} +``` + +Implementation: +``` +export class CanvasPath { + + peer?: Finalizable + + getPeer(): Finalizable | undefined { + return this.peer + } + + static ctor(): KPointer { + return nativeModule()._CanvasPath_ctor() + } + + static make(ptr: pointer): CanvasPath { + const objCanvasPath: CanvasPath = new CanvasPath() + objCanvasPath.peer = new Finalizable(ptr, CanvasPath.getFinalizer()) + return objCanvasPath + } + + constructor() { + ... + } + static getFinalizer(): KPointer { + return nativeModule()._CanvasPath_getFinalizer() + } +} + +export class CanvasRenderer extends CanvasPath { + ... +} + +export class CanvasRenderingContext2D extends CanvasRenderer { + get height(): number { + ... + } + get width(): number { + ... + } + static getFinalizer(): pointer { + return nativeModule()._CanvasRenderingContext2D_getFinalizer() + } + static ctor(settings?: RenderingContextSettings): KPointer { + // construct the native struct and return the pointer + } + constructor(settings?: RenderingContextSettings) { + const ctorPtr: pointer = CanvasRenderingContext2D.ctor(settings) + this.peer = new Finalizable(ctorPtr, CanvasRenderingContext2D.getFinalizer()) + } + static make(ptr: poiner): CanvasRenderingContext2D { + const objCanvasRenderingContext2D: CanvasRenderingContext2D = new CanvasRenderingContext2D() + // note that the pointer to the native stucture is generated twice + // first from the method which calls the make(ptr) method + // second in the CanvasRenderingContext2D constructor + objCanvasRenderingContext2D.peer = new Finalizable(ptr, CanvasRenderingContext2D.getFinalizer()) + return objCanvasRenderingContext2D + } + ... +} +``` + +It seems that it is possible to implement materialized classes and interfaces in Java +in the same way as in the Typescript with the following differencies: + +- a constructor with pointer parameter is added +- getters and setters are generated in java way with get/set prefixes + +``` +class CanvasPath { + + protected Finalizable peer; + + public Finalizable getPeer() { + return this.peer + } + + public static long ctor() { + return NativeModule._CanvasPath_ctor(); + } + ... +} + +class CanvasRenderer extends CanvasPath { + ... +} + +class CanvasRenderingContext2D extends CanvasRenderer { + + float getGeight() { + ... + } + + float getWidth() { + ... + } + + static long ctor(RenderingContextSettings settings) { + // create a native struct and return the pointer to it + } + + CanvasRenderingContext2D(long pointer) { + super(pointer); + } + + CanvasRenderingContext2D(RenderingContextSettings settings) { + this(ctor(settings)); + } + + static long getFinalizer() { + return NativeModule._CanvasRenderingContext2D_getFinalizer(); + } + + static CanvasRenderingContext2D make(ptr: long) { + return new CanvasRenderingContext2D(long); + } +``` + +## User implemented interfaces + +There are interfaces with methods which are implemented by a user. + +For example : +``` +interface ICurve { + interpolate(fraction: number): number; +} + +declare class SwiperAttribute extends CommonMethod { + ... + curve(value: Curve | string | ICurve): SwiperAttribute; +} +``` +Usage: + +``` + swiper.curve({ interpolate: (fraction) => 0.8 * fraction }) +``` + +Such interfaces can't be represented as materialized classes and are treated as a callbacks +to be processed in the corresponding way. + +It is under a question how to distinguish user implemented interfaces from the materialized classes. -- Gitee From f79fc9cee7824857135c502160fb82bfdc697d29 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Mon, 18 Nov 2024 13:48:55 +0000 Subject: [PATCH 25/53] !976 Loadable user apps --- external | 2 +- .../arkui/src/generated/Application.sts | 201 ------------------ .../src/org/koalaui/arkoala/Application.java | 31 ++- .../src/org/koalaui/arkoala/UserView.java | 26 +++ .../org/koalaui/arkoala/ViewLoaderApp.java | 31 +++ peer_lib/sig/arkoala/loader/loader.ts | 11 +- predefined/sys/node.idl | 99 ++++----- .../printers/NativeModulePrinter.ts | 2 +- templates/bridge_custom_prologue.cc | 74 +++++++ 9 files changed, 214 insertions(+), 263 deletions(-) delete mode 100644 peer_lib/sig/arkoala-arkts/arkui/src/generated/Application.sts create mode 100644 peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/UserView.java create mode 100644 peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/ViewLoaderApp.java diff --git a/external b/external index f2b27daa..e274b827 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit f2b27daaa9e0848e3135a3d4598b4eddee5a6549 +Subproject commit e274b827bdff63bac1e1674bce0f1864d0d33b8d diff --git a/peer_lib/sig/arkoala-arkts/arkui/src/generated/Application.sts b/peer_lib/sig/arkoala-arkts/arkui/src/generated/Application.sts deleted file mode 100644 index 0bf0001f..00000000 --- a/peer_lib/sig/arkoala-arkts/arkui/src/generated/Application.sts +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2024 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 { ComputableState, IncrementalNode, GlobalStateManager, StateManager, StateContext, MutableState, State, contextLocal, contextLocalScope, createAnimationTimer, memoRoot } from "@koalaui/runtime" -import { nativeModule } from "#components" -import { ArkoalaHost, ArkoalaControl, WaitFramesEvent, UIElement } from "./Declarations" -import { ArkoalaControlImpl } from "./ArkoalaControl" -import { SerializerBase } from "@arkoala/arkui/peers/SerializerBase" -import { wrapCallback } from "./CallbackRegistry" -import { PeerNode } from "./PeerNode" -import { ArkUINodeType } from "./peers/ArkUINodeType" -import { KPointer, pointer } from "@koalaui/interop" -import { checkEvents } from "./Events" - -const CURRENT_CONTROL = "ohos.arkoala.control" -export interface ApplicationEmulatedEvent { - nodeId: int - x: number - y: number - status: int - text: string -} - -class PartialUpdateRecord { - public update: () => void - public context: Object - public callback: (before: boolean) => void - - constructor(update: () => void, context: Object, callback: (before: boolean) => void) { - this.callback = callback - this.context = context - this.update = update - } -} - -let partialUpdates = new Array() -let _currentPartialUpdateContext: Object | undefined = undefined - - -/** - * Provide partial update lambda and context. - * - * @param update - function that performs state update - * @param context - context available to UI code when state update effect happens - */ -export function addPartialUpdate(update: () => void, context: T, callback: (before: boolean) => void): void { - partialUpdates.push(new PartialUpdateRecord(update, context as Object, callback)) -} - -/** - * Current partial update context or undefined. - * - * @returns current partial update context - */ -export function currentPartialUpdateContext(): T | undefined { - return _currentPartialUpdateContext as (T | undefined) -} - -function createMemoRoot(manager: StateManager): ComputableState { - const peer = new PeerNode(ArkUINodeType.Root, 0, "Root") - const node = manager.updatableNode(peer, (context: StateContext) => { - const frozen = manager.frozen - manager.frozen = true - // call memoEntry - manager.frozen = frozen - }) - node.value - return node -} - -function updateStates(manager: StateManager, root: State) { - // Ensure all current state updates took effect. - manager.updateSnapshot() - root.value - if (partialUpdates.length > 0) { - // If there are pending partial updates - we apply them one by one and provide update context. - for (let update of partialUpdates) { - // Set the context available via currentPartialUpdateContext() to @memo code. - _currentPartialUpdateContext = update.context - // Update states. - update.update() - // Propagate changes. - manager.updateSnapshot() - // Notify subscriber. - update.callback(true) - // Compute new tree state - try { - root.value - } catch (error) { - console.log('has error in partialUpdates') - } - // Notify subscriber. - update.callback(false) - // Clear context. - _currentPartialUpdateContext = undefined - } - // Clear partial updates list. - partialUpdates.splice(0, partialUpdates.length) - } -} - -function measureLayoutAndDraw(peerNode: PeerNode) { - nativeModule()._MeasureLayoutAndDraw(peerNode.peer.ptr) -} - -function dumpTree(node: IncrementalNode, indent: int = 0) { - const indentToString = (indent: number) => { - let str = "" - for (let i = 0; i <= indent; i++) str += " " - return str - } - - if (indent == 0) console.log("> Dump tree:") - - let child = node.firstChild - console.log("> " + indentToString(indent++) + "| " + node) - - while (child) { - dumpTree(child!, indent + 1) - child = child!.nextSibling - } -} - -let crashDumped = false -function drawCurrentCrash(crash: Object) { - let msg = crash.toString() + "\n" - if (Object.hasOwn(crash, "stack")) msg += (crash as Error).stack - if (!crashDumped) { - console.log(msg) - crashDumped = true - } - nativeModule()._ShowCrash(msg ?? "unknown error message") -} - -export class Application { - private manager: StateManager | undefined = undefined - private root: ComputableState | undefined = undefined - private currentCrash: Object | undefined = undefined - private enableDumpTree = false - - constructor() { - } - - private start(): Application { - this.manager = GlobalStateManager.instance - this.root = createMemoRoot(this.manager!) - return this - } - - private checkEvents(what: int) { - checkEvents() - } - - private updateState() { - console.log("ARKTS: updateState") - updateStates(this.manager!, this.root!) - // Here we request to draw a frame and call custom components JS callbacks. - measureLayoutAndDraw(this.root!.value as PeerNode) - } - - private render() { - console.log("ARKTS: render2") - // Call callbacks. - this.manager?.callCallbacks() - } - - enter(arg0: int, arg1: int) { - if (this.currentCrash) { - drawCurrentCrash(this.currentCrash!) - } else { - try { - this.loopIteration(arg0, arg1) - if (this.enableDumpTree) dumpTree(this.root!.value) - } catch (error) { - this.currentCrash = error as Object - } - } - } - - loopIteration(arg0: int, arg1: int) { - this.checkEvents(arg0) - this.updateState() - this.render() - } - - static startApplication(): Application { - return new Application().start() - } -} diff --git a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java index 8e85be6e..16c6bf80 100644 --- a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java +++ b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java @@ -15,12 +15,22 @@ package org.koalaui.arkoala; +import java.util.function.Consumer; + public class Application { - Application() {} + UserView view; + Consumer builderFunction; + PeerNode rootNode; + + Application(UserView view) { + this.view = view; + builderFunction = view.getBuilder(); + rootNode = ArkColumnPeer.create(ArkUINodeType.Column, null, 0); + } public static void main(String[] args) { - var app = Application.createApplication(); - var root = app.start("init", ""); + var app = Application.createApplication("init", ""); + var root = app.start(); try { for (int i = 0; i < 10; i++) { app.loopIteration(i, 0); @@ -31,9 +41,11 @@ public class Application { } } - public static Application createApplication() { - NativeModule._NativeLog("NativeModule.createApplication"); - return new Application(); + public static Application createApplication(String app, String params) { + NativeModule._NativeLog("NativeModule.createApplication " + app + " , params=" + params); + UserView view = (UserView)NativeModule._LoadUserView("org.koalaui.arkoala.View" + app, params); + if (view == null) throw new Error("Cannot load user view"); + return new Application(view); } public boolean enter(int arg0, int arg1) { @@ -44,7 +56,7 @@ public class Application { checkEvents(arg0); updateState(); render(); - return true; + return false; } void checkEvents(int what) { @@ -58,10 +70,11 @@ public class Application { void render() { System.out.println("JAVA: render"); + builderFunction.accept(rootNode); } - public long start(String app, String params) { - System.out.println("JAVA: start " + app + " , params=" + params); + public long start() { + System.out.println("JAVA: start"); return 42; } } diff --git a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/UserView.java b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/UserView.java new file mode 100644 index 00000000..25eb8059 --- /dev/null +++ b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/UserView.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 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. + */ + +package org.koalaui.arkoala; + +import java.util.function.Consumer; + +public class UserView { + UserView() {} + + Consumer getBuilder() { + throw new Error("User must override this method"); + } +} \ No newline at end of file diff --git a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/ViewLoaderApp.java b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/ViewLoaderApp.java new file mode 100644 index 00000000..c4f6950d --- /dev/null +++ b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/ViewLoaderApp.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 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. + */ +package org.koalaui.arkoala; + +import java.util.function.Consumer; + +public class ViewLoaderApp extends UserView { + ViewLoaderApp(String params) { + System.out.println("User ViewLoaderApp() params=" + params); + } + + static void view(PeerNode root) { + System.out.println("User view: " + root); + } + + Consumer getBuilder() { + return ViewLoaderApp::view; + } +} \ No newline at end of file diff --git a/peer_lib/sig/arkoala/loader/loader.ts b/peer_lib/sig/arkoala/loader/loader.ts index e5539097..104e0466 100644 --- a/peer_lib/sig/arkoala/loader/loader.ts +++ b/peer_lib/sig/arkoala/loader/loader.ts @@ -67,10 +67,17 @@ function waitVSync(pipelineContext: KPointer): Promise { }) } +function delay(ms: int32): Promise { + return new Promise(resolve => setTimeout(resolve, ms)) +} + +const useDelayAsVsync = true + export async function runEventLoop() { const pipelineContext = getNativePipelineContext() + let vsync = useDelayAsVsync ? () => delay(500) : () => waitVSync(pipelineContext) while (!nativeModule()._RunApplication(0, 0)) { - await waitVSync(pipelineContext!) + await vsync() } } @@ -165,7 +172,7 @@ export function checkLoader(variant: string): int32 { } case 'panda': { vm = 2 - classPath = __dirname + "/../external/arkoala-arkts/framework/build/abc/trivial" + classPath = __dirname + "/../external/arkoala-arkts/build" break } case 'es2panda': { diff --git a/predefined/sys/node.idl b/predefined/sys/node.idl index 0c856596..f603ed0f 100644 --- a/predefined/sys/node.idl +++ b/predefined/sys/node.idl @@ -1,49 +1,50 @@ -package "org.openharmony.idlize.predefined"; - -interface Node { - pointer CreateNode(i32 node_t, i32 arg0, i32 arg1); - pointer GetNodeByViewStack(); - void DisposeNode(pointer ptr0); - void DumpTreeNode(pointer ptr0); - i32 AddChild(pointer ptr1, pointer ptr2); - void RemoveChild(pointer ptr0, pointer ptr2); - i32 InsertChildAfter(pointer ptr0, pointer ptr1, pointer ptr2); - i32 InsertChildBefore(pointer ptr0, pointer ptr1, pointer ptr2); - i32 InsertChildAt(pointer ptr0, pointer ptr1, i32 arg); - void ApplyModifierFinish(pointer ptr0); - void MarkDirty(pointer ptr0, u32 arg); - boolean IsBuilderNode(pointer ptr0); - f32 ConvertLengthMetricsUnit(f32 arg0, i32 arg1, i32 arg2); - void SetCustomCallback(pointer ptr0, i32 arg); - void MeasureLayoutAndDraw(pointer ptr0); - i32 MeasureNode(pointer ptr0, sequence arr); - i32 LayoutNode(pointer ptr0, sequence arr); - i32 DrawNode(pointer ptr0, sequence arr); - void SetMeasureWidth(pointer ptr0, i32 arg); - i32 GetMeasureWidth(pointer ptr0); - void SetMeasureHeight(pointer ptr0, i32 arg); - i32 GetMeasureHeight(pointer ptr0); - void SetX(pointer ptr0, i32 arg); - i32 GetX(pointer ptr0); - void SetY(pointer ptr0, i32 arg); - i32 GetY(pointer ptr0); - void SetAlignment(pointer ptr0, i32 arg); - i32 GetAlignment(pointer ptr0); - i32 IndexerChecker(pointer ptr0); - void SetRangeUpdater(pointer ptr0, i32 arg); - void SetLazyItemIndexer(pointer ptr0, i32 arg); - pointer GetPipelineContext(pointer ptr0); - void SetVsyncCallback(pointer ptr0, i32 arg); - void UnblockVsyncWait(pointer ptr0); - void SetChildTotalCount(pointer ptr0, i32 arg); - void ShowCrash(String message); - i32 CheckArkoalaGeneratedEvents(sequence result, i32 size); - void EmulateClickEvent(i32 nodeId, f32 x, f32 y); - void EmulateTextInputEvent(i32 nodeId, String text); - void CallCallback(i32 callbackKind, sequence args, i32 argsSize); - void CallCallbackResourceHolder(pointer holder, i32 resourceId); - void CallCallbackResourceReleaser(pointer releaser, i32 resourceId); - i32 CheckArkoalaCallbackEvent(sequence buffer, i32 bufferLength); - void HoldArkoalaResource(i32 resourceId); - void ReleaseArkoalaResource(i32 resourceId); -}; +package "org.openharmony.idlize.predefined"; + +interface Node { + pointer CreateNode(i32 node_t, i32 arg0, i32 arg1); + pointer GetNodeByViewStack(); + void DisposeNode(pointer ptr0); + void DumpTreeNode(pointer ptr0); + i32 AddChild(pointer ptr1, pointer ptr2); + void RemoveChild(pointer ptr0, pointer ptr2); + i32 InsertChildAfter(pointer ptr0, pointer ptr1, pointer ptr2); + i32 InsertChildBefore(pointer ptr0, pointer ptr1, pointer ptr2); + i32 InsertChildAt(pointer ptr0, pointer ptr1, i32 arg); + void ApplyModifierFinish(pointer ptr0); + void MarkDirty(pointer ptr0, u32 arg); + boolean IsBuilderNode(pointer ptr0); + f32 ConvertLengthMetricsUnit(f32 arg0, i32 arg1, i32 arg2); + void SetCustomCallback(pointer ptr0, i32 arg); + void MeasureLayoutAndDraw(pointer ptr0); + i32 MeasureNode(pointer ptr0, sequence arr); + i32 LayoutNode(pointer ptr0, sequence arr); + i32 DrawNode(pointer ptr0, sequence arr); + void SetMeasureWidth(pointer ptr0, i32 arg); + i32 GetMeasureWidth(pointer ptr0); + void SetMeasureHeight(pointer ptr0, i32 arg); + i32 GetMeasureHeight(pointer ptr0); + void SetX(pointer ptr0, i32 arg); + i32 GetX(pointer ptr0); + void SetY(pointer ptr0, i32 arg); + i32 GetY(pointer ptr0); + void SetAlignment(pointer ptr0, i32 arg); + i32 GetAlignment(pointer ptr0); + i32 IndexerChecker(pointer ptr0); + void SetRangeUpdater(pointer ptr0, i32 arg); + void SetLazyItemIndexer(pointer ptr0, i32 arg); + pointer GetPipelineContext(pointer ptr0); + void SetVsyncCallback(pointer ptr0, i32 arg); + void UnblockVsyncWait(pointer ptr0); + void SetChildTotalCount(pointer ptr0, i32 arg); + void ShowCrash(String message); + i32 CheckArkoalaGeneratedEvents(sequence result, i32 size); + void EmulateClickEvent(i32 nodeId, f32 x, f32 y); + void EmulateTextInputEvent(i32 nodeId, String text); + void CallCallback(i32 callbackKind, sequence args, i32 argsSize); + void CallCallbackResourceHolder(pointer holder, i32 resourceId); + void CallCallbackResourceReleaser(pointer releaser, i32 resourceId); + i32 CheckArkoalaCallbackEvent(sequence buffer, i32 bufferLength); + void HoldArkoalaResource(i32 resourceId); + void ReleaseArkoalaResource(i32 resourceId); + Object LoadUserView(String userClass, String params); +}; diff --git a/src/peer-generation/printers/NativeModulePrinter.ts b/src/peer-generation/printers/NativeModulePrinter.ts index bd842c84..b839cda2 100644 --- a/src/peer-generation/printers/NativeModulePrinter.ts +++ b/src/peer-generation/printers/NativeModulePrinter.ts @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - import { nativeModuleDeclaration, nativeModuleEmptyDeclaration } from "../FileGenerators"; import { FunctionCallExpression, LanguageWriter, Method, MethodModifier, NamedMethodSignature, StringExpression, createLanguageWriter } from "../LanguageWriters"; import { PeerClassBase } from "../PeerClass"; @@ -438,6 +437,7 @@ function getReturnValue(type: idl.IDLType): string { case idl.IDLPointerType: return "0" case idl.IDLStringType: return `"some string"` case idl.IDLAnyType: return `""` + case idl.IDLObjectType: return "new Object()" } throw new Error(`Unknown return type: ${idl.IDLKind[type.kind]} ${idl.forceAsNamedNode(type).name}`) diff --git a/templates/bridge_custom_prologue.cc b/templates/bridge_custom_prologue.cc index eed90a2d..42905a78 100644 --- a/templates/bridge_custom_prologue.cc +++ b/templates/bridge_custom_prologue.cc @@ -448,3 +448,77 @@ void impl_SetChildTotalCount(Ark_NativePointer nodePtr, Ark_Int32 totalCount) GetArkUIExtendedNodeAPI()->setChildTotalCount(nodePtrCast, totalCount); } KOALA_INTEROP_V2(SetChildTotalCount, Ark_NativePointer, Ark_Int32) + +KVMObjectHandle impl_LoadUserView(KVMContext vm, const KStringPtr& viewClass, const KStringPtr& viewParams) { +#ifdef KOALA_USE_JAVA_VM + JNIEnv* env = reinterpret_cast(vm); + std:: string className(viewClass.c_str()); + std::replace(className.begin(), className.end(), '.', '/'); + jclass viewClassClass = env->FindClass(className.c_str()); + if (!viewClassClass) { + fprintf(stderr, "Cannot find user class %s\n", viewClass.c_str()); + if (env->ExceptionCheck()) { + env->ExceptionDescribe(); + env->ExceptionClear(); + } + return nullptr; + } + jmethodID viewClassCtor = env->GetMethodID(viewClassClass, "", "(Ljava/lang/String;)V"); + if (!viewClassCtor) { + fprintf(stderr, "Cannot find user class ctor\n"); + if (env->ExceptionCheck()) { + env->ExceptionDescribe(); + env->ExceptionClear(); + } + return nullptr; + } + jobject result = env->NewObject(viewClassClass, viewClassCtor, env->NewStringUTF(viewParams.c_str())); + if (!result) { + fprintf(stderr, "Cannot instantiate user class\n"); + if (env->ExceptionCheck()) { + env->ExceptionDescribe(); + env->ExceptionClear(); + } + return nullptr; + } + return (KVMObjectHandle)result; +#elif KOALA_USE_PANDA_VM + EtsEnv* env = reinterpret_cast(vm); + std:: string className(viewClass.c_str()); + // TODO: hack, fix it! + if (className == "ViewArkTSLoaderApp") className = "Page.App"; + std::replace(className.begin(), className.end(), '.', '/'); + ets_class viewClassClass = env->FindClass(className.c_str()); + if (!viewClassClass) { + fprintf(stderr, "Cannot find user class %s\n", viewClass.c_str()); + if (env->ErrorCheck()) { + env->ErrorDescribe(); + env->ErrorClear(); + } + return nullptr; + } + ets_method viewClassCtor = env->Getp_method(viewClassClass, "", "Lstd/core/String;:V"); + if (!viewClassCtor) { + fprintf(stderr, "Cannot find user class ctor\n"); + if (env->ErrorCheck()) { + env->ErrorDescribe(); + env->ErrorClear(); + } + return nullptr; + } + ets_object result = env->NewObject(viewClassClass, viewClassCtor, env->NewStringUTF(viewParams.c_str())); + if (!result) { + fprintf(stderr, "Cannot instantiate user class\n"); + if (env->ErrorCheck()) { + env->ErrorDescribe(); + env->ErrorClear(); + } + return nullptr; + } + return (KVMObjectHandle)result; +#else + fprintf(stderr, "LoadUserView() is not implemented yet\n"); + return nullptr; +#endif +} +KOALA_INTEROP_CTX_2(LoadUserView, KVMObjectHandle, KStringPtr, KStringPtr) -- Gitee From f059d35f89647b1719ecd44ac8100fa153fbbffc Mon Sep 17 00:00:00 2001 From: tsvetkovaelena Date: Mon, 18 Nov 2024 13:54:00 +0000 Subject: [PATCH 26/53] !983 Extend arkts-subset [2] --- tests/arkts-subset/ets/counter.d.ts | 29 +++++++++++++++++++++ tests/arkts-subset/ets/enums.d.ts | 33 +++++++++++++++++++++++- tests/arkts-subset/ets/image.d.ts | 25 +++++++++++++++++- tests/arkts-subset/ets/image_common.d.ts | 30 +++++++++++++++++++++ tests/arkts-subset/ets/scroll.d.ts | 1 + tests/arkts-subset/ets/text.d.ts | 16 ++++++++++++ tests/arkts-subset/ets/units.d.ts | 4 ++- 7 files changed, 135 insertions(+), 3 deletions(-) create mode 100644 tests/arkts-subset/ets/counter.d.ts create mode 100644 tests/arkts-subset/ets/image_common.d.ts diff --git a/tests/arkts-subset/ets/counter.d.ts b/tests/arkts-subset/ets/counter.d.ts new file mode 100644 index 00000000..7577a72b --- /dev/null +++ b/tests/arkts-subset/ets/counter.d.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2024 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. + */ + + +interface CounterInterface { + (): CounterAttribute; + } + + declare class CounterAttribute extends CommonMethod { + onInc(event: VoidCallback): CounterAttribute; + onDec(event: VoidCallback): CounterAttribute; + enableDec(value: boolean): CounterAttribute; + enableInc(value: boolean): CounterAttribute; + } + declare const CounterInstance: CounterAttribute; + declare const Counter: CounterInterface; + \ No newline at end of file diff --git a/tests/arkts-subset/ets/enums.d.ts b/tests/arkts-subset/ets/enums.d.ts index a861362c..1057ac17 100644 --- a/tests/arkts-subset/ets/enums.d.ts +++ b/tests/arkts-subset/ets/enums.d.ts @@ -111,4 +111,35 @@ declare enum IlluminatedType { BORDER_CONTENT = 3, BLOOM_BORDER = 4, BLOOM_BORDER_CONTENT = 5 -} \ No newline at end of file +} + +declare enum TextAlign { + Center, + Start, + End, + JUSTIFY, +} + +declare enum ImageFit { + Contain, + Cover, + Auto, + Fill, + ScaleDown, + None, + TOP_START = 7, + TOP = 8, + TOP_END = 9, + START = 10, + CENTER = 11, + END = 12, + BOTTOM_START = 13, + BOTTOM = 14, + BOTTOM_END = 15, +} + +declare enum BarState { + Off, + Auto, + On, +} diff --git a/tests/arkts-subset/ets/image.d.ts b/tests/arkts-subset/ets/image.d.ts index 60e71c0c..993ce8cc 100644 --- a/tests/arkts-subset/ets/image.d.ts +++ b/tests/arkts-subset/ets/image.d.ts @@ -1,8 +1,31 @@ +/* + * Copyright (c) 2024 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 type DrawableDescriptor = import ('../api/@ohos.arkui.drawableDescriptor').DrawableDescriptor; + +declare enum ImageContent { + EMPTY = 0, +} declare interface ImageInterface { - (): ImageAttribute + (src: PixelMap | ResourceStr | DrawableDescriptor): ImageAttribute; + (src: PixelMap | ResourceStr | DrawableDescriptor | ImageContent): ImageAttribute; + (src: PixelMap | ResourceStr | DrawableDescriptor, imageAIOptions: ImageAIOptions): ImageAttribute; } declare class ImageAttribute extends CommonMethod { + objectFit(value: ImageFit): ImageAttribute; } declare const Image: ImageInterface \ No newline at end of file diff --git a/tests/arkts-subset/ets/image_common.d.ts b/tests/arkts-subset/ets/image_common.d.ts new file mode 100644 index 00000000..ec6f8695 --- /dev/null +++ b/tests/arkts-subset/ets/image_common.d.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 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 enum ImageAnalyzerType { + SUBJECT = 0, + TEXT, + OBJECT_LOOKUP, +} + +declare class ImageAnalyzerController { + constructor(); + getImageAnalyzerSupportTypes(): ImageAnalyzerType[]; +} + +declare interface ImageAIOptions { + types?: ImageAnalyzerType[]; + aiController?: ImageAnalyzerController; +} \ No newline at end of file diff --git a/tests/arkts-subset/ets/scroll.d.ts b/tests/arkts-subset/ets/scroll.d.ts index 3b79c7e3..31f16bcf 100644 --- a/tests/arkts-subset/ets/scroll.d.ts +++ b/tests/arkts-subset/ets/scroll.d.ts @@ -47,6 +47,7 @@ interface ScrollInterface { declare class ScrollAttribute extends ScrollableCommonMethod { //onScrollEdge(event: (side: Edge) => void): ScrollAttribute; + scrollBar(barState: BarState): ScrollAttribute; } declare const Scroll: ScrollInterface; diff --git a/tests/arkts-subset/ets/text.d.ts b/tests/arkts-subset/ets/text.d.ts index 1c42b32a..ab82a884 100644 --- a/tests/arkts-subset/ets/text.d.ts +++ b/tests/arkts-subset/ets/text.d.ts @@ -18,6 +18,10 @@ declare interface TextOptions { controller: TextController; } +declare interface TextOverflowOptions { + overflow: TextOverflow; +} + interface TextInterface { (content?: string | Resource, value?: TextOptions): TextAttribute; @@ -29,6 +33,18 @@ declare class TextAttribute extends CommonMethod { fontColor(value: ResourceColor): TextAttribute; + maxLines(value: number): TextAttribute; + + fontSize(value: number | string | Resource): TextAttribute; + + fontWeight(value: number | FontWeight | string): TextAttribute; + + textOverflow(options: TextOverflowOptions): TextAttribute; + + textAlign(value: TextAlign): TextAttribute; + + lineHeight(value: number | string | Resource): TextAttribute; + } declare const TextInstance: TextAttribute; diff --git a/tests/arkts-subset/ets/units.d.ts b/tests/arkts-subset/ets/units.d.ts index 2ad61005..7cc54209 100644 --- a/tests/arkts-subset/ets/units.d.ts +++ b/tests/arkts-subset/ets/units.d.ts @@ -78,4 +78,6 @@ declare interface Font { declare type Margin = Padding; -declare type LocalizedMargin = LocalizedPadding; \ No newline at end of file +declare type LocalizedMargin = LocalizedPadding; + +declare type VoidCallback = () => void; -- Gitee From 69eccc898fe0f665ca54a1467a6d245164671121 Mon Sep 17 00:00:00 2001 From: pavelmironchik Date: Mon, 18 Nov 2024 14:06:41 +0000 Subject: [PATCH 27/53] !973 Merge TypeConvertor and DeclarationConvertor in most of cases --- src/LibraryInterface.ts | 3 + .../convertors/CJConvertors.ts | 37 +++--- .../convertors/CppConvertors.ts | 23 +--- .../convertors/ETSConvertors.ts | 6 +- .../convertors/InteropConvertor.ts | 111 +++++++---------- .../convertors/JavaConvertors.ts | 30 ++--- .../convertors/TSConvertors.ts | 51 ++++---- .../LanguageWriters/nameConvertor.ts | 32 ++--- .../writers/CJLanguageWriter.ts | 2 +- .../writers/CppLanguageWriter.ts | 6 +- .../writers/ETSLanguageWriter.ts | 2 +- .../writers/JavaLanguageWriter.ts | 2 +- .../writers/TsLanguageWriter.ts | 6 +- src/peer-generation/PeerLibrary.ts | 22 ++-- src/peer-generation/PeerMethod.ts | 2 +- src/peer-generation/ReferenceResolver.ts | 2 +- src/peer-generation/idl/DependencySorter.ts | 21 +--- .../idl/IdlDependenciesCollector.ts | 33 ++--- .../idl/IdlPeerGeneratorVisitor.ts | 114 +++++------------- .../idl/IdlSyntheticDeclarations.ts | 4 +- src/peer-generation/idl/common.ts | 7 -- .../printers/BridgeCcPrinter.ts | 2 +- .../printers/ConflictedDeclarationsPrinter.ts | 8 +- src/peer-generation/printers/HeaderPrinter.ts | 2 +- src/peer-generation/printers/StructPrinter.ts | 5 +- .../printers/TypeCheckPrinter.ts | 7 +- src/skoala-generation/idl/idlSkoalaLibrary.ts | 30 +++-- 27 files changed, 223 insertions(+), 347 deletions(-) diff --git a/src/LibraryInterface.ts b/src/LibraryInterface.ts index 48e3b6d6..6068951a 100644 --- a/src/LibraryInterface.ts +++ b/src/LibraryInterface.ts @@ -1,9 +1,11 @@ import * as idl from "./idl"; import { ArgConvertor } from "./peer-generation/ArgConvertors"; +import { IdlEntryManager } from "./peer-generation/idl/IdlEntryManager"; import { ReferenceResolver } from "./peer-generation/ReferenceResolver"; // todo: TypeProcessor? LibraryBase? export interface LibraryInterface extends ReferenceResolver { + get factory(): IdlEntryManager typeConvertor(param: string, type: idl.IDLType, isOptionalParam?: boolean): ArgConvertor declarationConvertor(param: string, type: idl.IDLReferenceType, declaration: idl.IDLEntry | undefined): ArgConvertor /** @deprecated @@ -29,6 +31,7 @@ export interface LibraryInterface extends ReferenceResolver { mapType(type: idl.IDLType | idl.IDLCallback): string createContinuationCallbackReference(continuationType: idl.IDLType): idl.IDLReferenceType getCurrentContext(): string | undefined + isComponentDeclaration(iface: idl.IDLInterface): boolean /** * todo: is it really needed? */ diff --git a/src/peer-generation/LanguageWriters/convertors/CJConvertors.ts b/src/peer-generation/LanguageWriters/convertors/CJConvertors.ts index b3a2165f..83f1df06 100644 --- a/src/peer-generation/LanguageWriters/convertors/CJConvertors.ts +++ b/src/peer-generation/LanguageWriters/convertors/CJConvertors.ts @@ -17,7 +17,7 @@ import * as idl from '../../../idl' import { throwException } from '../../../util' import { ARK_CUSTOM_OBJECT, cjCustomTypeMapping, convertCJOptional } from '../../printers/lang/Cangjie' import { ReferenceResolver } from '../../ReferenceResolver' -import { convertType, IdlNameConvertor, IdlNameConvertorBase, TypeConvertor } from "../nameConvertor" +import { convertNode, convertType, IdlNameConvertor, NodeConvertor } from "../nameConvertor" class CJTypeAlias { // CJ type itself @@ -52,29 +52,21 @@ class CJTypeAlias { } } -export class CJIDLNodeToStringConvertor extends IdlNameConvertorBase implements TypeConvertor { +export class CJIDLNodeToStringConvertor implements NodeConvertor, IdlNameConvertor { constructor( protected resolver: ReferenceResolver - ) { super() } + ) { } - /**** IdlTypeNameConvertor *******************************************/ - - convertType(type: idl.IDLType | idl.IDLCallback): string { - const typeAlias = idl.isCallback(type) - ? this.convertCallback(type) - : convertType(this, type) + convert(node: idl.IDLNode): string { + const typeAlias = convertNode(this, node) const rawType = typeAlias.type.optional ? convertCJOptional(typeAlias.type.text) : typeAlias.type.text return this.mapTypeName(rawType) } - convertEntry(entry: idl.IDLEntry): string { - return entry.name ?? throwException("unnamed entry!") - } - /***** TypeConvertor **********************************/ convertOptional(type: idl.IDLOptionalType): CJTypeAlias { - return CJTypeAlias.fromTypeName(convertCJOptional(this.convertType(type.type)), true) + return CJTypeAlias.fromTypeName(convertCJOptional(this.convert(type.type)), true) } convertUnion(type: idl.IDLUnionType): CJTypeAlias { const aliases = type.types.map(it => convertType(this, it)) @@ -91,6 +83,15 @@ export class CJIDLNodeToStringConvertor extends IdlNameConvertorBase implements } throw new Error(`IDL type ${idl.DebugUtils.debugPrintType(type)} not supported`) } + convertInterface(node: idl.IDLInterface): CJTypeAlias { + throw new Error('Method not implemented.') + } + convertEnum(node: idl.IDLEnum): CJTypeAlias { + throw new Error('Method not implemented.') + } + convertTypedef(node: idl.IDLTypedef): CJTypeAlias { + throw new Error('Method not implemented.') + } convertCallback(type: idl.IDLCallback): CJTypeAlias { // TODO return CJTypeAlias.fromTypeName(`Callback`, false) @@ -211,7 +212,7 @@ export class CJIDLNodeToStringConvertor extends IdlNameConvertorBase implements } export class CJIDLTypeToForeignStringConvertor extends CJIDLNodeToStringConvertor { - convert(type: idl.IDLType | idl.IDLCallback): string { + convert(type: idl.IDLNode): string { if (idl.isPrimitiveType(type)) { switch (type) { case idl.IDLStringType: return 'CString' @@ -224,13 +225,13 @@ export class CJIDLTypeToForeignStringConvertor extends CJIDLNodeToStringConverto } if (idl.isReferenceType(type)) { // Fix, actual mapping has to be due to IDLType - if (super.convertType(type).startsWith('Array')) + if (super.convert(type).startsWith('Array')) return `CPointer` - if (super.convertType(type) == 'String') { + if (super.convert(type) == 'String') { return `CString` } } - return super.convertType(type) + return super.convert(type) } convertPrimitiveType(type: idl.IDLPrimitiveType): CJTypeAlias { switch (type) { diff --git a/src/peer-generation/LanguageWriters/convertors/CppConvertors.ts b/src/peer-generation/LanguageWriters/convertors/CppConvertors.ts index 710e517b..b580af8c 100644 --- a/src/peer-generation/LanguageWriters/convertors/CppConvertors.ts +++ b/src/peer-generation/LanguageWriters/convertors/CppConvertors.ts @@ -16,20 +16,11 @@ import * as idl from '../../../idl' import { PrimitiveType } from '../../ArkPrimitiveType'; import { ReferenceResolver } from '../../ReferenceResolver'; -import { IdlNameConvertor, IdlNameConvertorBase } from "../nameConvertor"; +import { IdlNameConvertor } from "../nameConvertor"; import { ConvertResult, InteropConverter } from './InteropConvertor'; -export class CppIDLNodeToStringConvertor extends IdlNameConvertorBase { - - private readonly interopConverter: InteropConverter - constructor( - protected resolver: ReferenceResolver - ) { - super() - this.interopConverter = new InteropConverter(resolver) - } - - private unwrap(type: idl.IDLEntry | idl.IDLType | idl.IDLCallback, result:ConvertResult): string { +export class CppIDLNodeToStringConvertor extends InteropConverter implements IdlNameConvertor { + private unwrap(type: idl.IDLNode, result:ConvertResult): string { if (idl.isType(type) && idl.isOptionalType(type)) { return `Opt_${result.text}` } @@ -39,11 +30,7 @@ export class CppIDLNodeToStringConvertor extends IdlNameConvertorBase { return `${PrimitiveType.Prefix}${result.text}` } - convertType(type: idl.IDLType): string { - return this.unwrap(type, this.interopConverter.convertType(type)) - } - - convertEntry(entry: idl.IDLEntry): string { - return this.unwrap(entry, this.interopConverter.convertEntry(entry)) + convert(node: idl.IDLNode): string { + return this.unwrap(node, this.convertNode(node)) } } diff --git a/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts b/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts index 10f7402f..c073b0c1 100644 --- a/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts +++ b/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts @@ -47,7 +47,7 @@ export class EtsIDLNodeToStringConvertor extends TsIDLNodeToStringConverter { case idl.IDLI32Type: return 'KInt32ArrayPtr' case idl.IDLF32Type: return 'KFloat32ArrayPtr' } - return `Array<${this.convertType(type.elementType[0])}>` + return `Array<${this.convert(type.elementType[0])}>` } return super.convertContainer(type) } @@ -103,8 +103,8 @@ export class EtsIDLNodeToStringConvertor extends TsIDLNodeToStringConverter { protected mapCallback(decl: idl.IDLCallback): string { const types = decl.parameters.map(it => { - return `${this.convertType(it.isOptional ? idl.createUnionType([it.type!, idl.IDLUndefinedType]) : it.type!)}` + return `${this.convert(it.isOptional ? idl.createUnionType([it.type!, idl.IDLUndefinedType]) : it.type!)}` }) - return `Function${types.length}<${types.join(",")}${types.length > 0 ? "," : ""}${this.convertType(decl.returnType)}>` + return `Function${types.length}<${types.join(",")}${types.length > 0 ? "," : ""}${this.convert(decl.returnType)}>` } } diff --git a/src/peer-generation/LanguageWriters/convertors/InteropConvertor.ts b/src/peer-generation/LanguageWriters/convertors/InteropConvertor.ts index 2106aa87..e9f0e088 100644 --- a/src/peer-generation/LanguageWriters/convertors/InteropConvertor.ts +++ b/src/peer-generation/LanguageWriters/convertors/InteropConvertor.ts @@ -18,14 +18,14 @@ import { capitalize } from '../../../util' import { PrimitiveType } from '../../ArkPrimitiveType' import { PeerGeneratorConfig } from '../../PeerGeneratorConfig' import { ReferenceResolver } from '../../ReferenceResolver' -import { IdlNameConvertor, IdlNameConvertorBase, TypeConvertor } from '../nameConvertor' +import { convertNode, IdlNameConvertor, NodeConvertor } from '../nameConvertor' export interface ConvertResult { text: string, noPrefix: boolean } -export class InteropConverter implements TypeConvertor { +export class InteropConverter implements NodeConvertor { private make(text: string, noPrefix = false): ConvertResult { return { text, noPrefix } @@ -35,83 +35,63 @@ export class InteropConverter implements TypeConvertor { protected resolver: ReferenceResolver ) {} - convertType(type: idl.IDLType): ConvertResult { - if (idl.isType(type) && idl.isOptionalType(type)) { - return this.convertOptional(type) - } - if (idl.isPrimitiveType(type)) { - return this.convertPrimitiveType(type) - } - if (idl.isContainerType(type)) { - return this.convertContainer(type) - } - if (idl.isUnionType(type)) { - return this.convertUnion(type) - } - if (idl.isReferenceType(type)) { - return this.convertTypeReference(type) - } - if (idl.isTypeParameterType(type)) { - return this.make('CustomObject') - } - throw new Error(`Unmapped type ${idl.DebugUtils.debugPrintType(type)}`) + convertNode(node: idl.IDLNode): ConvertResult { + return convertNode(this, node) } - convertEntry(target: idl.IDLEntry): ConvertResult { - if (idl.isType(target)) { - throw new Error('use convertType instead!') - } - if (idl.isAnonymousInterface(target)) { - return target.name - ? this.make(target.name) - : this.make(this.computeTargetTypeLiteralName(target), true) - } - if (idl.isEnum(target)) { - return this.make(this.enumName(target)) + convertInterface(node: idl.IDLInterface): ConvertResult { + if (idl.isAnonymousInterface(node) && 1==1) { + return node.name + ? this.make(node.name) + : this.make(this.computeTargetTypeLiteralName(node), true) } - if (idl.isInterface(target) || idl.isClass(target)) { - if (target.extendedAttributes?.find(it => it.name === idl.IDLExtendedAttributes.Namespace && it.value === 'predefined')) { - return this.make(target.name, true) + if ((idl.isInterface(node) || idl.isClass(node)) && 1==1) { + if (node.extendedAttributes?.find(it => it.name === idl.IDLExtendedAttributes.Namespace && it.value === 'predefined')) { + return this.make(node.name, true) } - return this.make(target.name) + return this.make(node.name) } - if (idl.isCallback(target)) { - return this.make(PrimitiveType.LibraryPrefix + target.name, true) + if (idl.isTupleInterface(node)) { + return node.name + ? this.make(node.name) + : this.make(`Tuple_${node.properties.map(it => this.convertNode(idl.maybeOptional(it.type, it.isOptional)).text).join("_")}`, true) } - if (idl.isTupleInterface(target)) { - return target.name - ? this.make(target.name) - : this.make(`Tuple_${target.properties.map(it => this.convertType(idl.maybeOptional(it.type, it.isOptional)).text).join("_")}`, true) - } - if (idl.isImport(target)) - return this.make(this.mapImportTypeName(target), true) - if (idl.isEnumMember(target)) - return this.convertEntry(target.parent) - if (idl.isTypedef(target)) - return this.make(target.name) - throw new Error(`Cannot compute target name: ${idl.IDLKind[target.kind!]} ${target.name}`) + throw new Error("Unknown interface type") + } + convertEnum(node: idl.IDLEnum): ConvertResult { + return this.make(this.enumName(node)) + } + convertTypedef(node: idl.IDLTypedef): ConvertResult { + return this.make(node.name) } + convertCallback(node: idl.IDLCallback): ConvertResult { + return this.make(PrimitiveType.LibraryPrefix + node.name, true) + } + // convertImport + // + // if (idl.isImport(target)) + // return this.make(this.mapImportTypeName(target), true) ///////////////////////////////////////////////////////////////////////////////////////// convertOptional(type: idl.IDLOptionalType): ConvertResult { - return this.convertType(type.type) + return this.convertNode(type.type) } convertUnion(type: idl.IDLUnionType): ConvertResult { return this.make(type.name, false) } convertContainer(type: idl.IDLContainerType): ConvertResult { if (idl.IDLContainerUtils.isPromise(type)) { - return this.make(`Promise_${this.convertType(type.elementType[0]).text}`) + return this.make(`Promise_${this.convertNode(type.elementType[0]).text}`) } if (idl.IDLContainerUtils.isSequence(type)) { if (type.elementType[0] === idl.IDLU8Type) { return this.make(`uint8_t*`, true) } - return this.make(`Array_${this.convertType(type.elementType[0]).text}`, true) + return this.make(`Array_${this.convertNode(type.elementType[0]).text}`, true) } if (idl.IDLContainerUtils.isRecord(type)) { - return this.make(`Map_${this.convertType(type.elementType[0]).text}_${this.convertType(type.elementType[1]).text}`, true) + return this.make(`Map_${this.convertNode(type.elementType[0]).text}_${this.convertNode(type.elementType[1]).text}`, true) } throw new Error(`Unmapped container type ${idl.DebugUtils.debugPrintType(type)}`) } @@ -133,15 +113,15 @@ export class InteropConverter implements TypeConvertor { if (idl.isReferenceType(decl)) { return this.make(`${capitalize(decl.name)}`) } - return this.convertType(decl) + return this.convertNode(decl) } - let res = this.convertEntry(decl as idl.IDLEntry) + let res = this.convertNode(decl as idl.IDLEntry) if (type.name === "Optional") res = this.make("Opt_" + res.text, true) return res } convertTypeParameter(type: idl.IDLTypeParameterType): ConvertResult { - throw new Error("Method not implemented.") + return this.make('CustomObject') } convertPrimitiveType(type: idl.IDLPrimitiveType): ConvertResult { switch (type) { @@ -190,7 +170,7 @@ export class InteropConverter implements TypeConvertor { private computeTargetTypeLiteralName(decl: idl.IDLInterface): string { const map = new Map() for (const prop of decl.properties) { - const type = this.convertType(prop.type) + const type = this.convertNode(prop.type) const values = map.has(type.text) ? map.get(type.text)! : [] values.push(prop.name) map.set(type.text, values) @@ -200,21 +180,14 @@ export class InteropConverter implements TypeConvertor { } } -export class IDLNodeToStringConvertor extends IdlNameConvertorBase { - +export class IDLNodeToStringConvertor implements IdlNameConvertor { private readonly interopConverter: InteropConverter constructor( protected resolver: ReferenceResolver ) { - super() this.interopConverter = new InteropConverter(resolver) } - - convertType(type: idl.IDLType): string { - return this.interopConverter.convertType(type).text - } - - convertEntry(type: idl.IDLEntry): string { - return this.interopConverter.convertEntry(type).text + convert(node: idl.IDLNode): string { + return this.interopConverter.convertNode(node).text } } diff --git a/src/peer-generation/LanguageWriters/convertors/JavaConvertors.ts b/src/peer-generation/LanguageWriters/convertors/JavaConvertors.ts index df50c513..714bca8b 100644 --- a/src/peer-generation/LanguageWriters/convertors/JavaConvertors.ts +++ b/src/peer-generation/LanguageWriters/convertors/JavaConvertors.ts @@ -17,7 +17,7 @@ import * as idl from '../../../idl' import { throwException } from '../../../util'; import { ARK_CUSTOM_OBJECT, convertJavaOptional, javaCustomTypeMapping } from '../../printers/lang/Java'; import { ReferenceResolver } from '../../ReferenceResolver'; -import { convertType, IdlNameConvertor, IdlNameConvertorBase, TypeConvertor } from "../nameConvertor"; +import { convertNode, convertType, IdlNameConvertor, NodeConvertor } from "../nameConvertor"; class JavaTypeAlias { @@ -53,30 +53,30 @@ class JavaTypeAlias { } } -export class JavaIDLNodeToStringConvertor extends IdlNameConvertorBase implements TypeConvertor { +export class JavaIDLNodeToStringConvertor implements NodeConvertor, IdlNameConvertor { constructor( private resolver: ReferenceResolver - ) { super() } + ) { } - /**** IdlTypeNameConvertor *******************************************/ - - convertType(type: idl.IDLType | idl.IDLCallback): string { - const typeAlias = idl.isCallback(type) - ? this.convertCallback(type) - : convertType(this, type) - const rowType = typeAlias.type.optional ? convertJavaOptional(typeAlias.type.text) : typeAlias.type.text + convert(node: idl.IDLNode): string { + const alias = convertNode(this, node) + const rowType = alias.type.optional ? convertJavaOptional(alias.type.text) : alias.type.text return this.mapTypeName(rowType) } - convertEntry(entry: idl.IDLEntry): string { - return entry.name ?? throwException("Unnamed entry!") + convertInterface(node: idl.IDLInterface): JavaTypeAlias { + throw new Error('Method not implemented.'); + } + convertEnum(node: idl.IDLEnum): JavaTypeAlias { + throw new Error('Method not implemented.'); + } + convertTypedef(node: idl.IDLTypedef): JavaTypeAlias { + throw new Error('Method not implemented.'); } - - /***** TypeConvertor **********************************/ convertOptional(type: idl.IDLOptionalType): JavaTypeAlias { - return JavaTypeAlias.fromTypeName(convertJavaOptional(this.convertType(type.type)), true) + return JavaTypeAlias.fromTypeName(convertJavaOptional(this.convert(type.type)), true) } convertUnion(type: idl.IDLUnionType): JavaTypeAlias { const aliases = type.types.map(it => convertType(this, it)) diff --git a/src/peer-generation/LanguageWriters/convertors/TSConvertors.ts b/src/peer-generation/LanguageWriters/convertors/TSConvertors.ts index e5aba706..c5585887 100644 --- a/src/peer-generation/LanguageWriters/convertors/TSConvertors.ts +++ b/src/peer-generation/LanguageWriters/convertors/TSConvertors.ts @@ -13,42 +13,45 @@ * limitations under the License. */ -import { convertType, IdlNameConvertorBase, TypeConvertor } from '../nameConvertor' +import { convertNode, IdlNameConvertor, NodeConvertor } from '../nameConvertor' import * as idl from '../../../idl' import { ReferenceResolver } from '../../ReferenceResolver' import { throwException } from '../../../util' -export class TsIDLNodeToStringConverter extends IdlNameConvertorBase implements TypeConvertor { +export class TsIDLNodeToStringConverter implements NodeConvertor, IdlNameConvertor { constructor( protected resolver: ReferenceResolver - ) { super() } + ) { } - /**** IdlTypeNameConvertor *******************************************/ - - convertType(type: idl.IDLType): string { - return convertType(this, type) - } - - convertEntry(entry: idl.IDLEntry): string { - if (idl.isCallback(entry)) { - return this.mapCallback(entry) - } - return entry.name ?? throwException('unnamed entry!') + convert(node: idl.IDLNode): string { + return convertNode(this, node) } /***** TypeConvertor *****************************************/ + convertInterface(node: idl.IDLInterface): string { + return node.name + } + convertEnum(node: idl.IDLEnum): string { + return node.name + } + convertTypedef(node: idl.IDLTypedef): string { + return node.name + } + convertCallback(node: idl.IDLCallback): string { + return node.name + } convertOptional(type: idl.IDLOptionalType): string { - return `${this.convertType(type.type)} | undefined` + return `${this.convert(type.type)} | undefined` } convertUnion(type: idl.IDLUnionType): string { return type.types. map(it => { if (false /* add check if it is function */) { - return `(${this.convertType(it)})` + return `(${this.convert(it)})` } - return this.convertType(it) + return this.convert(it) }) .join(' | ') } @@ -58,14 +61,14 @@ export class TsIDLNodeToStringConverter extends IdlNameConvertorBase implements case idl.IDLU8Type: return 'Uint8Array' // should be changed to Array case idl.IDLI32Type: return 'Int32Array' // should be changed to Array case idl.IDLF32Type: return 'Float32Array' // should be changed to Array - default: return `Array<${this.convertType(type.elementType[0])}>` + default: return `Array<${this.convert(type.elementType[0])}>` } } if (idl.IDLContainerUtils.isRecord(type)) { - return `Map<${this.convertType(type.elementType[0])}, ${this.convertType(type.elementType[1])}>` + return `Map<${this.convert(type.elementType[0])}, ${this.convert(type.elementType[1])}>` } if (idl.IDLContainerUtils.isPromise(type)) { - return `Promise<${this.convertType(type.elementType[0])}>` + return `Promise<${this.convert(type.elementType[0])}>` } throw new Error(`Unmapped container type ${idl.DebugUtils.debugPrintType(type)}`) } @@ -111,7 +114,7 @@ export class TsIDLNodeToStringConverter extends IdlNameConvertorBase implements if (typeSpec === `AttributeModifier`) typeArgs = [`object`] if (typeSpec === `ContentModifier` || typeSpec === `WrappedBuilder`) - typeArgs = [this.convertType(idl.IDLAnyType)] + typeArgs = [this.convert(idl.IDLAnyType)] if (typeSpec === `Optional`) return `${typeArgs} | undefined` const maybeTypeArguments = !typeArgs?.length ? '' : `<${typeArgs.join(', ')}>` @@ -170,8 +173,8 @@ export class TsIDLNodeToStringConverter extends IdlNameConvertorBase implements } protected mapCallback(decl: idl.IDLCallback): string { const params = decl.parameters.map(it => - `${it.isVariadic ? "..." : ""}${it.name}${it.isOptional ? "?" : ""}: ${this.convertType(it.type!)}`) - return `((${params.join(", ")}) => ${this.convertType(decl.returnType)})` + `${it.isVariadic ? "..." : ""}${it.name}${it.isOptional ? "?" : ""}: ${this.convert(it.type!)}`) + return `((${params.join(", ")}) => ${this.convert(decl.returnType)})` } protected productType(decl: idl.IDLInterface, isTuple: boolean, includeFieldNames: boolean): string { @@ -181,7 +184,7 @@ export class TsIDLNodeToStringConverter extends IdlNameConvertorBase implements decl.properties .map(it => isTuple ? this.processTupleType(it) : it) .map(it => { - const type = this.convertType(it.type) + const type = this.convert(it.type) return it.isOptional ? includeFieldNames ? `${it.name}?: ${type}` : `(${type})?` : includeFieldNames ? `${it.name}: ${type}` : `${type}` diff --git a/src/peer-generation/LanguageWriters/nameConvertor.ts b/src/peer-generation/LanguageWriters/nameConvertor.ts index 3cae88d8..89578884 100644 --- a/src/peer-generation/LanguageWriters/nameConvertor.ts +++ b/src/peer-generation/LanguageWriters/nameConvertor.ts @@ -16,31 +16,9 @@ import * as idl from '../../idl' export interface IdlNameConvertor { - /** @deprecated - * Use `IdlNameConvertor.convert` - */ - convertType(type: idl.IDLType): string - /** @deprecated - * Use `IdlNameConvertor.convert` - */ - convertEntry(entry: idl.IDLEntry): string convert(node: idl.IDLNode): string } -export abstract class IdlNameConvertorBase implements IdlNameConvertor { - convert(node: idl.IDLNode): string { - if (idl.isType(node)) { - return this.convertType(node) - } - if (idl.isEntry(node)) { - return this.convertEntry(node) - } - throw new Error("unreachable: node is type or entry") - } - abstract convertType(type: idl.IDLType): string - abstract convertEntry(entry: idl.IDLEntry): string -} - export interface TypeConvertor { convertOptional(type: idl.IDLOptionalType): T convertUnion(type: idl.IDLUnionType): T @@ -81,4 +59,14 @@ export function convertDeclaration(convertor: DeclarationConvertor, decl: if (idl.isTypedef(decl)) return convertor.convertTypedef(decl) if (idl.isCallback(decl)) return convertor.convertCallback(decl) throw new Error(`Unknown declaration type ${decl.kind ? idl.IDLKind[decl.kind] : "(undefined kind)"}`) +} + +export interface NodeConvertor extends TypeConvertor, DeclarationConvertor {} + +export function convertNode(convertor: NodeConvertor, node: idl.IDLNode): T { + if (idl.isEntry(node)) + return convertDeclaration(convertor, node) + if (idl.isType(node)) + return convertType(convertor, node) + throw new Error(`Unknown node type ${idl.IDLKind[node.kind]}`) } \ No newline at end of file diff --git a/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts index 11ead94d..41dcad72 100644 --- a/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts @@ -196,7 +196,7 @@ export class CJLanguageWriter extends LanguageWriter { } stringifyType(type: idl.IDLType): string { - return this.typeConvertor.convertType(type) + return this.typeConvertor.convert(type) } writeClass(name: string, op: (writer: LanguageWriter) => void, superClass?: string, interfaces?: string[], generics?: string[]): void { diff --git a/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts index 12a07f11..8e74e1c9 100644 --- a/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts @@ -76,7 +76,7 @@ export class CppCastExpression implements LanguageExpression { if (receiver !== undefined) { return `std::decay::type` } - return this.convertor.convertType(type) + return this.convertor.convert(type) } } @@ -159,7 +159,7 @@ export class CppLanguageWriter extends CLikeLanguageWriter { this.typeConvertor = new CppIDLNodeToStringConvertor(this.resolver) } stringifyType(type: IDLType): string { - return this.typeConvertor.convertType(type) + return this.typeConvertor.convert(type) } fork(): LanguageWriter { return new CppLanguageWriter(new IndentedPrinter(), this.resolver) @@ -375,7 +375,7 @@ export class CppLanguageWriter extends CLikeLanguageWriter { if (convertor === undefined) { throwException("Need pass EnumConvertor") } - return `static_cast<${this.typeConvertor.convertEntry(convertor.enumEntry)}>(${value})` + return `static_cast<${this.typeConvertor.convert(convertor.enumEntry)}>(${value})` } override escapeKeyword(name: string): string { return cppKeywords.has(name) ? name + "_" : name diff --git a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts index 0681f950..5771ee8b 100644 --- a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts @@ -186,7 +186,7 @@ export class ETSLanguageWriter extends TSLanguageWriter { nativeReceiver(): string { return 'NativeModule' } makeUnsafeCast(convertor: ArgConvertor, param: string): string { if ((convertor instanceof EnumConvertor) && !param.endsWith(".value")) { - return `(${param} as ${this.typeConvertor.convertEntry(convertor.enumEntry)}).${convertor.isStringEnum ? 'ordinal' : 'value'}` + return `(${param} as ${this.typeConvertor.convert(convertor.enumEntry)}).${convertor.isStringEnum ? 'ordinal' : 'value'}` } return super.makeUnsafeCast(convertor, param) } diff --git a/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts index d061616f..ffc8f09a 100644 --- a/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts @@ -125,7 +125,7 @@ export class JavaLanguageWriter extends CLikeLanguageWriter { } stringifyType(type: idl.IDLType): string { - return this.typeConvertor.convertType(type) + return this.typeConvertor.convert(type) } fork(): LanguageWriter { diff --git a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts index 27b83205..68c61109 100644 --- a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts @@ -61,10 +61,10 @@ export class TSLambdaExpression extends LambdaExpression { asString(): string { const params = this.signature.args.map((it, i) => { const maybeOptional = idl.isOptionalType(it) ? "?" : "" - return `${this.signature.argName(i)}${maybeOptional}: ${this.convertor.convertType(it)}` + return `${this.signature.argName(i)}${maybeOptional}: ${this.convertor.convert(it)}` }) - return `(${params.join(", ")}): ${this.convertor.convertType(this.signature.returnType)} => { ${this.bodyAsString()} }` + return `(${params.join(", ")}): ${this.convertor.convert(this.signature.returnType)} => { ${this.bodyAsString()} }` } } @@ -195,7 +195,7 @@ export class TSLanguageWriter extends LanguageWriter { } stringifyType(type: idl.IDLType): string { - return this.typeConvertor.convertType(type) + return this.typeConvertor.convert(type) } writeClass(name: string, op: (writer: LanguageWriter) => void, superClass?: string, interfaces?: string[], generics?: string[], isDeclared?: boolean): void { diff --git a/src/peer-generation/PeerLibrary.ts b/src/peer-generation/PeerLibrary.ts index f7a2f388..03a788ce 100644 --- a/src/peer-generation/PeerLibrary.ts +++ b/src/peer-generation/PeerLibrary.ts @@ -139,7 +139,7 @@ export class PeerLibrary implements LibraryInterface { } mapType(type: idl.IDLType): string { - return this.targetNameConvertorInstance.convertType( + return this.targetNameConvertorInstance.convert( type ?? idl.IDLVoidType ) } @@ -199,7 +199,7 @@ export class PeerLibrary implements LibraryInterface { return new DateConvertor(param) } if (isImport(type)) - return new ImportTypeConvertor(param, this.targetNameConvertorInstance.convertType(type)) + return new ImportTypeConvertor(param, this.targetNameConvertorInstance.convert(type)) } if (idl.isReferenceType(type)) { const decl = this.resolveTypeReference(type) @@ -216,7 +216,7 @@ export class PeerLibrary implements LibraryInterface { } if (idl.isTypeParameterType(type)) { // TODO: unlikely correct. - return new CustomTypeConvertor(param, this.targetNameConvertorInstance.convertType(type)) + return new CustomTypeConvertor(param, this.targetNameConvertorInstance.convert(type)) } throw new Error(`Cannot convert: ${type.kind}`) } @@ -226,11 +226,11 @@ export class PeerLibrary implements LibraryInterface { if (customConv) return customConv if (!declaration || isConflictingDeclaration(declaration)) - return new CustomTypeConvertor(param, this.targetNameConvertorInstance.convertType(type), false, this.targetNameConvertorInstance.convertType(type)) // assume some predefined type + return new CustomTypeConvertor(param, this.targetNameConvertorInstance.convert(type), false, this.targetNameConvertorInstance.convert(type)) // assume some predefined type const declarationName = declaration.name! if (isImport(declaration)) { - return new ImportTypeConvertor(param, this.targetNameConvertorInstance.convertType(type)) + return new ImportTypeConvertor(param, this.targetNameConvertorInstance.convert(type)) } if (idl.isEnum(declaration)) { return new EnumConvertor(param, declaration, isStringEnum(declaration)) @@ -298,7 +298,7 @@ export class PeerLibrary implements LibraryInterface { * or `IdlNameConvertor.convertType` */ getTypeName(type: idl.IDLType): string { - return this.nativeNameConvertorInstance.convertType(type) + return this.nativeNameConvertorInstance.convert(type) } /** @deprecated @@ -307,7 +307,7 @@ export class PeerLibrary implements LibraryInterface { * `IdlNameConvertor.convertEntry` */ getEntryName(entry: idl.IDLEntry): string { - return this.nativeNameConvertorInstance.convertEntry(entry) + return this.nativeNameConvertorInstance.convert(entry) } /** @deprecated @@ -421,7 +421,7 @@ export class PeerLibrary implements LibraryInterface { const data: Array<[string, {id: number, name: string}[]]> = this.allTypes(idl.isUnionType) .map(it => [ - this.nativeNameConvertorInstance.convertType(it), + this.nativeNameConvertorInstance.convert(it), it.types.map((e, index) => { return {id: index, name: "value" + index }})]) return new Map(data) } @@ -430,7 +430,7 @@ export class PeerLibrary implements LibraryInterface { const data: Array<[string, string[]]> = this.allEntries(idl.isAnonymousInterface) .map(it => [ - this.nativeNameConvertorInstance.convertEntry(it), + this.nativeNameConvertorInstance.convert(it), it.properties.map(p => p.name)]) return new Map(data) } @@ -439,8 +439,8 @@ export class PeerLibrary implements LibraryInterface { const data = this._orderedDependencies .filter(it => it !== idl.IDLVoidType) .map(it => idl.isType(it) - ? this.nativeNameConvertorInstance.convertType(idl.createOptionalType(it)) - : PrimitiveType.OptionalPrefix + cleanPrefix(this.nativeNameConvertorInstance.convertEntry(it as idl.IDLEntry), PrimitiveType.Prefix) + ? this.nativeNameConvertorInstance.convert(idl.createOptionalType(it)) + : PrimitiveType.OptionalPrefix + cleanPrefix(this.nativeNameConvertorInstance.convert(it), PrimitiveType.Prefix) ) return new Set(data) } diff --git a/src/peer-generation/PeerMethod.ts b/src/peer-generation/PeerMethod.ts index 272e6cd5..0ff60787 100644 --- a/src/peer-generation/PeerMethod.ts +++ b/src/peer-generation/PeerMethod.ts @@ -81,7 +81,7 @@ export class PeerMethod { generateAPIParameters(converter:IdlNameConvertor): string[] { const args = this.argConvertors.map(it => { let isPointer = it.isPointerType() - return `${isPointer ? "const ": ""}${converter.convertType(it.nativeType())}${isPointer ? "*": ""} ${it.param}` + return `${isPointer ? "const ": ""}${converter.convert(it.nativeType())}${isPointer ? "*": ""} ${it.param}` }) const receiver = this.generateReceiver() if (receiver) return [`${receiver.argType} ${receiver.argName}`, ...args] diff --git a/src/peer-generation/ReferenceResolver.ts b/src/peer-generation/ReferenceResolver.ts index bc6076ef..354c48db 100644 --- a/src/peer-generation/ReferenceResolver.ts +++ b/src/peer-generation/ReferenceResolver.ts @@ -18,7 +18,7 @@ import { PeerLibrary } from "./PeerLibrary"; export interface ReferenceResolver { resolveTypeReference(type: idl.IDLReferenceType, entries?: idl.IDLEntry[]): idl.IDLEntry | undefined - toDeclaration(type: idl.IDLType | idl.IDLCallback): idl.IDLNode + toDeclaration(type: idl.IDLNode): idl.IDLNode } export function createEmptyReferenceResolver(): ReferenceResolver { diff --git a/src/peer-generation/idl/DependencySorter.ts b/src/peer-generation/idl/DependencySorter.ts index 5e4f0219..666b03db 100644 --- a/src/peer-generation/idl/DependencySorter.ts +++ b/src/peer-generation/idl/DependencySorter.ts @@ -14,12 +14,11 @@ */ import * as idl from "../../idl"; -import { convert } from "./common"; -import { DeclarationDependenciesCollector, TypeDependenciesCollector } from "./IdlDependenciesCollector"; -import { PeerLibrary } from "../PeerLibrary" +import { PeerLibrary } from "../PeerLibrary"; import { collectProperties } from "../printers/StructPrinter"; +import { DependenciesCollector } from "./IdlDependenciesCollector"; -class TypeDependencies extends TypeDependenciesCollector { +class SorterDependenciesCollector extends DependenciesCollector { constructor(library: PeerLibrary) { super(library) } @@ -44,12 +43,6 @@ class TypeDependencies extends TypeDependenciesCollector { convertPrimitiveType(type: idl.IDLPrimitiveType): idl.IDLNode[] { return [] } -} - -class DeclDependencies extends DeclarationDependenciesCollector { - constructor (private library: PeerLibrary, private typeDependencies: TypeDependencies) { - super(typeDependencies) - } convertInterface(node: idl.IDLInterface): idl.IDLNode[] { return collectProperties(node, this.library).map(it => this.library.toDeclaration(it.type)) } @@ -65,14 +58,12 @@ class DeclDependencies extends DeclarationDependenciesCollector { } export class DependencySorter { - typeConvertor: TypeDependenciesCollector - declConvertor: DeclarationDependenciesCollector + dependenciesCollector: SorterDependenciesCollector dependencies = new Set() adjMap = new Map() constructor(private library: PeerLibrary) { - this.typeConvertor = new TypeDependencies(library); - this.declConvertor = new DeclDependencies(library, this.typeConvertor) + this.dependenciesCollector = new SorterDependenciesCollector(library); } private fillDependencies(target: idl.IDLNode, seen: Set) { @@ -80,7 +71,7 @@ export class DependencySorter { seen.add(target) // Need to request that declaration. this.dependencies.add(target) - let deps = convert(target, this.typeConvertor, this.declConvertor) + let deps = this.dependenciesCollector.convert(target) deps.forEach(it => this.fillDependencies(it, seen)) // Require structs but do not make dependencies to them from `target` diff --git a/src/peer-generation/idl/IdlDependenciesCollector.ts b/src/peer-generation/idl/IdlDependenciesCollector.ts index 91599329..9cef50fa 100644 --- a/src/peer-generation/idl/IdlDependenciesCollector.ts +++ b/src/peer-generation/idl/IdlDependenciesCollector.ts @@ -14,10 +14,10 @@ */ import * as idl from '../../idl' -import { DeclarationConvertor, TypeConvertor, convertDeclaration, convertType } from "../LanguageWriters/nameConvertor"; +import { NodeConvertor, convertNode, convertType } from "../LanguageWriters/nameConvertor"; import { LibraryInterface } from '../../LibraryInterface'; -export class TypeDependenciesCollector implements TypeConvertor { +export class DependenciesCollector implements NodeConvertor { constructor(protected readonly library: LibraryInterface) {} convertOptional(type: idl.IDLOptionalType): idl.IDLNode[] { @@ -47,15 +47,6 @@ export class TypeDependenciesCollector implements TypeConvertor { convertPrimitiveType(type: idl.IDLPrimitiveType): idl.IDLNode[] { return [] } - convert(node: idl.IDLType | undefined): idl.IDLNode[] { - return node ? convertType(this, node) : [] - } -} - -export class DeclarationDependenciesCollector implements DeclarationConvertor { - constructor( - private readonly typeDepsCollector: TypeDependenciesCollector, - ) {} convertInterface(decl: idl.IDLInterface): idl.IDLNode[] { return [ ...decl.inheritance @@ -63,35 +54,35 @@ export class DeclarationDependenciesCollector implements DeclarationConvertor this.convertSupertype(it)), ...decl.properties .filter(it => !it.isStatic) - .flatMap(it => this.typeDepsCollector.convert(it.type)), + .flatMap(it => this.convert(it.type)), ...[...decl.constructors, ...decl.callables, ...decl.methods] .flatMap(it => [ - ...it.parameters.flatMap(param => this.typeDepsCollector.convert(param.type)), - ...this.typeDepsCollector.convert(it.returnType) + ...it.parameters.flatMap(param => this.convert(param.type)), + ...this.convert(it.returnType) ]) ] } protected convertSupertype(type: idl.IDLType | idl.IDLInterface): idl.IDLNode[] { if (idl.isInterface(type)) { - return this.typeDepsCollector.convert(idl.createReferenceType(type.name)) + return this.convert(idl.createReferenceType(type.name)) } - return this.typeDepsCollector.convert(type) + return this.convert(type) } convertEnum(decl: idl.IDLEnum): idl.IDLNode[] { return [] } convertTypedef(decl: idl.IDLTypedef): idl.IDLNode[] { - return convertType(this.typeDepsCollector, decl.type) + return this.convert(decl.type) } convertCallback(decl: idl.IDLCallback): idl.IDLNode[] { return [ - ...decl.parameters.flatMap(it => convertType(this.typeDepsCollector, it.type!)), - ...convertType(this.typeDepsCollector, decl.returnType), + ...decl.parameters.flatMap(it => this.convert(it.type!)), + ...this.convert(decl.returnType), ] } - convert(node: idl.IDLEntry | undefined): idl.IDLNode[] { + convert(node: idl.IDLNode | undefined): idl.IDLNode[] { if (node === undefined) return [] - return convertDeclaration(this, node) + return convertNode(this, node) } } diff --git a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts index eed77952..f816c8a4 100644 --- a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts +++ b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts @@ -34,7 +34,6 @@ import { PeerLibrary } from "../PeerLibrary" import { MaterializedClass, MaterializedField, MaterializedMethod, SuperElement } from "../Materialized" import { Field, FieldModifier, Method, MethodModifier, NamedMethodSignature } from "../LanguageWriters"; import { convertDeclaration } from "../LanguageWriters/nameConvertor"; -import { DeclarationDependenciesCollector, TypeDependenciesCollector } from "./IdlDependenciesCollector"; import { isSyntheticDeclaration, makeSyntheticDeclCompletely, @@ -47,12 +46,12 @@ import { ImportFeature } from "../ImportsCollector"; import { createFeatureNameConvertor, DeclarationNameConvertor } from "./IdlNameConvertor"; import { PrimitiveType } from "../ArkPrimitiveType" import { collapseIdlEventsOverloads } from "../printers/EventsPrinter" -import { convert } from "./common" import { collectCJImportsForDeclaration } from "../printers/lang/CJIdlUtils" import { ARK_CUSTOM_OBJECT, javaCustomTypeMapping } from "../printers/lang/Java" import { Language } from "../../Language" import { createInterfaceDeclName } from "../TypeNodeNameConvertor"; import { cjCustomTypeMapping } from "../printers/lang/Cangjie" +import { DependenciesCollector } from "./IdlDependenciesCollector" /** * Theory of operations. @@ -227,16 +226,12 @@ function mapCInteropRetType(type: idl.IDLType): string { } -class ImportsAggregateCollector extends TypeDependenciesCollector { - // TODO: dirty hack, need to rework - private readonly declarationCollector: FilteredDeclarationCollector - +class ImportsAggregateCollector extends DependenciesCollector { constructor( protected readonly peerLibrary: PeerLibrary, - private readonly expandAliases: boolean, + protected readonly expandAliases: boolean, ) { super(peerLibrary) - this.declarationCollector = new FilteredDeclarationCollector(peerLibrary, this) } override convertImport(type: idl.IDLReferenceType, importClause: string): idl.IDLNode[] { @@ -262,7 +257,7 @@ class ImportsAggregateCollector extends TypeDependenciesCollector { // such declarations are not processed by FilteredDeclarationCollector result.push( ...syntheticDeclarations.filter(it => idl.isAnonymousInterface(it)), - ...syntheticDeclarations.flatMap(decl => convert(decl, this, this.declarationCollector)) + ...syntheticDeclarations.flatMap(decl => this.convert(decl)) ) for (const decl of realDeclarations) { @@ -274,14 +269,7 @@ class ImportsAggregateCollector extends TypeDependenciesCollector { } } -export class FilteredDeclarationCollector extends DeclarationDependenciesCollector { - constructor( - private readonly library: PeerLibrary, - typeDepsCollector: TypeDependenciesCollector, - ) { - super(typeDepsCollector) - } - +class TSDependenciesCollector extends ImportsAggregateCollector { protected override convertSupertype(type: idl.IDLType): idl.IDLNode[] { if (idl.isReferenceType(type)) { const decl = this.library.resolveTypeReference(type) @@ -294,6 +282,10 @@ export class FilteredDeclarationCollector extends DeclarationDependenciesCollect } class ArkTSImportsAggregateCollector extends ImportsAggregateCollector { + constructor(peerLibrary: PeerLibrary) { + super(peerLibrary, true) + } + override convertContainer(type: idl.IDLContainerType): idl.IDLNode[] { if (idl.IDLContainerUtils.isSequence(type)) { // todo: check this.peerLibrary instanceof IdlPeerLibrary) @@ -313,17 +305,14 @@ class ArkTSImportsAggregateCollector extends ImportsAggregateCollector { } } -class ArkTSDeclarationCollector extends DeclarationDependenciesCollector { -} - //////////////////////////////////////////////////////////////// // JAVA // //////////////////////////////////////////////////////////////// -class JavaTypeDependenciesCollector extends TypeDependenciesCollector { +class JavaDependenciesCollector extends DependenciesCollector { constructor( - protected readonly library: PeerLibrary, - private readonly expandAliases: boolean, + library: PeerLibrary, + private expandAliases: boolean, ) { super(library) } @@ -418,15 +407,6 @@ class JavaTypeDependenciesCollector extends TypeDependenciesCollector { return decl.properties.flatMap(it => this.convert(it.type)) } -} - -class JavaDeclarationCollector extends DeclarationDependenciesCollector { - constructor( - private readonly library: PeerLibrary, - typeDepsCollector: TypeDependenciesCollector, - ) { - super(typeDepsCollector) - } convertInterface(decl: idl.IDLInterface): idl.IDLNode[] { return super.convertInterface(decl) @@ -458,12 +438,12 @@ class JavaDeclarationCollector extends DeclarationDependenciesCollector { // CANGJIE // //////////////////////////////////////////////////////////////// -class CJDeclarationCollector extends DeclarationDependenciesCollector { +class CJDependenciesCollector extends DependenciesCollector { constructor( - private readonly library: PeerLibrary, - typeDepsCollector: TypeDependenciesCollector, + library: PeerLibrary, + private readonly expandAliases: boolean, ) { - super(typeDepsCollector) + super(library) } convertInterface(decl: idl.IDLInterface): idl.IDLNode[] { @@ -490,15 +470,6 @@ class CJDeclarationCollector extends DeclarationDependenciesCollector { } throw new Error(`Expected reference type, got ${type.kind} ${idl.DebugUtils.debugPrintType(type)}`) } -} - -class CJTypeDependenciesCollector extends TypeDependenciesCollector { - constructor( - protected readonly library: PeerLibrary, - private readonly expandAliases: boolean, - ) { - super(library) - } private ignoredTypes: Set = new Set() @@ -823,17 +794,15 @@ class PeersGenerator { } export class IdlPeerProcessor { - private readonly typeDependenciesCollector: TypeDependenciesCollector - private readonly declDependenciesCollector: DeclarationDependenciesCollector - private readonly serializeDepsCollector: DeclarationDependenciesCollector + private readonly dependenciesCollector: DependenciesCollector + private readonly serializeDepsCollector: DependenciesCollector private readonly dependencyFilter: DependencyFilter constructor( private readonly library: PeerLibrary, ) { - this.typeDependenciesCollector = createTypeDependenciesCollector(this.library) - this.declDependenciesCollector = createDeclDependenciesCollector(this.library, this.typeDependenciesCollector) - this.serializeDepsCollector = createSerializeDeclDependenciesCollector(this.library) + this.dependenciesCollector = createDependenciesCollector(this.library) + this.serializeDepsCollector = createDependenciesCollector(library, true) this.dependencyFilter = createDependencyFilter(this.library) } @@ -932,7 +901,7 @@ export class IdlPeerProcessor { }), } as idl.IDLInterface, this.library, - this.declDependenciesCollector, + this.dependenciesCollector, 'SyntheticDeclarations' ))) } @@ -1040,7 +1009,7 @@ export class IdlPeerProcessor { } private collectDepsRecursive(decl: idl.IDLNode, deps: Set): void { - const currentDeps = convert(decl, this.typeDependenciesCollector, this.declDependenciesCollector) + const currentDeps = this.dependenciesCollector.convert(decl) for (const dep of currentDeps) { if (deps.has(dep)) continue if (idl.isEntry(dep) && !isSourceDecl(dep)) continue @@ -1125,7 +1094,7 @@ export class IdlPeerProcessor { continue } - this.declDependenciesCollector.convert(dep).forEach(it => { + this.dependenciesCollector.convert(dep).forEach(it => { // Add a type that is not in the file declaration list if (Array.from(file.declarations.values()).find(decl => decl.name === idl.forceAsNamedNode(it).name) === undefined && idl.isEntry(it) @@ -1188,40 +1157,15 @@ export function convertDeclToFeature(library: PeerLibrary, node: idl.IDLNode): I } } -export function createTypeDependenciesCollector(library: PeerLibrary): TypeDependenciesCollector { - switch (library.language) { - case Language.TS: return new ImportsAggregateCollector(library, false) - case Language.ARKTS: return new ArkTSImportsAggregateCollector(library, true) - case Language.JAVA: return new JavaTypeDependenciesCollector(library, true) - case Language.CJ: return new CJTypeDependenciesCollector(library, true) - } - // TODO: support other languages - return new ImportsAggregateCollector(library, false) -} - -export function createDeclDependenciesCollector(library: PeerLibrary, - typeDependenciesCollector: TypeDependenciesCollector -): DeclarationDependenciesCollector { - switch (library.language) { - case Language.TS: return new FilteredDeclarationCollector(library, typeDependenciesCollector) - case Language.ARKTS: return new ArkTSDeclarationCollector(typeDependenciesCollector) - case Language.JAVA: return new JavaDeclarationCollector(library, typeDependenciesCollector) - case Language.CJ: return new CJDeclarationCollector(library, typeDependenciesCollector) - } - // TODO: support other languages - return new FilteredDeclarationCollector(library, typeDependenciesCollector) -} - -function createSerializeDeclDependenciesCollector(library: PeerLibrary): DeclarationDependenciesCollector { - const expandAliases = true +export function createDependenciesCollector(library: PeerLibrary, forceExpandAliaces: boolean = false): DependenciesCollector { switch (library.language) { - case Language.TS: return new FilteredDeclarationCollector(library, new ImportsAggregateCollector(library, expandAliases)) - case Language.ARKTS: return new ArkTSDeclarationCollector(new ArkTSImportsAggregateCollector(library, expandAliases)) - case Language.JAVA: return new JavaDeclarationCollector(library, new JavaTypeDependenciesCollector(library, expandAliases)) - case Language.CJ: return new CJDeclarationCollector(library, new CJTypeDependenciesCollector(library, expandAliases)) + case Language.TS: return new TSDependenciesCollector(library, forceExpandAliaces || false) + case Language.ARKTS: return new ArkTSImportsAggregateCollector(library) + case Language.JAVA: return new JavaDependenciesCollector(library, true) + case Language.CJ: return new CJDependenciesCollector(library, true) } // TODO: support other languages - return new FilteredDeclarationCollector(library, new ImportsAggregateCollector(library, expandAliases)) + return new ImportsAggregateCollector(library, forceExpandAliaces || false) } export function createDependencyFilter(library: PeerLibrary): DependencyFilter { diff --git a/src/peer-generation/idl/IdlSyntheticDeclarations.ts b/src/peer-generation/idl/IdlSyntheticDeclarations.ts index 458977d8..1e07466d 100644 --- a/src/peer-generation/idl/IdlSyntheticDeclarations.ts +++ b/src/peer-generation/idl/IdlSyntheticDeclarations.ts @@ -15,7 +15,7 @@ import { ImportFeature } from '../ImportsCollector' import * as idl from '../../idl'; import { convertDeclToFeature, isSourceDecl } from "./IdlPeerGeneratorVisitor"; -import { DeclarationDependenciesCollector } from "./IdlDependenciesCollector"; +import { DependenciesCollector } from "./IdlDependenciesCollector"; import { PeerLibrary } from "../PeerLibrary" const syntheticDeclarations: Map = new Map() @@ -23,7 +23,7 @@ const syntheticDeclarations: Map newDecl); // Collect dependencies types diff --git a/src/peer-generation/idl/common.ts b/src/peer-generation/idl/common.ts index d010880a..93ca7413 100644 --- a/src/peer-generation/idl/common.ts +++ b/src/peer-generation/idl/common.ts @@ -15,13 +15,6 @@ import * as idl from "../../idl" import { Language } from "../../Language" -import { convertDeclaration, convertType, DeclarationConvertor, TypeConvertor } from "../LanguageWriters/nameConvertor" - -export function convert(node: idl.IDLNode, typeConvertor: TypeConvertor, declConvertor: DeclarationConvertor): T { - return idl.isEntry(node) - ? convertDeclaration(declConvertor, node) - : convertType(typeConvertor, node as idl.IDLType) -} export function isImport(decl: idl.IDLNode): boolean { return idl.hasExtAttribute(decl, idl.IDLExtendedAttributes.Import) diff --git a/src/peer-generation/printers/BridgeCcPrinter.ts b/src/peer-generation/printers/BridgeCcPrinter.ts index 6ea667cf..6e983296 100644 --- a/src/peer-generation/printers/BridgeCcPrinter.ts +++ b/src/peer-generation/printers/BridgeCcPrinter.ts @@ -46,7 +46,7 @@ class BridgeCcVisitor { // TODO: may be this is another method of ArgConvertor? private generateApiArgument(argConvertor: ArgConvertor): string { const nameConverter = createTypeNameConvertor(Language.CPP, getReferenceResolver(this.library)) - const prefix = argConvertor.isPointerType() ? `(const ${nameConverter.convertType(argConvertor.nativeType())}*)&`: " " + const prefix = argConvertor.isPointerType() ? `(const ${nameConverter.convert(argConvertor.nativeType())}*)&`: " " if (argConvertor.useArray) return `${prefix}${this.escapeKeyword(argConvertor.param)}_value` else diff --git a/src/peer-generation/printers/ConflictedDeclarationsPrinter.ts b/src/peer-generation/printers/ConflictedDeclarationsPrinter.ts index 9a141067..f8d4f05a 100644 --- a/src/peer-generation/printers/ConflictedDeclarationsPrinter.ts +++ b/src/peer-generation/printers/ConflictedDeclarationsPrinter.ts @@ -21,8 +21,7 @@ import { Language } from "../../Language"; import { ArkTSDeclConvertor, getCommonImports } from "./InterfacePrinter"; import { convertDeclToFeature, - createDeclDependenciesCollector, - createTypeDependenciesCollector, + createDependenciesCollector, } from "../idl/IdlPeerGeneratorVisitor"; import { ImportsCollector } from "../ImportsCollector"; import { DeclarationNameConvertor } from "../idl/IdlNameConvertor"; @@ -64,12 +63,11 @@ class ArkTSConflictedDeclarationsVisitor extends ConflictedDeclarationsVisitor { } print() { - const typeDependenciesCollector = createTypeDependenciesCollector(this.library) - const declDependenciesCollector = createDeclDependenciesCollector(this.library, typeDependenciesCollector) + const dependenciesCollector = createDependenciesCollector(this.library) const importsCollector = new ImportsCollector() getCommonImports(this.library.language).forEach(it => importsCollector.addFeature(it.feature, it.module)) this.library.conflictedDeclarations.forEach(it => { - declDependenciesCollector.convert(it).forEach(it => { + dependenciesCollector.convert(it).forEach(it => { const dep = convertDeclToFeature(this.library, it) importsCollector.addFeature(dep.feature, dep.module) }) diff --git a/src/peer-generation/printers/HeaderPrinter.ts b/src/peer-generation/printers/HeaderPrinter.ts index b92f01f6..f767a377 100644 --- a/src/peer-generation/printers/HeaderPrinter.ts +++ b/src/peer-generation/printers/HeaderPrinter.ts @@ -106,7 +106,7 @@ class HeaderVisitor { for (const callback of callbacks) { const args = ["Ark_Int32 nodeId",///same code in EventsPrinter ...callback.args.map(it => - `const ${nameConvertor.convertType(maybeOptional(library.typeConvertor(it.name, it.type, it.nullable).nativeType(), it.nullable))} ${it.name}`)] + `const ${nameConvertor.convert(maybeOptional(library.typeConvertor(it.name, it.type, it.nullable).nativeType(), it.nullable))} ${it.name}`)] printMethodDeclaration(this.api, "void", `(*${callback.methodName})`, args, `;`) } this.api.popIndent() diff --git a/src/peer-generation/printers/StructPrinter.ts b/src/peer-generation/printers/StructPrinter.ts index d4c939d4..795c7dc3 100644 --- a/src/peer-generation/printers/StructPrinter.ts +++ b/src/peer-generation/printers/StructPrinter.ts @@ -27,6 +27,7 @@ import { generateCallbackAPIArguments } from "../ArgConvertors" import { isBuilderClass, isMaterialized } from "../idl/IdlPeerGeneratorVisitor" import { cleanPrefix, PeerLibrary } from "../PeerLibrary" import { MethodArgPrintHint } from "../LanguageWriters/LanguageWriter" +import { LibraryInterface } from "../../LibraryInterface" export class StructPrinter { constructor(private library: PeerLibrary) {} @@ -463,7 +464,7 @@ inline void WriteToString(std::string* result, const ${name}* value) { } } -export function collectProperties(decl: idl.IDLInterface, library: PeerLibrary): idl.IDLProperty[] { +export function collectProperties(decl: idl.IDLInterface, library: LibraryInterface): idl.IDLProperty[] { const superType = idl.getSuperType(decl) const superDecl = superType ? library.resolveTypeReference(/* FIX */ superType as idl.IDLReferenceType) : undefined return [ @@ -494,7 +495,7 @@ function groupProps(properties: NameWithType[]): NameWithType[] { return result } -function collectBuilderProperties(decl: idl.IDLInterface, library: PeerLibrary): idl.IDLProperty[] { +function collectBuilderProperties(decl: idl.IDLInterface, library: LibraryInterface): idl.IDLProperty[] { if (!isBuilderClass(decl)) { return [] } diff --git a/src/peer-generation/printers/TypeCheckPrinter.ts b/src/peer-generation/printers/TypeCheckPrinter.ts index 86146e57..3f06cae9 100644 --- a/src/peer-generation/printers/TypeCheckPrinter.ts +++ b/src/peer-generation/printers/TypeCheckPrinter.ts @@ -12,8 +12,8 @@ import { import { throwException } from "../../util"; import { PeerLibrary } from "../PeerLibrary"; import { - convertDeclToFeature, createDeclDependenciesCollector, - createTypeDependenciesCollector, + convertDeclToFeature, + createDependenciesCollector, isBuilderClass, isMaterialized, } from "../idl/IdlPeerGeneratorVisitor"; @@ -115,8 +115,7 @@ abstract class TypeCheckerPrinter { const importFeatures: ImportFeature[] = [] const interfaces: { name: string, type?: idl.IDLType, descriptor: StructDescriptor }[] = [] const seenNames = new Set() - const declDependenciesCollector - = createDeclDependenciesCollector(this.library, createTypeDependenciesCollector(this.library)) + const declDependenciesCollector = createDependenciesCollector(this.library) const declNameConvertor = createDeclarationNameConvertor(this.library.language) for (const file of this.library.files) { diff --git a/src/skoala-generation/idl/idlSkoalaLibrary.ts b/src/skoala-generation/idl/idlSkoalaLibrary.ts index 8ea09eee..55290dcc 100644 --- a/src/skoala-generation/idl/idlSkoalaLibrary.ts +++ b/src/skoala-generation/idl/idlSkoalaLibrary.ts @@ -15,9 +15,8 @@ import * as idl from "../../idl" import { posix as path } from "path" -import { convert, isImport, isStringEnum } from '../../peer-generation/idl/common'; +import { isImport, isStringEnum } from '../../peer-generation/idl/common'; import { DeclarationNameConvertor } from "../../peer-generation/idl/IdlNameConvertor" -import { DeclarationDependenciesCollector, TypeDependenciesCollector } from '../../peer-generation/idl/IdlDependenciesCollector'; import { ImportsCollector } from "../../peer-generation/ImportsCollector"; import { capitalize, isDefined, throwException } from "../../util"; import { PrimitiveType } from "../../peer-generation/ArkPrimitiveType"; @@ -33,6 +32,8 @@ import { convertDeclaration, convertType, DeclarationConvertor, IdlNameConvertor import { LibraryInterface } from "../../LibraryInterface"; import { generateSyntheticFunctionName } from "../../IDLVisitor"; import { IDLNodeToStringConvertor } from "../../peer-generation/LanguageWriters/convertors/InteropConvertor"; +import { IdlEntryManager } from "../../peer-generation/idl/IdlEntryManager"; +import { DependenciesCollector } from "../../peer-generation/idl/IdlDependenciesCollector"; export class IldSkoalaFile { readonly wrapperClasses: Map = new Map() @@ -76,6 +77,14 @@ export class IdlSkoalaLibrary implements LibraryInterface { return "" } + get factory(): IdlEntryManager { + throw new Error("Method not implemented."); + } + + isComponentDeclaration(iface: idl.IDLInterface): boolean { + throw new Error("Method not implemented."); + } + requestType(type: idl.IDLType, useToGenerate: boolean) { let declaration = this.typeMap.get(type) if (declaration) { @@ -283,10 +292,7 @@ export class IdlWrapperClassConvertor extends BaseArgConvertor { export const CustomObject: idl.IDLPrimitiveType = idl.IDLCustomObjectType export const Function: idl.IDLPrimitiveType = idl.IDLFunctionType -class ImportsAggregateCollector extends TypeDependenciesCollector { - // TODO: dirty hack, need to rework - private readonly declarationCollector = new DeclarationDependenciesCollector(this) - +class ImportsAggregateCollector extends DependenciesCollector { constructor( protected readonly peerLibrary: IdlSkoalaLibrary, private readonly expandAliases: boolean, @@ -302,7 +308,7 @@ class ImportsAggregateCollector extends TypeDependenciesCollector { const result = [...realDeclarations] // process synthetic declarations dependencies - result.push(...syntheticDeclarations.flatMap(decl => convert(decl, this, this.declarationCollector))) + result.push(...syntheticDeclarations.flatMap(decl => this.convert(decl))) for (const decl of realDeclarations) { // expand type aliaces because we have serialization inside peers methods @@ -314,18 +320,16 @@ class ImportsAggregateCollector extends TypeDependenciesCollector { } export class IdlWrapperProcessor { - private readonly typeDependenciesCollector: TypeDependenciesCollector - private readonly declDependenciesCollector: DeclarationDependenciesCollector + private readonly dependenciesCollector: DependenciesCollector constructor( public library: IdlSkoalaLibrary ) { - this.typeDependenciesCollector = new ImportsAggregateCollector(library, false) - this.declDependenciesCollector = new DeclarationDependenciesCollector(this.typeDependenciesCollector) + this.dependenciesCollector = new ImportsAggregateCollector(library, false) } private collectDepsRecursive(decl: idl.IDLNode, deps: Set): void { - const currentDeps = convert(decl, this.typeDependenciesCollector, this.declDependenciesCollector) + const currentDeps = this.dependenciesCollector.convert(decl) for (const dep of currentDeps) { if (deps.has(dep)) continue if (idl.isEntry(dep) && !isSourceDecl(dep)) continue @@ -378,7 +382,7 @@ export class IdlWrapperProcessor { } // process serializer dependency - let serDependencies = this.declDependenciesCollector.convert(decl) + let serDependencies = this.dependenciesCollector.convert(decl) .filter(it => idl.isEntry(it) && isSourceDecl(it)) serDependencies.forEach(it => { -- Gitee From c21d3f3b59b0ac3e5264807238d5752d3dadc70d Mon Sep 17 00:00:00 2001 From: grebelnikmikhail Date: Mon, 18 Nov 2024 14:07:00 +0000 Subject: [PATCH 28/53] !932 Arkts IDL Deserializer --- .../src/generated/peers/DeserializerBase.ts | 242 ++++++++++++++++++ peer_lib/sig/arkoala/arkui/src/main.ts | 4 +- src/peer-generation/ArgConvertors.ts | 42 ++- src/peer-generation/FileGenerators.ts | 25 +- .../LanguageWriters/LanguageWriter.ts | 4 +- .../writers/CJLanguageWriter.ts | 2 +- .../writers/CppLanguageWriter.ts | 2 +- .../writers/ETSLanguageWriter.ts | 40 ++- .../writers/JavaLanguageWriter.ts | 4 +- .../writers/TsLanguageWriter.ts | 10 +- src/peer-generation/arkoala.ts | 11 + .../printers/InterfacePrinter.ts | 16 +- .../printers/SerializerPrinter.ts | 37 ++- 13 files changed, 390 insertions(+), 49 deletions(-) create mode 100644 peer_lib/sig/arkoala-arkts/arkui/src/generated/peers/DeserializerBase.ts diff --git a/peer_lib/sig/arkoala-arkts/arkui/src/generated/peers/DeserializerBase.ts b/peer_lib/sig/arkoala-arkts/arkui/src/generated/peers/DeserializerBase.ts new file mode 100644 index 00000000..60169695 --- /dev/null +++ b/peer_lib/sig/arkoala-arkts/arkui/src/generated/peers/DeserializerBase.ts @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2024 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 {CustomTextDecoder, float32, int32} from "@koalaui/common" +import {pointer} from "@koalaui/interop" +import {RuntimeType, Tags, CallbackResource} from "./SerializerBase"; +import { Length } from "../ArkUnitsInterfaces" +import { Resource } from "../ArkResourceInterfaces" + +export class DeserializerBase { + private position = 0 + private readonly buffer: ArrayBuffer + private readonly length: int32 + private view: DataView + private static textDecoder: CustomTextDecoder = new CustomTextDecoder() + private static customDeserializers: CustomDeserializer | undefined = undefined + + static registerCustomDeserializer(deserializer: CustomDeserializer) { + let current = DeserializerBase.customDeserializers + if (current == undefined) { + DeserializerBase.customDeserializers = deserializer + } else { + while (current!.next != undefined) { + current = current!.next + } + current!.next = deserializer + } + } + + constructor(buffer: ArrayBuffer, length: int32) { + this.buffer = buffer + this.length = length + this.view = new DataView(this.buffer) + } + + static get( + factory: (args: Uint8Array, length: int32) => T, + args: Uint8Array, length: int32): T { + + // TBD: Use cache + return factory(args, length); + } + + asArray(position?: number, length?: number): Uint8Array { + return new Uint8Array(this.buffer, position, length) + } + + currentPosition(): int32 { + return this.position + } + + resetCurrentPosition(): void { + this.position = 0 + } + + private checkCapacity(value: int32) { + if (value > this.length) { + throw new Error(`${value} is less than remaining buffer length`) + } + } + + readInt8(): int32 { + this.checkCapacity(1) + const value = this.view.getInt8(this.position) + this.position += 1 + return value + } + + readInt32(): int32 { + this.checkCapacity(4) + const value = this.view.getInt32(this.position, true) + this.position += 4 + return value + } + + readPointer(): pointer { + this.checkCapacity(8) + const value = this.view.getBigInt64(this.position, true) + this.position += 8 + return value + } + + readFloat32(): float32 { + this.checkCapacity(4) + const value = this.view.getFloat32(this.position, true) + this.position += 4 + return value + } + + readBoolean(): boolean { + this.checkCapacity(1) + const value = this.view.getInt8(this.position) + this.position += 1 + return value == 1 + } + + readFunction(): int32 { + // TODO: not exactly correct. + const id = this.readInt32() + return id + } + + // readMaterialized(): object { + // const ptr = this.readPointer() + // return { ptr: ptr } + // } + + readCallbackResource(): CallbackResource { + return ({ + resourceId: this.readInt32(), + hold: this.readPointer(), + release: this.readPointer(), + } as CallbackResource) + } + + readString(): string { + const length = this.readInt32() + this.checkCapacity(length) + // read without null-terminated byte + const value = DeserializerBase.textDecoder.decode(this.asArray(this.position, length - 1)); + this.position += length + return value + } + + readCustomObject(kind: string): object { + let current = DeserializerBase.customDeserializers + while (current) { + if (current!.supports(kind)) { + return current!.deserialize(this, kind) + } + current = current!.next + } + // consume tag + const tag = this.readInt8() + throw Error(`${kind} is not supported`) + } + + readNumber(): number | undefined { + const tag = this.readInt8() + if (tag == Tags.UNDEFINED) { + return undefined + } else if (tag == Tags.INT32) { + return this.readInt32() + } else if (tag == Tags.FLOAT32) { + return this.readFloat32() + } else { + throw new Error(`Unknown number tag: ${tag}`) + } + } + + readLength(): Length | undefined { + this.checkCapacity(1) + const valueType = this.readInt8() + if (valueType == RuntimeType.OBJECT) { + return ({ + id: this.readInt32(), + bundleName: "", + moduleName: "" + }) as Resource + } else if (valueType == RuntimeType.STRING) { + return (this.readString() as String) + } else if (valueType == RuntimeType.NUMBER) { + return (this.readFloat32() as number) + } else { + return undefined + } + } + + static lengthUnitFromInt(unit: int32): string { + let suffix: string + switch (unit) { + case 0: + suffix = "px" + break + case 1: + suffix = "vp" + break + case 3: + suffix = "%" + break + case 4: + suffix = "lpx" + break + default: + suffix = "" + } + return suffix + } + + readUint8ClampedArray(): Uint8ClampedArray { + throw new Error("Not implemented") + } +} + +export abstract class CustomDeserializer { + protected supported: string + protected constructor(supported_: string) { + this.supported = supported_ + } + + supports(kind: string): boolean { + return this.supported.includes(kind) + } + + abstract deserialize(serializer: DeserializerBase, kind: string): object + + next: CustomDeserializer | undefined = undefined +} + +class OurCustomDeserializer extends CustomDeserializer { + constructor() { + super("PixelMap") + } + deserialize(deserializer: DeserializerBase, kind: string): object { + // return JSON.parse(deserializer.readString()) + return {} + } +} +DeserializerBase.registerCustomDeserializer(new OurCustomDeserializer()) + +class DateDeserializer extends CustomDeserializer { + constructor() { + super("Date") + } + + deserialize(serializer: DeserializerBase, kind: string): Date { + return new Date(serializer.readString()) + } +} +DeserializerBase.registerCustomDeserializer(new DateDeserializer()) diff --git a/peer_lib/sig/arkoala/arkui/src/main.ts b/peer_lib/sig/arkoala/arkui/src/main.ts index 9cad1f9d..5a9002db 100644 --- a/peer_lib/sig/arkoala/arkui/src/main.ts +++ b/peer_lib/sig/arkoala/arkui/src/main.ts @@ -276,10 +276,10 @@ function checkTwoSidesCallback() { } assertEquals("Callback 1 enqueued", "NOT_CALLED", callResult1) - assertEquals(`Callback 2 enqueued ${call2Count} times`, callResult2, 0) + assertEquals(`Callback 2 enqueued ${call2Count} times`, 0, callResult2) checkArkoalaCallbacks() assertEquals("Callback 1 read&called", "CALLED, value=194", callResult1) - assertEquals(`Callback 2 read&called ${call2Count} times`, callResult2, call2Count) + assertEquals(`Callback 2 read&called ${call2Count} times`, call2Count, callResult2) } function checkWriteFunction() { diff --git a/src/peer-generation/ArgConvertors.ts b/src/peer-generation/ArgConvertors.ts index bbb07122..58f19f05 100644 --- a/src/peer-generation/ArgConvertors.ts +++ b/src/peer-generation/ArgConvertors.ts @@ -547,7 +547,7 @@ export class EnumConvertor extends BaseArgConvertor { // constructor(param: string, public enumEntry: idl.IDLEnum, public readonly isStringEnum: boolean) { - super(isStringEnum ? idl.IDLStringType : idl.IDLNumberType, + super(idl.createReferenceType(enumEntry.name), [isStringEnum ? RuntimeType.STRING : RuntimeType.NUMBER], false, false, param) } @@ -555,14 +555,12 @@ export class EnumConvertor extends BaseArgConvertor { // return writer.makeEnumCast(param, false, this) } convertorSerialize(param: string, value: string, printer: LanguageWriter): void { - if (this.isStringEnum) { - value = printer.ordinalFromEnum(printer.makeString(value), this.enumEntry).asString() - } - printer.writeMethodCall(`${param}Serializer`, "writeInt32", [printer.makeEnumCast(value, false, this)]) + value = printer.ordinalFromEnum(printer.makeString(value), idl.createReferenceType(this.enumEntry.name)).asString() + printer.writeMethodCall(`${param}Serializer`, "writeInt32", [value]) } convertorDeserialize(bufferName: string, deserializerName: string, assigneer: ExpressionAssigneer, writer: LanguageWriter): LanguageStatement { const readExpr = writer.makeMethodCall(`${deserializerName}`, "readInt32", []) - const enumExpr = this.isStringEnum && writer.language !== Language.CPP + const enumExpr = writer.language === Language.ARKTS || this.isStringEnum && writer.language !== Language.CPP ? writer.enumFromOrdinal(readExpr, this.enumEntry) : writer.makeCast(readExpr, idl.createReferenceType(this.enumEntry.name)) return assigneer(enumExpr) @@ -620,7 +618,7 @@ export class UnionConvertor extends BaseArgConvertor { // if (!(it instanceof UndefinedConvertor)) { printer.writeStatement( printer.makeAssign(`${value}_${index}`, undefined, - printer.makeUnionVariantCast(it.getObjectAccessor(printer.language, value), it.targetType(printer), it, index), true)) + printer.makeUnionVariantCast(it.getObjectAccessor(printer.language, value), printer.stringifyType(it.idlType), it, index), true)) it.convertorSerialize(param, `${value}_${index}`, printer) } printer.popIndent() @@ -800,9 +798,13 @@ export class AggregateConvertor extends BaseArgConvertor { // convertorSerialize(param: string, value: string, printer: LanguageWriter): void { this.memberConvertors.forEach((it, index) => { let memberName = this.members[index][0] + let memberAccess = `${value}.${memberName}` + if (printer.language === Language.ARKTS && stubIsTypeCallback(this.library, this.decl.properties[index].type)) { + memberAccess = `${memberAccess}!` + } printer.writeStatement( printer.makeAssign(`${value}_${memberName}`, undefined, - printer.makeString(`${value}.${memberName}`), true)) + printer.makeString(memberAccess), true)) it.convertorSerialize(param, `${value}_${memberName}`, printer) }) } @@ -832,6 +834,11 @@ export class AggregateConvertor extends BaseArgConvertor { // statements.push(assigneer(writer.makeString(bufferName))) } else { const resultExpression = this.makeAssigneeExpression(this.decl.properties.map(prop => { + if (writer.language === Language.ARKTS) { + if (stubIsTypeCallback(this.library, prop.type)) { + return [prop.name, writer.makeString('undefined')] + } + } return [prop.name, writer.makeString(`${bufferName}_${prop.name}`)] }), writer) statements.push(assigneer(resultExpression)) @@ -840,7 +847,7 @@ export class AggregateConvertor extends BaseArgConvertor { // } protected makeAssigneeExpression(fields: [string, LanguageExpression][], writer: LanguageWriter): LanguageExpression { const content = fields.map(it => `${it[0]}: ${it[1].asString()}`).join(', ') - return writer.makeString(`{${content}}`) + return writer.makeCast(writer.makeString(`{${content}}`), this.idlType) } nativeType(): idl.IDLType { return idl.createReferenceType(this.decl.name) @@ -1015,7 +1022,7 @@ export class TupleConvertor extends AggregateConvertor { // }) } protected override makeAssigneeExpression(fields: [string, LanguageExpression][], writer: LanguageWriter): LanguageExpression { - return writer.makeString(`[${fields.map(it => it[1].asString()).join(', ')}]`) + return writer.makeCast(writer.makeString(`[${fields.map(it => it[1].asString()).join(', ')}]`), this.idlType) } nativeType(): idl.IDLType { return idl.createReferenceType(this.decl.name) @@ -1330,4 +1337,19 @@ function warnCustomObject(type: string, msg?: string) { console.log(`WARNING: Use CustomObject for ${msg ? `${msg} ` : ``}type ${type}`) customObjects.add(type) } +} + +export function stubIsTypeCallback(resolver: LibraryInterface, type: idl.IDLType): boolean { + // TODO dirty stub, because we can not initialize functional type fields + if (idl.hasExtAttribute(type, idl.IDLExtendedAttributes.Import)) + return false + const refType = idl.isReferenceType(type) ? type : undefined + const decl = refType ? resolver.resolveTypeReference(refType) : undefined + if (decl && idl.isCallback(decl)) { + return true + } + if (decl && idl.isTypedef(decl)) { + return stubIsTypeCallback(resolver, decl.type) + } + return false } \ No newline at end of file diff --git a/src/peer-generation/FileGenerators.ts b/src/peer-generation/FileGenerators.ts index de691b1b..3c9f7edc 100644 --- a/src/peer-generation/FileGenerators.ts +++ b/src/peer-generation/FileGenerators.ts @@ -292,7 +292,7 @@ export function makeTSSerializer(library: PeerLibrary): LanguageWriter { if (printer.language == Language.ARKTS) { imports.addFeatures(["NativeModule"], "#components") imports.addFeatures(["CallbackKind"], "CallbackKind") - imports.addFeatures(['KStringPtr', 'nullptr', 'KInt'], '@koalaui/interop') + imports.addFeatures(['KStringPtr', 'nullptr', 'KInt', 'KPointer'], '@koalaui/interop') } imports.print(printer, '') writeSerializer(library, printer, "") @@ -406,6 +406,29 @@ export function createDeserializer(args: Uint8Array, length: int32): Deserialize ` } +export function makeArkTSDeserializer(library: PeerLibrary): string { + const printer = createLanguageWriter(Language.ARKTS, library) + printer.writeLines(cStyleCopyright) + + const imports = new ImportsCollector() + imports.addFeatures(["runtimeType", "Tags", "RuntimeType", "CallbackResource"], "./SerializerBase") + imports.addFeature("DeserializerBase", "./DeserializerBase") + imports.addFeature("int32", "@koalaui/common") + + imports.addFeature("Serializer", "./Serializer") + imports.addFeatures(["SerializerBase", "Tags", "RuntimeType", "runtimeType", "isResource", "isInstanceOf"], "./SerializerBase") + imports.addFeatures(["NativeModule"], "#components") + imports.addFeatures(["CallbackKind"], "CallbackKind") + imports.addFeatures(['KStringPtr', 'KInt', 'KPointer'], '@koalaui/interop') + + imports.print(printer, '') + + writeDeserializer(library, printer, "") + return ` +${printer.getOutput().join("\n")} +` +} + export function makeApiModifiers(modifiers: string[], accessors: string[], events: string[], nodeTypes: string[]): string { let node_api = readTemplate('arkoala_node_api.h') .replaceAll(`%CPP_PREFIX%`, PeerGeneratorConfig.cppPrefix) diff --git a/src/peer-generation/LanguageWriters/LanguageWriter.ts b/src/peer-generation/LanguageWriters/LanguageWriter.ts index f57a17f6..e4499a46 100644 --- a/src/peer-generation/LanguageWriters/LanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/LanguageWriter.ts @@ -457,7 +457,7 @@ export abstract class LanguageWriter { abstract get supportedModifiers(): MethodModifier[] abstract get supportedFieldModifiers(): FieldModifier[] abstract enumFromOrdinal(value: LanguageExpression, enumEntry: idl.IDLEnum): LanguageExpression - abstract ordinalFromEnum(value: LanguageExpression, enumEntry: idl.IDLEnum): LanguageExpression + abstract ordinalFromEnum(value: LanguageExpression, enumReference: idl.IDLType): LanguageExpression abstract makeEnumCast(enumName: string, unsafe: boolean, convertor: EnumConvertor | undefined): string abstract stringifyType(type: idl.IDLType | idl.IDLCallback): string abstract fork(): LanguageWriter @@ -700,7 +700,7 @@ export abstract class LanguageWriter { const ordinal = convertor.isStringEnum ? this.ordinalFromEnum( this.makeString(this.getObjectAccessor(convertor, value)), - convertor.enumEntry + idl.createReferenceType(convertor.enumEntry.name) ) : this.makeUnionVariantCast(this.getObjectAccessor(convertor, value), this.stringifyType(idl.IDLI32Type), convertor, index) const {low, high} = convertor.extremumOfOrdinals() diff --git a/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts index 41dcad72..8a94b5aa 100644 --- a/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts @@ -421,7 +421,7 @@ export class CJLanguageWriter extends LanguageWriter { enumFromOrdinal(value: LanguageExpression, _: idl.IDLEnum): LanguageExpression { throw new Error('Not yet implemented') } - ordinalFromEnum(value: LanguageExpression, _: idl.IDLEnum): LanguageExpression { + ordinalFromEnum(value: LanguageExpression, _: idl.IDLType): LanguageExpression { return value } makeEnumEntity(enumEntity: idl.IDLEnum, isExport: boolean): LanguageStatement { diff --git a/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts index 8e74e1c9..910ba8c6 100644 --- a/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts @@ -365,7 +365,7 @@ export class CppLanguageWriter extends CLikeLanguageWriter { enumFromOrdinal(value: LanguageExpression, _: IDLEnum): LanguageExpression { return value; } - ordinalFromEnum(value: LanguageExpression, _: IDLEnum): LanguageExpression { + ordinalFromEnum(value: LanguageExpression, _: IDLType): LanguageExpression { return value; } makeUnsafeCast(convertor: ArgConvertor, param: string): string { diff --git a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts index 5771ee8b..e10a7244 100644 --- a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts @@ -19,7 +19,7 @@ import { LanguageExpression, LanguageStatement, LanguageWriter, - Method, + Method, MethodCallExpression, MethodModifier, MethodSignature, NamedMethodSignature, @@ -79,7 +79,7 @@ export class ArkTSEnumEntityStatement implements LanguageStatement { isTypeString &&= (typeof initText !== "number") const ctorArgs = [ isTypeString ? `"${initText}"` : initText, - isTypeString ? index : undefined + index, ].filter(it => it !== undefined) writer.writeFieldDeclaration(member.name, toIDLType(this.enumEntity.name), @@ -98,21 +98,15 @@ export class ArkTSEnumEntityStatement implements LanguageStatement { const typeName = isTypeString ? "string" : "KInt" let argTypes = [toIDLType(typeName)] let argNames = ["value"] - if (isTypeString) { - argTypes.push(toIDLType("KInt")) - argNames.push("ordinal") - } + argTypes.push(toIDLType("KInt")) + argNames.push("ordinal") writer.writeConstructorImplementation(className, new NamedMethodSignature(IDLVoidType, argTypes, argNames), (writer) => { writer.writeStatement(writer.makeAssign("this.value", undefined, writer.makeString("value"), false)) - if (isTypeString) { - writer.writeStatement(writer.makeAssign("this.ordinal", undefined, writer.makeString("ordinal"), false)) - } + writer.writeStatement(writer.makeAssign("this.ordinal", undefined, writer.makeString("ordinal"), false)) }) writer.writeFieldDeclaration("value", toIDLType(typeName), [FieldModifier.PUBLIC, FieldModifier.READONLY], false) - if (isTypeString) { - writer.writeFieldDeclaration("ordinal", IDLI32Type, [FieldModifier.PUBLIC, FieldModifier.READONLY], false) - } + writer.writeFieldDeclaration("ordinal", IDLI32Type, [FieldModifier.PUBLIC, FieldModifier.READONLY], false) writer.writeMethodImplementation(new Method("of", new MethodSignature(toIDLType(this.enumEntity.name), [argTypes[0]]), [MethodModifier.PUBLIC, MethodModifier.STATIC]), (writer)=> { this.enumEntity.elements.forEach((member) => { @@ -125,6 +119,18 @@ export class ArkTSEnumEntityStatement implements LanguageStatement { }) writer.print("throw new Error(`Enum member '$\{arg0\}' not found`)") }) + writer.writeMethodImplementation(new Method("ofOrdinal", new MethodSignature(toIDLType(this.enumEntity.name), [idl.IDLI32Type]), [MethodModifier.PUBLIC, MethodModifier.STATIC]), + (writer)=> { + this.enumEntity.elements.forEach((member) => { + const memberName = `${className}.${member.name}` + writer.writeStatement( + writer.makeCondition( + writer.makeEquals([writer.makeString('arg0'), writer.makeString(`${memberName}.ordinal`)]), + writer.makeReturn(writer.makeString(memberName))) + ) + }) + writer.print("throw new Error(`Enum member '$\{arg0\}' not found`)") + }) }) } } @@ -199,8 +205,14 @@ export class ETSLanguageWriter extends TSLanguageWriter { } return this.makeString(`${value} as ${type}`) } - ordinalFromEnum(value: LanguageExpression, _: IDLEnum): LanguageExpression { - return value; + enumFromOrdinal(value: LanguageExpression, enumEntry: idl.IDLEnum): LanguageExpression { + if (value instanceof MethodCallExpression) { + return this.makeString(`${enumEntry.name}.ofOrdinal(${value.asString()})`) + } + return this.makeString(`Object.values(${enumEntry.name})[${value.asString()}]`); + } + ordinalFromEnum(value: LanguageExpression, _: idl.IDLType): LanguageExpression { + return this.makeString(`${value.asString()}.ordinal`); } makeDiscriminatorFromFields(convertor: {targetType: (writer: LanguageWriter) => string}, value: string, diff --git a/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts index ffc8f09a..63e1911b 100644 --- a/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts @@ -281,8 +281,8 @@ export class JavaLanguageWriter extends CLikeLanguageWriter { enumFromOrdinal(value: LanguageExpression, _: idl.IDLEnum): LanguageExpression { throw new Error("Method not implemented.") } - ordinalFromEnum(value: LanguageExpression, _: idl.IDLEnum): LanguageExpression { - throw new Error("Method not implemented.") + ordinalFromEnum(value: LanguageExpression, _: idl.IDLType): LanguageExpression { + return this.makeString(`${value.asString()}.value`) } makeValueFromOption(value: string): LanguageExpression { return this.makeString(`${value}`) diff --git a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts index 68c61109..41b9a320 100644 --- a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts @@ -41,6 +41,7 @@ import { ArgConvertor, EnumConvertor, RuntimeType } from "../../ArgConvertors" import { ReferenceResolver } from "../../ReferenceResolver" import { convertType, IdlNameConvertor, TypeConvertor } from "../nameConvertor" import { TsIDLNodeToStringConverter } from "../convertors/TSConvertors" +import { isStringEnum } from "../../idl/common" //////////////////////////////////////////////////////////////// // EXPRESSIONS // @@ -369,8 +370,13 @@ export class TSLanguageWriter extends LanguageWriter { enumFromOrdinal(value: LanguageExpression, enumEntry: idl.IDLEnum): LanguageExpression { return this.makeString(`Object.values(${enumEntry.name})[${value.asString()}]`); } - ordinalFromEnum(value: LanguageExpression, enumEntry: idl.IDLEnum): LanguageExpression { - return this.makeString(`Object.keys(${enumEntry.name}).indexOf(${this.makeCast(value, idl.IDLStringType).asString()})`); + ordinalFromEnum(value: LanguageExpression, enumEntry: idl.IDLType): LanguageExpression { + const enumName = idl.forceAsNamedNode(enumEntry).name + const decl = idl.isReferenceType(enumEntry) ? this.resolver.resolveTypeReference(enumEntry) : undefined + if (decl && idl.isEnum(decl) && isStringEnum(decl)) { + return this.makeString(`Object.values(${enumName}).indexOf(${value.asString()})`); + } + return value; } override makeEnumCast(enumName: string, unsafe: boolean, convertor: EnumConvertor): string { if (unsafe) { diff --git a/src/peer-generation/arkoala.ts b/src/peer-generation/arkoala.ts index f63c5bea..0537655a 100644 --- a/src/peer-generation/arkoala.ts +++ b/src/peer-generation/arkoala.ts @@ -25,6 +25,7 @@ import { makeArkuiModule, makeCallbacksKinds, makeTSDeserializer, + makeArkTSDeserializer, makeTSSerializer, makeTypeChecker, mesonBuildFile, @@ -144,6 +145,7 @@ function copyArkoalaFiles(config: { 'sig/arkoala-arkts/arkui/src/generated/ts/arkts-stdlib.ts', 'sig/arkoala-arkts/arkui/src/generated/ts/NativeModule.ts', 'sig/arkoala-arkts/arkui/src/generated/peers/SerializerBase.ts', + 'sig/arkoala-arkts/arkui/src/generated/peers/DeserializerBase.ts', 'sig/arkoala-arkts/arkui/src/generated/shared/ArkResource.ts', 'sig/arkoala-arkts/arkui/src/generated/shared/dts-exports.ts', 'sig/arkoala-arkts/arkui/src/generated/shared/generated-utils.ts', @@ -369,6 +371,15 @@ export function generateArkoalaFromIdl(config: { integrated: true, } ) + // waiting for es2panda to fix 20642 issue + // writeFile(arkoala.peer(new TargetFile('Deserializer')), + // makeArkTSDeserializer(peerLibrary), + // { + // onlyIntegrated: config.onlyIntegrated, + // integrated: true, + // message: "producing [idl]" + // } + // ) writeFile(arkoala.arktsLib(new TargetFile('type_check', 'arkts')), makeTypeChecker(peerLibrary).arkts, { diff --git a/src/peer-generation/printers/InterfacePrinter.ts b/src/peer-generation/printers/InterfacePrinter.ts index 2a7b38ce..5925687d 100644 --- a/src/peer-generation/printers/InterfacePrinter.ts +++ b/src/peer-generation/printers/InterfacePrinter.ts @@ -49,6 +49,7 @@ import { escapeKeyword, IDLKind } from "../../idl"; import { ETSLanguageWriter } from '../LanguageWriters/writers/ETSLanguageWriter' import { collectProperties } from './StructPrinter' import { CustomPrintVisitor } from "../../from-idl/DtsPrinter" +import { stubIsTypeCallback } from '../ArgConvertors' interface InterfacesVisitor { getInterfaces(): Map @@ -540,10 +541,14 @@ export class ArkTSDeclConvertor extends TSDeclConvertor { } private printMethod(idl: idl.IDLMethod): stringOrNone[] { - return [ - ...this.printExtendedAttributes(idl), - indentedBy(`${idl.name}${this.printTypeParameters(idl.typeParameters)}(${this.printParameters(idl.parameters)}): ${this.convertType(idl.returnType)}`, 1) - ] + // TODO dirty stub. We are not processing interfaces methods as a + // callbacks for now, so interfaces with methods can not be + // deserialized in ArkTS + return [] + // return [ + // ...this.printExtendedAttributes(idl), + // indentedBy(`${idl.name}${this.printTypeParameters(idl.typeParameters)}(${this.printParameters(idl.parameters)}): ${this.convertType(idl.returnType)}`, 1) + // ] } private printFunction(idl: idl.IDLFunction): stringOrNone[] { if (idl.name?.startsWith("__")) { @@ -561,7 +566,8 @@ export class ArkTSDeclConvertor extends TSDeclConvertor { } private printPropNameWithType(prop: idl.IDLProperty): string { - return `${prop.name}${prop.isOptional ? "?" : ""}: ${this.convertType(prop.type)}` + const isOptional = prop.isOptional || stubIsTypeCallback(this.peerLibrary, prop.type) + return `${prop.name}${isOptional ? "?" : ""}: ${this.convertType(prop.type)}` } private printParameters(parameters: idl.IDLParameter[]): string { diff --git a/src/peer-generation/printers/SerializerPrinter.ts b/src/peer-generation/printers/SerializerPrinter.ts index a6d33b81..e26e2322 100644 --- a/src/peer-generation/printers/SerializerPrinter.ts +++ b/src/peer-generation/printers/SerializerPrinter.ts @@ -24,6 +24,7 @@ import { ArkTSBuiltTypesDependencyFilter, convertDeclToFeature, DependencyFilter, + isBuilderClass, isMaterialized, } from '../idl/IdlPeerGeneratorVisitor'; import { isSyntheticDeclaration, makeSyntheticDeclarationsFiles } from '../idl/IdlSyntheticDeclarations'; @@ -37,7 +38,7 @@ import { throwException } from "../../util"; import { IDLEntry } from "../../idl"; import { convertDeclaration } from '../LanguageWriters/nameConvertor'; import { collectMaterializedImports } from '../Materialized'; -import { generateCallbackKindAccess } from '../ArgConvertors'; +import { CallbackKind, generateCallbackKindAccess, stubIsTypeCallback } from '../ArgConvertors'; import { createSourceFile, ModifierFlags } from 'typescript'; import { SourceFile, TsSourceFile } from './SourceFile'; @@ -87,8 +88,14 @@ class IdlSerializerPrinter { } properties.forEach(it => { let field = `value_${it.name}` - writer.writeStatement(writer.makeAssign(field, undefined, writer.makeString(`value.${writer.escapeKeyword(it.name)}`), true)) let typeConvertor = this.library.typeConvertor(`value`, it.type!, it.isOptional) + + let memberAccess = writer.makeString(`value.${writer.escapeKeyword(it.name)}`) + if (writer.language === Language.ARKTS && stubIsTypeCallback(this.library, it.type)) { + memberAccess = writer.makeCast(memberAccess, idl.maybeOptional(it.type, it.isOptional)) + } + + writer.writeStatement(writer.makeAssign(field, undefined, memberAccess, true)) typeConvertor.convertorSerialize(`value`, field, writer) }) } @@ -204,6 +211,8 @@ class IdlDeserializerPrinter {///converge w/ IdlSerP? this.writer.writeMethodImplementation(new Method(`read${methodName}`, new NamedMethodSignature(type, [], [])), writer => { if (isMaterialized(target)) { this.generateMaterializedBodyDeserializer(target) + } else if (isBuilderClass(target)) { + this.generateBuilderClassDeserializer(target, type) } else { this.generateInterfaceBodyDeserializer(target, type) } @@ -222,16 +231,18 @@ class IdlDeserializerPrinter {///converge w/ IdlSerP? ) ) } + private generateBuilderClassDeserializer(target: idl.IDLInterface, type: idl.IDLType) { + if (this.writer.language === Language.CPP) + return this.generateInterfaceBodyDeserializer(target, type) + this.writer.writeStatement(this.writer.makeThrowError("Can not deserialize builder class")) + } private generateInterfaceBodyDeserializer(target: idl.IDLInterface, type: idl.IDLType) { const properties = collectProperties(target, this.library) // using list initialization to prevent uninitialized value errors const valueType = type // not used, if language === TS - const options: MakeAssignOptions | undefined = this.library.language === Language.TS - ? { overrideTypeName: `{${properties.map(it => `${it.name}?: ${this.writer.stringifyType(it.type)}`).join(", ")}}` } - : undefined if (this.writer.language === Language.CPP) - this.writer.writeStatement(this.writer.makeAssign("value", valueType, this.writer.makeString(`{}`), true, false, options)) + this.writer.writeStatement(this.writer.makeAssign("value", valueType, this.writer.makeString(`{}`), true, false)) if (idl.isInterface(target) || idl.isClass(target)) { if (properties.length > 0) { this.declareDeserializer() @@ -246,9 +257,13 @@ class IdlDeserializerPrinter {///converge w/ IdlSerP? }) if (this.writer.language !== Language.CPP) { const propsAssignees = properties.map(it => { + if (this.writer.language === Language.ARKTS) { + if (stubIsTypeCallback(this.library, it.type)) + return `${it.name}: undefined` + } return `${it.name}: ${it.name}_result` }) - this.writer.writeStatement(this.writer.makeAssign("value", valueType, this.writer.makeString(`{${propsAssignees.join(',')}}`), true, false, options)) + this.writer.writeStatement(this.writer.makeAssign("value", valueType, this.writer.makeCast(this.writer.makeString(`{${propsAssignees.join(',')}}`), type), true, false)) } } else { if (this.writer.language === Language.CPP) { @@ -352,7 +367,7 @@ class IdlDeserializerPrinter {///converge w/ IdlSerP? }), ...continuation, new ExpressionStatement(writer.makeNativeCall(`_CallCallback`, [ - writer.makeString(`${generateCallbackKindAccess(target, writer.language)}`), + writer.ordinalFromEnum(writer.makeString(`${generateCallbackKindAccess(target, writer.language)}`), idl.createReferenceType(CallbackKind)), writer.makeString(`${argsSerializer}Serializer.asArray()`), writer.makeString(`${argsSerializer}Serializer.length()`), ])), @@ -374,6 +389,8 @@ class IdlDeserializerPrinter {///converge w/ IdlSerP? if (this.writer.language == Language.CPP) { ctorSignature = new NamedMethodSignature(idl.IDLVoidType, [idl.IDLUint8ArrayType, idl.IDLI32Type], ["data", "length"]) prefix = prefix === "" ? PrimitiveType.Prefix : prefix + } else if (this.writer.language === Language.ARKTS) { + ctorSignature = new NamedMethodSignature(idl.IDLVoidType, [idl.createReferenceType('ArrayBuffer'), idl.IDLI32Type], ["data", "length"]) } const serializerDeclarations = getSerializers(this.library, createSerializerDependencyFilter(this.writer.language)) @@ -468,7 +485,6 @@ function printIdlImports(library: PeerLibrary, serializerDeclarations: Serializa else if (destFile.language === Language.ARKTS) { const collector = new ImportsCollector() collector.addFeature("TypeChecker", "#components") - collector.addFeature(`KPointer`, `@koalaui/interop`) library.files.forEach(peer => peer.serializeImportFeatures .forEach(importFeature => collector.addFeature(importFeature.feature, importFeature.module))) @@ -520,6 +536,9 @@ class DefaultSerializerDependencyFilter implements DependencyFilter { class ArkTSSerializerDependencyFilter extends DefaultSerializerDependencyFilter { readonly arkTSBuiltTypesFilter = new ArkTSBuiltTypesDependencyFilter() override shouldAdd(node: IDLEntry): node is SerializableTarget { + if (idl.isEnum(node)) { + return true; + } if (!this.arkTSBuiltTypesFilter.shouldAdd(node)) { return false } -- Gitee From 74a8563ce2d05b5876ee2ec0e66699dbb28e398a Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Tue, 19 Nov 2024 07:06:26 +0000 Subject: [PATCH 29/53] !988 Add markDirty to bridge_custom_prologues.cc --- peer_lib/sig/arkoala/arkui/src/main.ts | 10 +++++----- .../java/src/org/koalaui/arkoala/Main.java | 12 ++++++------ templates/bridge_custom_prologue.cc | 17 +++++++++++++---- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/peer_lib/sig/arkoala/arkui/src/main.ts b/peer_lib/sig/arkoala/arkui/src/main.ts index 5a9002db..e2e0a740 100644 --- a/peer_lib/sig/arkoala/arkui/src/main.ts +++ b/peer_lib/sig/arkoala/arkui/src/main.ts @@ -142,30 +142,30 @@ function checkNodeAPI() { checkResult("BasicNodeAPI addChild", () => nativeModule()._AddChild(ptr, childPtr1), - `addChild(0x${ptr}, 0x${childPtr1})` + `addChild(0x${ptr}, 0x${childPtr1})markDirty(0x${ptr}, 32)` ) nativeModule()._AddChild(ptr, childPtr2) checkResult("BasicNodeAPI removeChild", () => nativeModule()._RemoveChild(ptr, childPtr2), - `removeChild(0x${ptr}, 0x${childPtr2})` + `removeChild(0x${ptr}, 0x${childPtr2})markDirty(0x${ptr}, 32)` ) checkResult("BasicNodeAPI insertChildAfter", () => nativeModule()._InsertChildAfter(ptr, childPtr2, childPtr1), - `insertChildAfter(0x${ptr}, 0x${childPtr2}, 0x${childPtr1})` + `insertChildAfter(0x${ptr}, 0x${childPtr2}, 0x${childPtr1})markDirty(0x${ptr}, 32)` ) nativeModule()._RemoveChild(ptr, childPtr2) checkResult("BasicNodeAPI insertChildBefore", () => nativeModule()._InsertChildBefore(ptr, childPtr2, childPtr1), - `insertChildBefore(0x${ptr}, 0x${childPtr2}, 0x${childPtr1})` + `insertChildBefore(0x${ptr}, 0x${childPtr2}, 0x${childPtr1})markDirty(0x${ptr}, 32)` ) nativeModule()._RemoveChild(ptr, childPtr2) checkResult("BasicNodeAPI insertChildAt", () => nativeModule()._InsertChildAt(ptr, childPtr2, 0), - `insertChildAt(0x${ptr}, 0x${childPtr2}, 0)` + `insertChildAt(0x${ptr}, 0x${childPtr2}, 0)markDirty(0x${ptr}, 32)` ) nativeModule()._RemoveChild(ptr, childPtr2) diff --git a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Main.java b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Main.java index 96dbc59e..5d84fb36 100644 --- a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Main.java +++ b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Main.java @@ -238,17 +238,17 @@ public class Main { var child5 = ArkWebPeer.create(ArkUINodeType.Web, null, 0); TestUtils.checkResult("BasicNodeAPI addChild", () -> root.peer.addChild(child1.peer), - String.format("addChild(0x%d, 0x%d)", root.peer.ptr, child1.peer.ptr)); + String.format("addChild(0x%d, 0x%d)markDirty(0x%d, 32)", root.peer.ptr, child1.peer.ptr, root.peer.ptr, root.peer.ptr)); TestUtils.checkResult("BasicNodeAPI insertChildAfter", () -> root.peer.insertChildAfter(child4.peer, child1.peer), - String.format("insertChildAfter(0x%d, 0x%d, 0x%d)", root.peer.ptr, child4.peer.ptr, child1.peer.ptr)); + String.format("insertChildAfter(0x%d, 0x%d, 0x%d)markDirty(0x%d, 32)", root.peer.ptr, child4.peer.ptr, child1.peer.ptr, root.peer.ptr)); TestUtils.checkResult("BasicNodeAPI insertChildBefore", () -> root.peer.insertChildBefore(child3.peer, child4.peer), - String.format("insertChildBefore(0x%d, 0x%d, 0x%d)", root.peer.ptr, child3.peer.ptr, child4.peer.ptr)); + String.format("insertChildBefore(0x%d, 0x%d, 0x%d)markDirty(0x%d, 32)", root.peer.ptr, child3.peer.ptr, child4.peer.ptr, root.peer.ptr)); TestUtils.checkResult("BasicNodeAPI insertChildAt", () -> root.peer.insertChildAt(child2.peer, 1), - String.format("insertChildAt(0x%d, 0x%d, %d)", root.peer.ptr, child2.peer.ptr, 1)); + String.format("insertChildAt(0x%d, 0x%d, %d)markDirty(0x%d, 32)", root.peer.ptr, child2.peer.ptr, 1, root.peer.ptr)); TestUtils.checkResult("BasicNodeAPI insertChildAfter (empty tree case)", () -> child4.peer.insertChildAfter(child5.peer, null), - String.format("insertChildAfter(0x%d, 0x%d, 0x%d)", child4.peer.ptr, child5.peer.ptr, 0)); + String.format("insertChildAfter(0x%d, 0x%d, 0x%d)markDirty(0x%d, 32)", child4.peer.ptr, child5.peer.ptr, 0, child4.peer.ptr)); TestUtils.checkResult("BasicNodeAPI removeChild", () -> root.peer.removeChild(child2.peer), - String.format("removeChild(0x%d, 0x%d)", root.peer.ptr, child2.peer.ptr)); + String.format("removeChild(0x%d, 0x%d)markDirty(0x%d, 32)", root.peer.ptr, child2.peer.ptr, root.peer.ptr)); TestUtils.checkResult("BasicNodeAPI dispose", () -> child2.peer.dispose(), String.format("disposeNode(0x%d)", child2.peer.ptr)); TestUtils.checkResult("BasicNodeAPI dumpTree", () -> root.peer.dumpTree(), diff --git a/templates/bridge_custom_prologue.cc b/templates/bridge_custom_prologue.cc index 42905a78..29f1a84a 100644 --- a/templates/bridge_custom_prologue.cc +++ b/templates/bridge_custom_prologue.cc @@ -227,6 +227,7 @@ void impl_RemoveChild(Ark_NativePointer parent, Ark_NativePointer child) Ark_NodeHandle parentCast = (Ark_NodeHandle) parent; Ark_NodeHandle childCast = (Ark_NodeHandle) child; GetArkUIBasicNodeAPI()->removeChild(parentCast, childCast); + GetArkUIBasicNodeAPI()->markDirty(parentCast, GENERATED_ARKUI_DIRTY_FLAG_MEASURE_BY_CHILD_REQUEST); } KOALA_INTEROP_V2(RemoveChild, Ark_NativePointer, Ark_NativePointer) @@ -235,7 +236,9 @@ Ark_Int32 impl_InsertChildAfter(Ark_NativePointer parent, Ark_NativePointer chil Ark_NodeHandle parentCast = (Ark_NodeHandle) parent; Ark_NodeHandle childCast = (Ark_NodeHandle) child; Ark_NodeHandle siblingCast = (Ark_NodeHandle) sibling; - return GetArkUIBasicNodeAPI()->insertChildAfter(parentCast, childCast, siblingCast); + auto result = GetArkUIBasicNodeAPI()->insertChildAfter(parentCast, childCast, siblingCast); + GetArkUIBasicNodeAPI()->markDirty(parentCast, GENERATED_ARKUI_DIRTY_FLAG_MEASURE_BY_CHILD_REQUEST); + return result; } KOALA_INTEROP_3(InsertChildAfter, Ark_Int32, Ark_NativePointer, Ark_NativePointer, Ark_NativePointer) @@ -243,7 +246,9 @@ Ark_Int32 impl_AddChild(Ark_NativePointer parent, Ark_NativePointer child) { Ark_NodeHandle parentCast = (Ark_NodeHandle) parent; Ark_NodeHandle childCast = (Ark_NodeHandle) child; - return GetArkUIBasicNodeAPI()->addChild(parentCast, childCast); + auto result = GetArkUIBasicNodeAPI()->addChild(parentCast, childCast); + GetArkUIBasicNodeAPI()->markDirty(parentCast, GENERATED_ARKUI_DIRTY_FLAG_MEASURE_BY_CHILD_REQUEST); + return result; } KOALA_INTEROP_2(AddChild, Ark_Int32, Ark_NativePointer, Ark_NativePointer) @@ -252,7 +257,9 @@ Ark_Int32 impl_InsertChildBefore(Ark_NativePointer parent, Ark_NativePointer chi Ark_NodeHandle parentCast = (Ark_NodeHandle) parent; Ark_NodeHandle childCast = (Ark_NodeHandle) child; Ark_NodeHandle siblingCast = (Ark_NodeHandle) sibling; - return GetArkUIBasicNodeAPI()->insertChildBefore(parentCast, childCast, siblingCast); + auto result = GetArkUIBasicNodeAPI()->insertChildBefore(parentCast, childCast, siblingCast); + GetArkUIBasicNodeAPI()->markDirty(parentCast, GENERATED_ARKUI_DIRTY_FLAG_MEASURE_BY_CHILD_REQUEST); + return result; } KOALA_INTEROP_3(InsertChildBefore, Ark_Int32, Ark_NativePointer, Ark_NativePointer, Ark_NativePointer) @@ -260,7 +267,9 @@ Ark_Int32 impl_InsertChildAt(Ark_NativePointer parent, Ark_NativePointer child, { Ark_NodeHandle parentCast = (Ark_NodeHandle) parent; Ark_NodeHandle childCast = (Ark_NodeHandle) child; - return GetArkUIBasicNodeAPI()->insertChildAt(parentCast, childCast, position); + auto result = GetArkUIBasicNodeAPI()->insertChildAt(parentCast, childCast, position); + GetArkUIBasicNodeAPI()->markDirty(parentCast, GENERATED_ARKUI_DIRTY_FLAG_MEASURE_BY_CHILD_REQUEST); + return result; } KOALA_INTEROP_3(InsertChildAt, Ark_Int32, Ark_NativePointer, Ark_NativePointer, Ark_Int32) -- Gitee From a35e2a8e9872c2ae3effed9ac2269930269e574a Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Tue, 19 Nov 2024 07:18:07 +0000 Subject: [PATCH 30/53] !987 Regenerate ArkTS API * Regenerate ArkTS API --- src/peer-generation/ArgConvertors.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/peer-generation/ArgConvertors.ts b/src/peer-generation/ArgConvertors.ts index 58f19f05..e89298dd 100644 --- a/src/peer-generation/ArgConvertors.ts +++ b/src/peer-generation/ArgConvertors.ts @@ -86,7 +86,7 @@ export abstract class BaseArgConvertor implements ArgConvertor { scopeEnd?(param: string, language: Language): string abstract convertorArg(param: string, writer: LanguageWriter): string abstract convertorSerialize(param: string, value: string, writer: LanguageWriter): void - abstract convertorDeserialize(bufferName: string, deserializerName: string, assigneer: ExpressionAssigneer, writer: LanguageWriter): LanguageStatement + abstract convertorDeserialize(bufferName: string, deserializerName: string, assigneer: ExpressionAssigneer, writer: LanguageWriter): LanguageStatement unionDiscriminator(value: string, index: number, writer: LanguageWriter, duplicates: Set): LanguageExpression|undefined { return undefined } @@ -326,7 +326,8 @@ export class LengthConvertorScoped extends BaseArgConvertor { export class LengthConvertor extends BaseArgConvertor { constructor(name: string, param: string, language: Language) { // length convertor is only optimized for NAPI interop - super(idl.toIDLType(name), [RuntimeType.NUMBER, RuntimeType.STRING, RuntimeType.OBJECT], false, language !== Language.TS, param) + super(idl.toIDLType(name), [RuntimeType.NUMBER, RuntimeType.STRING, RuntimeType.OBJECT], false, + (language !== Language.TS && language !== Language.ARKTS), param) } convertorArg(param: string, writer: LanguageWriter): string { switch (writer.language) { @@ -749,7 +750,7 @@ export class OptionConvertor extends BaseArgConvertor { // writer.makeCast(writer.makeString(`${deserializerName}.readInt8()`), writer.getRuntimeType()), true)) const bufferType = this.nativeType() statements.push(writer.makeAssign(bufferName, bufferType, undefined, true, false)) - + const thenStatement = new BlockStatement([ this.typeConvertor.convertorDeserialize(`${bufferName}_`, deserializerName, (expr) => { const receiver = writer.language === Language.CPP @@ -1106,10 +1107,10 @@ export class MapConvertor extends BaseArgConvertor { // super( idl.createContainerType( 'record', [keyType, valueType] - ), - [RuntimeType.OBJECT], - false, - true, + ), + [RuntimeType.OBJECT], + false, + true, param ) this.keyConvertor = library.typeConvertor(param, keyType) @@ -1139,7 +1140,7 @@ export class MapConvertor extends BaseArgConvertor { // const keyAccessor = this.getObjectAccessor(writer.language, bufferName, {index: counterBuffer, field: "keys"}) const valueAccessor = this.getObjectAccessor(writer.language, bufferName, {index: counterBuffer, field: "values"}) return new BlockStatement([ - writer.makeAssign(sizeBuffer, idl.IDLI32Type, + writer.makeAssign(sizeBuffer, idl.IDLI32Type, writer.makeString(`${deserializerName}.readInt32()`), true, true), writer.makeAssign(bufferName, this.idlType, writer.makeMapInit(this.idlType), true, false), writer.makeMapResize(mapTypeName, keyType, valueType, bufferName, sizeBuffer, deserializerName), -- Gitee From 2a437805be5bd403e64208f18e86d28b125d4e30 Mon Sep 17 00:00:00 2001 From: Mikhail Bystretskiy Date: Tue, 19 Nov 2024 07:46:06 +0000 Subject: [PATCH 31/53] !982 Rework ArkTS builds --- .gitlab-ci.yml | 2 +- arktsconfig-peers-main.json | 15 +++++++++++++++ arktsconfig-peers.json | 13 ++++++------- native/meson.build | 2 +- package.json | 29 +++++++++++++++-------------- 5 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 arktsconfig-peers-main.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d92c47fe..85446698 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,7 +49,7 @@ compile arkts subset: - !reference [.setup, script] - PANDA_SDK_VERSION=1.5.0-dev.7123 npm run panda:sdk:install script: - - npm run compile:all:arkts:idl + - npm run compile:all:arkts arkts subset tsc: stage: test diff --git a/arktsconfig-peers-main.json b/arktsconfig-peers-main.json new file mode 100644 index 00000000..e19d4fab --- /dev/null +++ b/arktsconfig-peers-main.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "outDir": "out/abc-peers", + "rootDir": "./out/arkts-peers/generated", + "paths": { + "#components": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/arkts"], + "@arkoala/arkui": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated"], + "@koalaui/interop": ["./external/interop/src/arkts"], + "@koalaui/common": ["./external/incremental/common/src"], + "@koalaui/compat": ["./external/incremental/compat/src/arkts"], + "@koalaui/runtime": ["./external/incremental/runtime/src"] + } + }, + "include": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/main.ts"] +} diff --git a/arktsconfig-peers.json b/arktsconfig-peers.json index d71df484..51f01cd9 100644 --- a/arktsconfig-peers.json +++ b/arktsconfig-peers.json @@ -1,19 +1,18 @@ { "compilerOptions": { - "outDir": "out/abc-peers", - "rootDir": "./out/arkts-peers/generated", + "baseUrl": ".", "paths": { "#components": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/arkts"], "@arkoala/arkui": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated", "./"], - "@arkoala/arkui/*": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/*", "./*"], - "@koalaui/arkoala": ["./out/arkts-peers/generated/sig/arkoala-arkts/framework/src"], "@koalaui/interop": ["./external/interop/src/arkts"], "@koalaui/common": ["./external/incremental/common/src"], "@koalaui/compat": ["./external/incremental/compat/src/arkts"], "@koalaui/runtime": ["./external/incremental/runtime/src"] } }, - "include": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/**/*\\.ts"], - "exclude": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/ts/*\\.ts", - "./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/main.ts"] + "include": ["out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/**/*\\.ts"], + "exclude": [ + "out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/ts/*\\.ts", + "out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/main.ts" + ] } diff --git a/native/meson.build b/native/meson.build index 4cfca312..bb4178e6 100644 --- a/native/meson.build +++ b/native/meson.build @@ -24,7 +24,7 @@ is_jni = java_home != 'undefined' compile_events_test = get_option('events_test') compile_callbacks_test = get_option('callbacks_test') -if ['ts-peers', 'ts-subset', 'java-subset', 'arkts-subset', 'cangjie-subset'].contains(source_set) +if ['ts-peers', 'ts-subset', 'java-subset', 'arkts-subset', 'arkts-peers', 'cangjie-subset'].contains(source_set) gen_dir = '../out/' / source_set / 'generated' else endif diff --git a/package.json b/package.json index ef4195e6..8eeefd09 100644 --- a/package.json +++ b/package.json @@ -88,14 +88,15 @@ "compile:native-node-host-ts-subset": "npm run configure:native-node-host-ts-subset && cd native && meson compile --verbose -C build-node-host-ts-subset && meson install -C build-node-host-ts-subset", "configure:native-node-host-arkts-subset": "cd ./native && meson setup -Dsource_set=arkts-subset build-node-host-arkts-subset", "compile:native-node-host-arkts-subset": "npm run configure:native-node-host-arkts-subset && cd native && meson compile --verbose -C build-node-host-arkts-subset && meson install -C build-node-host-arkts-subset", + "configure:native-node-host-arkts-full": "cd ./native && meson setup -Dsource_set=arkts-peers build-node-host-arkts-full", + "compile:native-node-host-arkts-full": "npm run configure:native-node-host-arkts-full && cd native && meson compile --verbose -C build-node-host-arkts-full && meson install -C build-node-host-arkts-full", "configure:native-node-host-full": "cd ./native && meson setup -Dsource_set=ts-peers build-node-host-full", "compile:native-node-host-full": "npm run configure:native-node-host-full && cd native && meson compile --verbose -C build-node-host-full && meson install -C build-node-host-full", - "sanity": "npm run check:subset:run && npm run check:peers:run && npm run run:all && npm run lint:test && npm run make:arkts:idl", + "sanity": "npm run check:subset:run && npm run check:peers:run && npm run run:all && npm run lint:test && npm run make:arkts", "panda:sdk:install": "npm run panda:sdk:install --prefix external/incremental/tools/panda", - "make:arkts": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --input-dir ./tests/subset/ets --output-dir ./out/arkts-subset/generated --language arkts", - "make:arkts:idl": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --input-dir ./tests/arkts-subset/ets,./tests/arkts-subset/resource --output-dir ./out/arkts-subset/generated --language arkts", + "make:arkts": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --input-dir ./tests/arkts-subset/ets,./tests/arkts-subset/resource --output-dir ./out/arkts-subset/generated --language arkts", "make:arkts:subset:tsc": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --only-integrated --input-dir ./tests/arkts-subset/ets/,./tests/arkts-subset/resource --arkoala-destination ./out/arkts-subset-tsc/generated --generator-target arkoala --language=arkts", - "make:arkts:peers": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --input-dir ./interface_sdk-js/api/@internal/component/ets/ --output-dir ./out/arkts-peers/generated --language arkts", + "make:arkts:peers": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --input-dir ./interface_sdk-js/api/@internal/component/ets/,./interface_sdk-js/api/global --output-dir ./out/arkts-peers/generated --language arkts", "compile:arkts": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-subset.json --ets-module --extension sts --list-files", "compile:arkts:compat": "cd ./external/incremental/compat/ && npm run compile:arkts", "compile:arkts:common": "cd ./external/incremental/common/ && npm run compile:arkts", @@ -103,16 +104,16 @@ "compile:arkts:interop": "cd ./external/interop/ && npm run compile:arkts && echo ATTENTION: an interop is compiled without unmemoization here!", "compile:arkts:peers": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-peers.json --ets-module --extension sts --list-files --compiler-memory-size=1073741824", "compile:arkts:subset": "npm run make:arkts && npm run compile:arkts", - "compile:arkts:idl:subset": "npm run make:arkts:idl && npm run compile:arkts", "compile:arkts:subset:main": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-subset-main.json --extension sts --list-files", - "make:compile:arkts:peers": "npm run make:arkts:peers && npm run compile:arkts:peers", + "compile:arkts:peers:main": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-peers-main.json --extension sts --list-files", + "compile:arkts:libs": "npm run compile:arkts:compat && npm run compile:arkts:common && npm run compile:arkts:runtime && npm run compile:arkts:interop", + "make:compile:arkts:peers": "npm run make:arkts:peers && npm run compile:arkts:peers && npm run compile:native-node-host-arkts-full && npm run compile:arkts:libs && npm run compile:arkts:peers:main && npm run link:incremental --prefix ./external/incremental/runtime && cp ./external/incremental/runtime/build/incremental.abc ./out/abc-peers/sig/arkoala-arkts/arkui/src/generated", "run:arkts-link-interfaces": "bash ./external/incremental/tools/panda/arkts/arklink --output ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/dts_interfaces.abc -- `find ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/ -name *Interfaces.abc`", - "compile:all:arkts": "npm run compile:arkts:subset && npm run compile:native-node-host-arkts-subset && npm run compile:arkts:compat && npm run compile:arkts:common && npm run compile:arkts:runtime && npm run compile:arkts:interop && npm run compile:arkts:subset:main && npm run link:incremental --prefix ./external/incremental/runtime && cp ./external/incremental/runtime/build/incremental.abc ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated", - "compile:all:arkts:idl": "npm run compile:arkts:idl:subset && npm run compile:native-node-host-arkts-subset && npm run compile:arkts:compat && npm run compile:arkts:common && npm run compile:arkts:runtime && npm run compile:arkts:interop && npm run compile:arkts:subset:main", - "execute:panda": "ACE_LIBRARY_PATH=./native/build-node-host-arkts-subset LD_LIBRARY_PATH=./native bash ./external/incremental/tools/panda/arkts/ark --ark-entry-point ETSGLOBAL::main --ark-boot-files ./external/incremental/compat/build/abc/arkts/index.abc:./out/abc-subset:./external/interop/build/abc:./external/incremental/runtime/build/abc:./external/incremental/compat/build/abc:./external/incremental/common/build/abc ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/main.abc --driver-log info && echo 'Workaround: make sure compat/src/arkts/index.ts abc goes first until index.ETSGLOBAL issues is reolved'", - "run:panda": "npm run compile:all:arkts && npm run execute:panda", - "run:panda:idl": "npm run compile:all:arkts:idl && npm run execute:panda", - "run:panda:peers": "npm run make:compile:arkts:peers", + "compile:all:arkts": "npm run compile:arkts:subset && npm run compile:native-node-host-arkts-subset && npm run compile:arkts:libs && npm run compile:arkts:subset:main && npm run link:incremental --prefix ./external/incremental/runtime && cp ./external/incremental/runtime/build/incremental.abc ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated", + "execute:panda:subset": "ACE_LIBRARY_PATH=./native/build-node-host-arkts-subset LD_LIBRARY_PATH=./native bash ./external/incremental/tools/panda/arkts/ark --ark-entry-point ETSGLOBAL::main --ark-boot-files ./external/incremental/compat/build/abc/arkts/index.abc:./out/abc-subset:./external/interop/build/abc:./external/incremental/runtime/build/abc:./external/incremental/compat/build/abc:./external/incremental/common/build/abc ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/main.abc --driver-log info && echo 'Workaround: make sure compat/src/arkts/index.ts abc goes first until index.ETSGLOBAL issues is reolved'", + "execute:panda:peers": "ACE_LIBRARY_PATH=./native/build-node-host-arkts-peers LD_LIBRARY_PATH=./native bash ./external/incremental/tools/panda/arkts/ark --ark-entry-point ETSGLOBAL::main --ark-boot-files ./external/incremental/compat/build/abc/arkts/index.abc:./out/abc-peers:./external/interop/build/abc:./external/incremental/runtime/build/abc:./external/incremental/compat/build/abc:./external/incremental/common/build/abc ./out/abc-peers/sig/arkoala-arkts/arkui/src/generated/main.abc --driver-log info && echo 'Workaround: make sure compat/src/arkts/index.ts abc goes first until index.ETSGLOBAL issues is reolved'", + "run:panda:subset": "npm run compile:all:arkts && npm run execute:panda:subset", + "run:panda:peers": "npm run make:compile:arkts:peers && npm run execute:panda:peers", "compile:java": "npm run compile && node . --api-version 99 --dts2peer --input-dir ./tests/java-subset/ets/,./tests/java-subset/resource --output-dir ./out/java-subset/generated --language java --need-interfaces && npm run compile:native-node-host-java-subset && bash -c \"find ./out/java-subset/generated/sig/arkoala/framework/java/src/org/koalaui/arkoala/ -name *.java > ./out/java-subset/generated/sig/arkoala/framework/java/src/org/koalaui/arkoala/files.list\" && javac -sourcepath ./out/java-subset/generated/sig/arkoala/framework/java/src -d ./out/java-subset/bin @./out/java-subset/generated/sig/arkoala/framework/java/src/org/koalaui/arkoala/files.list", "run:java": "npm run compile:java && npm run compile:native-node-host-java-subset && ACE_LIBRARY_PATH=./native java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Main", "run:java:concurrent": "npm run compile:java && npm run compile:native-node-host-java-subset && java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Concurrent", @@ -120,7 +121,7 @@ "run:dummy-panda:java": "npm run compile:java && npm run compile:native-node-host-java-subset && java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Application", "run:dummy-panda:panda": "rimraf build && npm run make:arkts && bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-application.json && npm run compile:native-node-host-arkts-subset && LD_LIBRARY_PATH=./native PANDA_LIB_PATH=./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/ bash ./external/incremental/tools/panda/arkts/ark --ark-boot-files ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/Application.abc", "run:app:java": "npm run compile:dummy-panda && ACE_LIBRARY_PATH=./native node lib/loader.js java", - "run:app:panda": "cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs && npm run compile:all:arkts:idl && PANDA_HOME=./external/incremental/tools/panda/node_modules/@panda/sdk ACE_LIBRARY_PATH=./native node lib/loader.js panda", + "run:app:panda": "cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs && npm run compile:all:arkts && PANDA_HOME=./external/incremental/tools/panda/node_modules/@panda/sdk ACE_LIBRARY_PATH=./native node lib/loader.js panda", "run:es2panda": "npm run compile && npm run compile:dummy-panda && node lib/loader.js es2panda", "compile:native-ohos-subset-arm32": "npm run check:subset && node ./native/nativeBuild.mjs subset arm32", "compile:native-ohos-subset-arm64": "npm run check:subset && node ./native/nativeBuild.mjs subset arm64", @@ -152,7 +153,7 @@ "arkoala:har": "npm run generate:ts && cd external && npm run arkoala:har", "arkoala:har-arm32": "npm run generate:ts && cd external && npm run arkoala:har-arm32", "sig:arkts:subset:clean": "cd ./external/arkoala-arkts/arkui && rm -rf src/generated/ && rm -rf build/ && rm -rf unmemoized/", - "sig:arkts:subset:copy": "npm run make:arkts:idl && cp -r ./out/arkts-subset/generated/sig/arkoala-arkts/arkui/src/generated/ ./external/arkoala-arkts/arkui/src/", + "sig:arkts:subset:copy": "npm run make:arkts && cp -r ./out/arkts-subset/generated/sig/arkoala-arkts/arkui/src/generated/ ./external/arkoala-arkts/arkui/src/", "sig:arkts:subset:compile": "cd external/arkoala-arkts/arkui && npm run compile:arkts:unmemoized", "sig:arkts:subset:all": "npm run sig:arkts:subset:clean && npm run sig:arkts:subset:copy && npm run sig:arkts:subset:compile" } -- Gitee From a509e860fbb584d2729b59184d9e3f4f63986e5f Mon Sep 17 00:00:00 2001 From: kolegovilya Date: Tue, 19 Nov 2024 09:40:46 +0000 Subject: [PATCH 32/53] !969 Removed deprecated methods from PeerLibrary --- src/LibraryInterface.ts | 22 ++------------ src/peer-generation/ArgConvertors.ts | 19 ++++++------ .../LanguageWriters/LanguageWriter.ts | 12 ++++---- .../writers/CJLanguageWriter.ts | 19 ++++++------ .../writers/CLikeLanguageWriter.ts | 4 +-- .../writers/CppLanguageWriter.ts | 14 ++++----- .../writers/ETSLanguageWriter.ts | 12 ++++---- .../writers/JavaLanguageWriter.ts | 12 ++++---- .../writers/TsLanguageWriter.ts | 16 +++++----- src/peer-generation/OhosGenerator.ts | 8 ++--- src/peer-generation/PeerLibrary.ts | 29 +----------------- .../idl/IdlPeerGeneratorVisitor.ts | 22 ++++++++------ .../printers/BridgeCcPrinter.ts | 2 +- .../printers/ComponentsPrinter.ts | 2 +- src/peer-generation/printers/EventsPrinter.ts | 2 +- .../printers/InterfacePrinter.ts | 8 ++--- .../printers/NativeModuleRecorderPrinter.ts | 4 +-- .../printers/OverloadsPrinter.ts | 2 +- src/peer-generation/printers/PeersPrinter.ts | 2 +- .../printers/SerializerPrinter.ts | 2 +- src/peer-generation/printers/StructPrinter.ts | 30 +++++++++---------- .../printers/TypeCheckPrinter.ts | 2 +- src/skoala-generation/idl/idlSkoalaLibrary.ts | 4 ++- 23 files changed, 106 insertions(+), 143 deletions(-) diff --git a/src/LibraryInterface.ts b/src/LibraryInterface.ts index 6068951a..0b352ce0 100644 --- a/src/LibraryInterface.ts +++ b/src/LibraryInterface.ts @@ -1,34 +1,16 @@ import * as idl from "./idl"; +import { Language } from "./Language"; import { ArgConvertor } from "./peer-generation/ArgConvertors"; import { IdlEntryManager } from "./peer-generation/idl/IdlEntryManager"; import { ReferenceResolver } from "./peer-generation/ReferenceResolver"; // todo: TypeProcessor? LibraryBase? export interface LibraryInterface extends ReferenceResolver { + language: Language get factory(): IdlEntryManager typeConvertor(param: string, type: idl.IDLType, isOptionalParam?: boolean): ArgConvertor declarationConvertor(param: string, type: idl.IDLReferenceType, declaration: idl.IDLEntry | undefined): ArgConvertor - /** @deprecated - * Should be removed ASAP - * Do not use this function if possible, instead use - * `LanguageWriter.stringifyType()` - * or `IdlNameConvertor.convert` - */ - getTypeName(type: idl.IDLType): string - /** @deprecated - * Should be removed ASAP - * Do not use this function if possible, instead use - * `IdlNameConvertor.convert` - */ - getEntryName(entry: idl.IDLEntry): string - /** @deprecated - * Should be removed ASAP - * Do not use this function if possible, instead use - * `IdlNameConvertor.convert` - */ - getNodeName(node: idl.IDLNode): string getInteropName(node: idl.IDLNode): string - mapType(type: idl.IDLType | idl.IDLCallback): string createContinuationCallbackReference(continuationType: idl.IDLType): idl.IDLReferenceType getCurrentContext(): string | undefined isComponentDeclaration(iface: idl.IDLInterface): boolean diff --git a/src/peer-generation/ArgConvertors.ts b/src/peer-generation/ArgConvertors.ts index e89298dd..847aacdc 100644 --- a/src/peer-generation/ArgConvertors.ts +++ b/src/peer-generation/ArgConvertors.ts @@ -17,7 +17,7 @@ import * as idl from "../idl" import { Language } from "../Language" import { LibraryInterface } from "../LibraryInterface" import { PrimitiveType } from "./ArkPrimitiveType" -import { BlockStatement, BranchStatement, generateTypeCheckerName, LanguageExpression, LanguageStatement, LanguageWriter, StringExpression } from "./LanguageWriters" +import { BlockStatement, BranchStatement, createTypeNameConvertor, generateTypeCheckerName, LanguageExpression, LanguageStatement, LanguageWriter, StringExpression } from "./LanguageWriters" export enum RuntimeType { UNEXPECTED = -1, @@ -80,7 +80,7 @@ export abstract class BaseArgConvertor implements ArgConvertor { throw new Error("Define") } targetType(writer: LanguageWriter): string { - return writer.stringifyType(this.idlType) + return writer.getNodeName(this.idlType) } scopeStart?(param: string, language: Language): string scopeEnd?(param: string, language: Language): string @@ -513,7 +513,7 @@ export class StringConvertor extends BaseArgConvertor { } targetType(writer: LanguageWriter): string { if (this.literalValue) { - return writer.stringifyType(idl.IDLStringType) + return writer.getNodeName(idl.IDLStringType) } return super.targetType(writer); } @@ -576,7 +576,7 @@ export class EnumConvertor extends BaseArgConvertor { // return false } targetType(writer: LanguageWriter): string { - return writer.stringifyType(this.idlType) // this.enumTypeName(writer.language) + return writer.getNodeName(this.idlType) // this.enumTypeName(writer.language) } extremumOfOrdinals(): {low: number, high: number} { let low: number = Number.MAX_VALUE @@ -619,7 +619,7 @@ export class UnionConvertor extends BaseArgConvertor { // if (!(it instanceof UndefinedConvertor)) { printer.writeStatement( printer.makeAssign(`${value}_${index}`, undefined, - printer.makeUnionVariantCast(it.getObjectAccessor(printer.language, value), printer.stringifyType(it.idlType), it, index), true)) + printer.makeUnionVariantCast(it.getObjectAccessor(printer.language, value), printer.getNodeName(it.idlType), it, index), true)) it.convertorSerialize(param, `${value}_${index}`, printer) } printer.popIndent() @@ -998,7 +998,7 @@ export class CallbackConvertor extends BaseArgConvertor { return assigneer(writer.makeString(`{${resourceReadExpr.asString()}, ${callReadExpr.asString()}}`)) } return assigneer(writer.makeString( - `${deserializerName}.read${this.library.getEntryName(this.decl)}()`)) + `${deserializerName}.read${this.library.getInteropName(this.decl)}()`)) } nativeType(): idl.IDLType { return idl.createReferenceType(this.decl.name) @@ -1130,7 +1130,7 @@ export class MapConvertor extends BaseArgConvertor { // })) } convertorDeserialize(bufferName: string, deserializerName: string, assigneer: ExpressionAssigneer, writer: LanguageWriter): LanguageStatement { - const mapTypeName = this.library.getTypeName(this.idlType) + const mapTypeName = writer.getNodeName(this.idlType) const keyType = this.keyType const valueType = this.valueType const sizeBuffer = `${bufferName}_size` @@ -1283,17 +1283,18 @@ export function generateCallbackKindAccess(callback: idl.IDLCallback, language: } export function generateCallbackAPIArguments(library: LibraryInterface, callback: idl.IDLCallback): string[] { + const nameConvertor = createTypeNameConvertor(Language.CPP, library) const args: string[] = [`const ${PrimitiveType.Int32.getText()} resourceId`] args.push(...callback.parameters.map(it => { const target = library.toDeclaration(it.type!) const type = library.typeConvertor(it.name, it.type!, it.isOptional) const constPrefix = !idl.isEnum(target) ? "const " : "" - return `${constPrefix}${library.getTypeName(type.nativeType())} ${type.param}` + return `${constPrefix}${nameConvertor.convert(type.nativeType())} ${type.param}` })) if (!idl.isVoidType(callback.returnType)) { const type = library.typeConvertor(`continuation`, library.createContinuationCallbackReference(callback.returnType)!, false) - args.push(`const ${library.getTypeName(type.nativeType())} ${type.param}`) + args.push(`const ${nameConvertor.convert(type.nativeType())} ${type.param}`) } return args } diff --git a/src/peer-generation/LanguageWriters/LanguageWriter.ts b/src/peer-generation/LanguageWriters/LanguageWriter.ts index e4499a46..2a1c90de 100644 --- a/src/peer-generation/LanguageWriters/LanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/LanguageWriter.ts @@ -121,7 +121,7 @@ export class AssignStatement implements LanguageStatement { this.options?.overrideTypeName ? `: ${this.options.overrideTypeName}` : this.type - ? `: ${writer.stringifyType(this.type)}${/*SHOULD BE REMOVED*/idl.isOptionalType(this.type) ? "|undefined" : ""}` + ? `: ${writer.getNodeName(this.type)}${/*SHOULD BE REMOVED*/idl.isOptionalType(this.type) ? "|undefined" : ""}` : "" const initValue = this.expression ? `= ${this.expression.asString()}` : "" const constSpec = this.isConst ? "const" : "let" @@ -459,7 +459,7 @@ export abstract class LanguageWriter { abstract enumFromOrdinal(value: LanguageExpression, enumEntry: idl.IDLEnum): LanguageExpression abstract ordinalFromEnum(value: LanguageExpression, enumReference: idl.IDLType): LanguageExpression abstract makeEnumCast(enumName: string, unsafe: boolean, convertor: EnumConvertor | undefined): string - abstract stringifyType(type: idl.IDLType | idl.IDLCallback): string + abstract getNodeName(type: idl.IDLNode): string abstract fork(): LanguageWriter concat(other: PrinterLike): this { @@ -702,7 +702,7 @@ export abstract class LanguageWriter { this.makeString(this.getObjectAccessor(convertor, value)), idl.createReferenceType(convertor.enumEntry.name) ) - : this.makeUnionVariantCast(this.getObjectAccessor(convertor, value), this.stringifyType(idl.IDLI32Type), convertor, index) + : this.makeUnionVariantCast(this.getObjectAccessor(convertor, value), this.getNodeName(idl.IDLI32Type), convertor, index) const {low, high} = convertor.extremumOfOrdinals() return this.discriminatorFromExpressions(value, convertor.runtimeTypes[0], [ this.makeNaryOp(">=", [ordinal, this.makeString(low!.toString())]), @@ -724,12 +724,12 @@ export abstract class LanguageWriter { return this.makeString(`${value} instanceof ArrayBuffer`) } instanceOf(convertor: BaseArgConvertor, value: string, _duplicateMembers?: Set): LanguageExpression { - return this.makeString(`${value} instanceof ${this.stringifyType(convertor.idlType)}`) + return this.makeString(`${value} instanceof ${this.getNodeName(convertor.idlType)}`) } - stringifyTypeOrEmpty(type: idl.IDLType | idl.IDLCallback | undefined): string { + stringifyTypeOrEmpty(type: idl.IDLType | undefined): string { if (type === undefined) return "" - return this.stringifyType(type) + return this.getNodeName(type) } /** * Writes `namespace {` and adds extra indent diff --git a/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts index 8a94b5aa..ff8fca31 100644 --- a/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CJLanguageWriter.ts @@ -57,7 +57,7 @@ class CJLambdaExpression extends LambdaExpression { return true } asString(): string { - const params = this.signature.args.map((it, i) => `${this.writer.stringifyType(it)} ${this.signature.argName(i)}`) + const params = this.signature.args.map((it, i) => `${this.writer.getNodeName(it)} ${this.signature.argName(i)}`) return `(${params.join(", ")}) -> { ${this.bodyAsString()} }` } } @@ -105,7 +105,7 @@ export class CJAssignStatement extends AssignStatement { write(writer: LanguageWriter): void { if (this.isDeclared) { - const typeSpec = this.type ? ': ' + writer.stringifyType(this.type) : '' + const typeSpec = this.type ? ': ' + writer.getNodeName(this.type) : '' writer.print(`${this.isConst ? "let" : "var"} ${this.variableName}${typeSpec} = ${this.expression.asString()}`) } else { writer.print(`${this.variableName} = ${this.expression.asString()}`) @@ -194,8 +194,7 @@ export class CJLanguageWriter extends LanguageWriter { fork(): LanguageWriter { return new CJLanguageWriter(new IndentedPrinter(), this.resolver) } - - stringifyType(type: idl.IDLType): string { + getNodeName(type: idl.IDLNode): string { return this.typeConvertor.convert(type) } @@ -249,13 +248,13 @@ export class CJLanguageWriter extends LanguageWriter { const init = initExpr != undefined ? ` = ${initExpr.asString()}` : `` name = this.escapeKeyword(name) let prefix = this.makeFieldModifiersList(modifiers) - this.printer.print(`${prefix} var ${name}: ${optional ? '?' : ''}${this.stringifyType(type)}${init}`) + this.printer.print(`${prefix} var ${name}: ${optional ? '?' : ''}${this.getNodeName(type)}${init}`) } writeMethodDeclaration(name: string, signature: MethodSignature, modifiers?: MethodModifier[]): void { this.writeDeclaration(name, signature, modifiers) } writeConstructorImplementation(className: string, signature: MethodSignature, op: (writer: LanguageWriter) => void, superCall?: Method, modifiers?: MethodModifier[]) { - this.printer.print(`${modifiers ? modifiers.map((it) => MethodModifier[it].toLowerCase()).join(' ') + ' ' : ''}${className}(${signature.args.map((it, index) => `${signature.argName(index)}: ${idl.isOptionalType(it) ? '?' : ''}${this.stringifyType(it)}`).join(", ")}) {`) + this.printer.print(`${modifiers ? modifiers.map((it) => MethodModifier[it].toLowerCase()).join(' ') + ' ' : ''}${className}(${signature.args.map((it, index) => `${signature.argName(index)}: ${idl.isOptionalType(it) ? '?' : ''}${this.getNodeName(it)}`).join(", ")}) {`) this.pushIndent() if (superCall) { this.print(`super(${superCall.signature.args.map((_, i) => superCall?.signature.argName(i)).join(", ")})`) @@ -267,9 +266,9 @@ export class CJLanguageWriter extends LanguageWriter { writeProperty(propName: string, propType: idl.IDLType, mutable?: boolean, getterLambda?: (writer: LanguageWriter) => void, setterLambda?: (writer: LanguageWriter) => void) { let shortName = propName.concat("_container") if(!getterLambda) { - this.print(`private var ${shortName}: ${idl.isOptionalType(propType) ? '?' : ''}${this.stringifyType(propType)}`) + this.print(`private var ${shortName}: ${idl.isOptionalType(propType) ? '?' : ''}${this.getNodeName(propType)}`) } - this.print(`${mutable ? "mut " : ""}prop ${propName}: ${idl.isOptionalType(propType) ? '?' : ''}${this.stringifyType(propType)} {`) + this.print(`${mutable ? "mut " : ""}prop ${propName}: ${idl.isOptionalType(propType) ? '?' : ''}${this.getNodeName(propType)} {`) this.pushIndent() this.print(`get() {`) @@ -303,7 +302,7 @@ export class CJLanguageWriter extends LanguageWriter { ?.filter(it => this.supportedModifiers.includes(it)) .map(it => this.mapMethodModifier(it)).join(" ") prefix = prefix ? prefix + " " : "" - this.print(`${prefix}func ${name}(${signature.args.map((it, index) => `${signature.argName(index)}: ${idl.isOptionalType(it) ? '?' : ''}${this.stringifyType(it)}`).join(", ")}): ${this.stringifyType(signature.returnType)}${postfix ?? ""}`) + this.print(`${prefix}func ${name}(${signature.args.map((it, index) => `${signature.argName(index)}: ${idl.isOptionalType(it) ? '?' : ''}${this.getNodeName(it)}`).join(", ")}): ${this.getNodeName(signature.returnType)}${postfix ?? ""}`) } nativeReceiver(): string { return 'NativeModule' } writeNativeFunctionCall(printer: LanguageWriter, name: string, signature: MethodSignature) { @@ -363,7 +362,7 @@ export class CJLanguageWriter extends LanguageWriter { this.print(`println("${message}")`) } makeCast(value: LanguageExpression, type: IDLType, options?:MakeCastOptions): LanguageExpression { - return new CJCastExpression(value, this.stringifyType(type), options?.unsafe ?? false) + return new CJCastExpression(value, this.getNodeName(type), options?.unsafe ?? false) } getObjectAccessor(convertor: BaseArgConvertor, value: string, args?: ObjectArgs): string { return `${value}` diff --git a/src/peer-generation/LanguageWriters/writers/CLikeLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CLikeLanguageWriter.ts index 39bef32c..b519cd98 100644 --- a/src/peer-generation/LanguageWriters/writers/CLikeLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CLikeLanguageWriter.ts @@ -110,9 +110,9 @@ export abstract class CLikeLanguageWriter extends LanguageWriter { this.print(`${prefix}${this.stringifyMethodReturnType(signature.returnType, signature.retHint())} ${name}(${signature.args.map((it, index) => `${this.stringifyMethodArgType(it, signature.argHint(index))} ${signature.argName(index)}`).join(", ")})${postfix ?? ""}`) } protected stringifyMethodReturnType(type:IDLType, _?:MethodArgPrintHint): string { - return this.stringifyType(type) + return this.getNodeName(type) } protected stringifyMethodArgType(type:IDLType, _?:MethodArgPrintHint): string { - return this.stringifyType(type) + return this.getNodeName(type) } } \ No newline at end of file diff --git a/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts index 910ba8c6..4ada1e37 100644 --- a/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/CppLanguageWriter.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { createContainerType, createReferenceType, DebugUtils, forceAsNamedNode, IDLAnyType, IDLBooleanType, IDLCallback, IDLContainerType, IDLContainerUtils, IDLEnum, IDLI16Type, IDLI32Type, IDLI64Type, IDLI8Type, IDLNumberType, IDLOptionalType, IDLPointerType, IDLPrimitiveType, IDLReferenceType, IDLStringType, IDLType, IDLTypeParameterType, IDLU16Type, IDLU32Type, IDLU64Type, IDLU8Type, IDLUint8ArrayType, IDLUnionType, IDLVoidType, isCallback, isContainerType, isOptionalType, isPrimitiveType, isReferenceType, isType, isUnionType, toIDLType } from "../../../idl" +import { createContainerType, createReferenceType, DebugUtils, forceAsNamedNode, IDLAnyType, IDLBooleanType, IDLCallback, IDLContainerType, IDLContainerUtils, IDLEnum, IDLI16Type, IDLI32Type, IDLI64Type, IDLI8Type, IDLNode, IDLNumberType, IDLOptionalType, IDLPointerType, IDLPrimitiveType, IDLReferenceType, IDLStringType, IDLType, IDLTypeParameterType, IDLU16Type, IDLU32Type, IDLU64Type, IDLU8Type, IDLUint8ArrayType, IDLUnionType, IDLVoidType, isCallback, isContainerType, isOptionalType, isPrimitiveType, isReferenceType, isType, isUnionType, toIDLType } from "../../../idl" import { IndentedPrinter } from "../../../IndentedPrinter" import { cppKeywords } from "../../../languageSpecificKeywords" import { Language } from "../../../Language" @@ -118,7 +118,7 @@ class CppArrayResizeStatement implements LanguageStatement { class CppMapResizeStatement implements LanguageStatement { constructor(private mapTypeName: string, private keyType: IDLType, private valueType: IDLType, private map: string, private size: string, private deserializer: string) {} write(writer: LanguageWriter): void { - writer.print(`${this.deserializer}.resizeMap<${this.mapTypeName}, ${writer.stringifyType(this.keyType)}, ${writer.stringifyType(this.valueType)}>(&${this.map}, ${this.size});`) + writer.print(`${this.deserializer}.resizeMap<${this.mapTypeName}, ${writer.getNodeName(this.keyType)}, ${writer.getNodeName(this.valueType)}>(&${this.map}, ${this.size});`) } } @@ -158,7 +158,7 @@ export class CppLanguageWriter extends CLikeLanguageWriter { super(printer, resolver, Language.CPP) this.typeConvertor = new CppIDLNodeToStringConvertor(this.resolver) } - stringifyType(type: IDLType): string { + getNodeName(type: IDLNode): string { return this.typeConvertor.convert(type) } fork(): LanguageWriter { @@ -297,7 +297,7 @@ export class CppLanguageWriter extends CLikeLanguageWriter { return this.makeString(`{}`) } makeClassInit(type: IDLType, paramenters: LanguageExpression[]): LanguageExpression { - return this.makeString(`${this.stringifyType(type)}(${paramenters.map(it => it.asString()).join(", ")})`) + return this.makeString(`${this.getNodeName(type)}(${paramenters.map(it => it.asString()).join(", ")})`) } makeMapInit(type: IDLType): LanguageExpression { return this.makeString(`{}`) @@ -394,7 +394,7 @@ export class CppLanguageWriter extends CLikeLanguageWriter { return typeName } override stringifyMethodReturnType(type:IDLType, hint?: MethodArgPrintHint): string { - const name = this.stringifyType(type) + const name = this.getNodeName(type) let postfix = '' if (hint === MethodArgPrintHint.AsPointer || hint === MethodArgPrintHint.AsConstPointer) { postfix = '*' @@ -407,7 +407,7 @@ export class CppLanguageWriter extends CLikeLanguageWriter { } override stringifyMethodArgType(type:IDLType, hint?: MethodArgPrintHint): string { // we should decide pass by value or by reference here - const name = this.stringifyType(type) + const name = this.getNodeName(type) let constModifier = '' let postfix = '' switch (hint) { @@ -435,7 +435,7 @@ export class CppLanguageWriter extends CLikeLanguageWriter { if (receiver !== undefined) { return `std::decay::type` } - return this.stringifyType(type) + return this.getNodeName(type) } override makeSerializerConstructorSignature(): NamedMethodSignature | undefined { return new NamedMethodSignature( diff --git a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts index e10a7244..823b3ac7 100644 --- a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts @@ -36,6 +36,7 @@ import {makeEnumTypeCheckerCall} from "../../printers/TypeCheckPrinter"; import * as idl from "../../../idl" import { convertDeclaration } from "../nameConvertor" import { createDeclarationNameConvertor } from "../../idl/IdlNameConvertor" +import { CppIDLNodeToStringConvertor } from "../convertors/CppConvertors" //////////////////////////////////////////////////////////////// // STATEMENTS // @@ -49,7 +50,7 @@ export class EtsAssignStatement implements LanguageStatement { protected isConst: boolean = true) { } write(writer: LanguageWriter): void { if (this.isDeclared) { - const typeClause = this.type !== undefined ? `: ${writer.stringifyType(this.type)}` : '' + const typeClause = this.type !== undefined ? `: ${writer.getNodeName(this.type)}` : '' const initValue = this.expression !== undefined ? this.expression : writer.makeUndefined() writer.print(`${this.isConst ? "const" : "let"} ${this.variableName} ${typeClause} = ${initValue.asString()}`) } else { @@ -279,7 +280,7 @@ export class ETSLanguageWriter extends TSLanguageWriter { } makeDiscriminatorConvertor(convertor: EnumConvertor, value: string, index: number): LanguageExpression { return this.discriminatorFromExpressions(value, RuntimeType.OBJECT, [ - makeEnumTypeCheckerCall(value, this.stringifyType(convertor.idlType), this) + makeEnumTypeCheckerCall(value, this.getNodeName(convertor.idlType), this) ]) } override castToInt(value: string, bitness: 8 | 32): string { @@ -290,19 +291,20 @@ export class ETSLanguageWriter extends TSLanguageWriter { override instanceOf(convertor: BaseArgConvertor, value: string, duplicateMembers?: Set): LanguageExpression { if (convertor instanceof InterfaceConvertor && convertor.declaration.properties.length > 0) { return makeInterfaceTypeCheckerCall(value, - this.stringifyType(convertor.idlType), + this.getNodeName(convertor.idlType), convertor.declaration.properties.map(it => it.name), duplicateMembers!, this) } if (convertor instanceof AggregateConvertor) { return makeInterfaceTypeCheckerCall(value, - convertor.aliasName !== undefined ? convertor.aliasName : this.stringifyType(convertor.idlType), + convertor.aliasName !== undefined ? convertor.aliasName : this.getNodeName(convertor.idlType), convertor.members.map(it => it[0]), duplicateMembers!, this) } if (convertor instanceof ArrayConvertor) { + const cppConvertor = new CppIDLNodeToStringConvertor(this.resolver) return makeArrayTypeCheckCall(value, - (this.resolver as PeerLibrary).getTypeName(convertor.idlType), this) + cppConvertor.convert(convertor.idlType), this) } if (convertor instanceof EnumConvertor) { return this.makeString(`${value} instanceof ${this.typeConvertor.convert(convertor.enumEntry)}`) diff --git a/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts index 63e1911b..b27e311c 100644 --- a/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/JavaLanguageWriter.ts @@ -91,7 +91,7 @@ export class JavaAssignStatement extends AssignStatement { } write(writer: LanguageWriter): void{ if (this.isDeclared) { - const typeSpec = this.type ? writer.stringifyType(this.type) : "var" + const typeSpec = this.type ? writer.getNodeName(this.type) : "var" writer.print(`${typeSpec} ${this.variableName} = ${this.expression.asString()};`) } else { writer.print(`${this.variableName} = ${this.expression.asString()};`) @@ -124,7 +124,7 @@ export class JavaLanguageWriter extends CLikeLanguageWriter { this.typeConvertor = new JavaIDLNodeToStringConvertor(this.resolver) } - stringifyType(type: idl.IDLType): string { + getNodeName(type: idl.IDLNode): string { return this.typeConvertor.convert(type) } @@ -159,13 +159,13 @@ export class JavaLanguageWriter extends CLikeLanguageWriter { } writeFieldDeclaration(name: string, type: idl.IDLType, modifiers: FieldModifier[] | undefined, optional: boolean, initExpr?: LanguageExpression): void { let prefix = this.makeFieldModifiersList(modifiers) - this.printer.print(`${prefix} ${(this.stringifyType(type))} ${name}${initExpr ? ` = ${initExpr.asString()}` : ""};`) + this.printer.print(`${prefix} ${(this.getNodeName(type))} ${name}${initExpr ? ` = ${initExpr.asString()}` : ""};`) } writeNativeMethodDeclaration(name: string, signature: MethodSignature): void { this.writeMethodDeclaration(name, signature, [MethodModifier.STATIC, MethodModifier.NATIVE]) } writeConstructorImplementation(className: string, signature: MethodSignature, op: (writer: LanguageWriter) => void, superCall?: Method, modifiers?: MethodModifier[]) { - this.printer.print(`${modifiers ? modifiers.map((it) => MethodModifier[it].toLowerCase()).join(' ') : ''} ${className}(${signature.args.map((it, index) => `${this.stringifyType(it)} ${signature.argName(index)}`).join(", ")}) {`) + this.printer.print(`${modifiers ? modifiers.map((it) => MethodModifier[it].toLowerCase()).join(' ') : ''} ${className}(${signature.args.map((it, index) => `${this.getNodeName(it)} ${signature.argName(index)}`).join(", ")}) {`) this.pushIndent() if (superCall) { this.print(`super(${superCall.signature.args.map((_, i) => superCall?.signature.argName(i)).join(", ")});`) @@ -202,7 +202,7 @@ export class JavaLanguageWriter extends CLikeLanguageWriter { return this.makeString(`${map}.size()`) } makeCast(value: LanguageExpression, type: idl.IDLType, options?: MakeCastOptions): LanguageExpression { - return new JavaCastExpression(value, this.stringifyType(type), options?.unsafe ?? false) + return new JavaCastExpression(value, this.getNodeName(type), options?.unsafe ?? false) } makeStatement(expr: LanguageExpression): LanguageStatement { return new CLikeExpressionStatement(expr) @@ -228,7 +228,7 @@ export class JavaLanguageWriter extends CLikeLanguageWriter { } mapIDLContainerType(type: idl.IDLContainerType): string { switch (type.containerKind) { - case "sequence": return `${this.stringifyType(type.elementType[0])}[]` + case "sequence": return `${this.getNodeName(type.elementType[0])}[]` } throw new Error(`Unmapped container type ${idl.DebugUtils.debugPrintType(type)}`) } diff --git a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts index 41b9a320..69fd5280 100644 --- a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts @@ -195,7 +195,7 @@ export class TSLanguageWriter extends LanguageWriter { return new TSLanguageWriter(new IndentedPrinter(), this.resolver, this.language) } - stringifyType(type: idl.IDLType): string { + getNodeName(type: idl.IDLNode): string { return this.typeConvertor.convert(type) } @@ -228,7 +228,7 @@ export class TSLanguageWriter extends LanguageWriter { this.printer.print('}') } private generateFunctionDeclaration(name: string, signature: MethodSignature): string { - const args = signature.args.map((it, index) => `${signature.argName(index)}: ${this.stringifyType(it)}`) + const args = signature.args.map((it, index) => `${signature.argName(index)}: ${this.getNodeName(it)}`) return `export function ${name}(${args.join(", ")})` } writeEnum(name: string, members: { name: string, stringId: string | undefined, numberId: number }[], op: (writer: LanguageWriter) => void): void { @@ -244,7 +244,7 @@ export class TSLanguageWriter extends LanguageWriter { writeFieldDeclaration(name: string, type: idl.IDLType, modifiers: FieldModifier[]|undefined, optional: boolean, initExpr?: LanguageExpression): void { const init = initExpr != undefined ? ` = ${initExpr.asString()}` : `` let prefix = this.makeFieldModifiersList(modifiers) - this.printer.print(`${prefix} ${name}${optional ? "?" : ""}: ${this.stringifyType(type)}${init}`) + this.printer.print(`${prefix} ${name}${optional ? "?" : ""}: ${this.getNodeName(type)}${init}`) } writeMethodDeclaration(name: string, signature: MethodSignature, modifiers?: MethodModifier[]): void { this.writeDeclaration(name, signature, true, false, modifiers) @@ -284,7 +284,7 @@ export class TSLanguageWriter extends LanguageWriter { const typeParams = generics?.length ? `<${generics.join(", ")}>` : "" // FIXME: const isSetter = modifiers?.includes(MethodModifier.SETTER) - this.printer.print(`${prefix}${name}${typeParams}(${signature.args.map((it, index) => `${signature.argName(index)}${idl.isOptionalType(it) && !isSetter ? "?" : ""}: ${this.stringifyType(it)}${signature.argDefault(index) ? ' = ' + signature.argDefault(index) : ""}`).join(", ")})${needReturn ? ": " + this.stringifyType(signature.returnType) : ""} ${needBracket ? "{" : ""}`) + this.printer.print(`${prefix}${name}${typeParams}(${signature.args.map((it, index) => `${signature.argName(index)}${idl.isOptionalType(it) && !isSetter ? "?" : ""}: ${this.getNodeName(it)}${signature.argDefault(index) ? ' = ' + signature.argDefault(index) : ""}`).join(", ")})${needReturn ? ": " + this.getNodeName(signature.returnType) : ""} ${needBracket ? "{" : ""}`) } makeNull(): LanguageExpression { return new StringExpression("undefined") @@ -317,7 +317,7 @@ export class TSLanguageWriter extends LanguageWriter { this.print(`console.log("${message}")`) } makeCast(value: LanguageExpression, type: idl.IDLType, options?: MakeCastOptions): LanguageExpression { - return new TSCastExpression(value, this.stringifyType(/* FIXME: */ idl.maybeOptional(type, false)), options?.unsafe ?? false) + return new TSCastExpression(value, this.getNodeName(/* FIXME: */ idl.maybeOptional(type, false)), options?.unsafe ?? false) } getObjectAccessor(convertor: ArgConvertor, value: string, args?: ObjectArgs): string { if (convertor.useArray && args?.index != undefined) { @@ -335,13 +335,13 @@ export class TSLanguageWriter extends LanguageWriter { return new TsTupleAllocStatement(option) } makeArrayInit(type: idl.IDLContainerType): LanguageExpression { - return this.makeString(`new Array<${this.stringifyType(type.elementType[0])}>()`) + return this.makeString(`new Array<${this.getNodeName(type.elementType[0])}>()`) } makeClassInit(type: idl.IDLType, paramenters: LanguageExpression[]): LanguageExpression { - return this.makeString(`new ${this.stringifyType(type)}(${paramenters.map(it => it.asString()).join(", ")})`) + return this.makeString(`new ${this.getNodeName(type)}(${paramenters.map(it => it.asString()).join(", ")})`) } makeMapInit(type: idl.IDLType): LanguageExpression { - return this.makeString(`new ${this.stringifyType(type)}()`) + return this.makeString(`new ${this.getNodeName(type)}()`) } makeMapInsert(keyAccessor: string, key: string, valueAccessor: string, value: string): LanguageStatement { // keyAccessor and valueAccessor are equal in TS diff --git a/src/peer-generation/OhosGenerator.ts b/src/peer-generation/OhosGenerator.ts index 614d8bea..71112794 100644 --- a/src/peer-generation/OhosGenerator.ts +++ b/src/peer-generation/OhosGenerator.ts @@ -92,7 +92,7 @@ class OHOSVisitor { if (isReferenceType(type) || isEnum(type)) { return `${PrimitiveType.Prefix}${this.libraryName}_${qualifiedName(type, Language.CPP)}` } - return this.hWriter.stringifyType(type) + return this.hWriter.getNodeName(type) } makeSignature(returnType: IDLType, parameters: IDLParameter[]): MethodSignature { @@ -283,8 +283,8 @@ class OHOSVisitor { const className = `${this.libraryName}NativeModule` this.callbacks.forEach(callback => { if (this.library.language === Language.TS) { - const params = callback.parameters.map(it => `${it.name}:${this.nativeWriter.stringifyType(it.type!)}`).join(', ') - const returnTypeName = this.nativeWriter.stringifyType(callback.returnType) + const params = callback.parameters.map(it => `${it.name}:${this.nativeWriter.getNodeName(it.type!)}`).join(', ') + const returnTypeName = this.nativeWriter.getNodeName(callback.returnType) this.nativeWriter.print(`export type ${callback.name} = (${params}) => ${returnTypeName}`) } }) @@ -718,7 +718,7 @@ function generateArgConvertor(library: PeerLibrary, param: IDLParameter): ArgCon function generateCParameters(method: IDLMethod | IDLConstructor, argConvertors: ArgConvertor[], writer: LanguageWriter): string { let args = isConstructor(method) ? [] : [`${PrimitiveType.NativePointer} thisPtr`] for (let i = 0; i < argConvertors.length; ++i) { - const typeName = writer.stringifyType(argConvertors[i].nativeType()) + const typeName = writer.getNodeName(argConvertors[i].nativeType()) const argName = writer.escapeKeyword(method.parameters[i].name) args.push(`const ${typeName}* ${argName}`) } diff --git a/src/peer-generation/PeerLibrary.ts b/src/peer-generation/PeerLibrary.ts index 03a788ce..5f3d3f57 100644 --- a/src/peer-generation/PeerLibrary.ts +++ b/src/peer-generation/PeerLibrary.ts @@ -100,7 +100,7 @@ export class PeerLibrary implements LibraryInterface { return this.createContinuationCallbackReference(continuationType.elementType[0]) const continuationParameters = idl.isVoidType(continuationType) ? [] : [idl.createParameter('value', continuationType)] const syntheticName = generateSyntheticFunctionName( - (type) => cleanPrefix(this.getTypeName(type), PrimitiveType.Prefix), + (type) => cleanPrefix(this.nativeNameConvertorInstance.convert(type), PrimitiveType.Prefix), continuationParameters, idl.IDLVoidType, ) @@ -291,33 +291,6 @@ export class PeerLibrary implements LibraryInterface { getInteropName(node: idl.IDLNode) { return this.interopNameConvertorInstance.convert(node) } - /** @deprecated - * Should be removed ASAP - * Do not use this function if possible, instead use - * `LanguageWriter.stringifyType()` - * or `IdlNameConvertor.convertType` - */ - getTypeName(type: idl.IDLType): string { - return this.nativeNameConvertorInstance.convert(type) - } - - /** @deprecated - * Should be removed ASAP - * Do not use this function if possible, instead use - * `IdlNameConvertor.convertEntry` - */ - getEntryName(entry: idl.IDLEntry): string { - return this.nativeNameConvertorInstance.convert(entry) - } - - /** @deprecated - * Should be removed ASAP - * Do not use this function if possible, instead use - * `IdlNameConvertor.convert` - */ - getNodeName(node:idl.IDLNode): string { - return this.nativeNameConvertorInstance.convert(node) - } toDeclaration(type: idl.IDLType | idl.IDLTypedef | idl.IDLCallback | idl.IDLEnum | idl.IDLInterface): idl.IDLEntry | idl.IDLType { switch (type) { diff --git a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts index f816c8a4..3d6c916d 100644 --- a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts +++ b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts @@ -32,8 +32,8 @@ import { PeerMethod } from "../PeerMethod" import { PeerFile } from "../PeerFile" import { PeerLibrary } from "../PeerLibrary" import { MaterializedClass, MaterializedField, MaterializedMethod, SuperElement } from "../Materialized" -import { Field, FieldModifier, Method, MethodModifier, NamedMethodSignature } from "../LanguageWriters"; -import { convertDeclaration } from "../LanguageWriters/nameConvertor"; +import { createTypeNameConvertor, Field, FieldModifier, Method, MethodModifier, NamedMethodSignature } from "../LanguageWriters"; +import { convertDeclaration, IdlNameConvertor } from "../LanguageWriters/nameConvertor"; import { isSyntheticDeclaration, makeSyntheticDeclCompletely, @@ -289,7 +289,7 @@ class ArkTSImportsAggregateCollector extends ImportsAggregateCollector { override convertContainer(type: idl.IDLContainerType): idl.IDLNode[] { if (idl.IDLContainerUtils.isSequence(type)) { // todo: check this.peerLibrary instanceof IdlPeerLibrary) - this.peerLibrary.seenArrayTypes.set(this.peerLibrary.getTypeName(type), type) + this.peerLibrary.seenArrayTypes.set(this.peerLibrary.getInteropName(type), type) } return super.convertContainer(type) } @@ -310,11 +310,13 @@ class ArkTSImportsAggregateCollector extends ImportsAggregateCollector { //////////////////////////////////////////////////////////////// class JavaDependenciesCollector extends DependenciesCollector { + private nameConverter: IdlNameConvertor constructor( library: PeerLibrary, private expandAliases: boolean, ) { super(library) + this.nameConverter = createTypeNameConvertor(Language.JAVA, library) } private ignoredTypes: Set = new Set() @@ -349,7 +351,7 @@ class JavaDependenciesCollector extends DependenciesCollector { override convertUnion(type: idl.IDLUnionType): idl.IDLNode[] { if (!this.ignoredType(type)) { - const typeName = this.library.mapType(type) + const typeName = this.nameConverter.convert(type) this.onNewSyntheticTypeAlias(typeName, type) } @@ -361,7 +363,7 @@ class JavaDependenciesCollector extends DependenciesCollector { } override convertImport(type: idl.IDLReferenceType, importClause: string): idl.IDLNode[] { - const generatedName = this.library.mapType(type) + const generatedName = this.nameConverter.convert(type) this.onNewSyntheticInterface(generatedName, ARK_CUSTOM_OBJECT) return super.convertImport(type, importClause) } @@ -401,7 +403,7 @@ class JavaDependenciesCollector extends DependenciesCollector { if (!isTuple) throw new Error('Only tuples supported from IDL synthetic types for now') if (!this.ignoredType(type)) { - const typeName = this.library.mapType(type) + const typeName = this.nameConverter.convert(type) this.onNewSyntheticTypeAlias(typeName, type) } @@ -439,11 +441,13 @@ class JavaDependenciesCollector extends DependenciesCollector { //////////////////////////////////////////////////////////////// class CJDependenciesCollector extends DependenciesCollector { + private nameConverter: IdlNameConvertor constructor( library: PeerLibrary, private readonly expandAliases: boolean, ) { super(library) + this.nameConverter = createTypeNameConvertor(Language.CJ, this.library) } convertInterface(decl: idl.IDLInterface): idl.IDLNode[] { @@ -503,7 +507,7 @@ class CJDependenciesCollector extends DependenciesCollector { override convertUnion(type: idl.IDLUnionType): idl.IDLNode[] { if (!this.ignoredType(type)) { - const typeName = this.library.mapType(type) + const typeName = this.nameConverter.convert(type) this.onNewSyntheticTypeAlias(typeName, type) } @@ -515,7 +519,7 @@ class CJDependenciesCollector extends DependenciesCollector { } override convertImport(type: idl.IDLReferenceType, importClause: string): idl.IDLNode[] { - const generatedName = this.library.mapType(type) + const generatedName = this.nameConverter.convert(type) this.onNewSyntheticInterface(generatedName, ARK_CUSTOM_OBJECT) return super.convertImport(type, importClause) } @@ -555,7 +559,7 @@ class CJDependenciesCollector extends DependenciesCollector { if (!isTuple) throw new Error('Only tuples supported from IDL synthetic types for now') if (!this.ignoredType(decl)) { - const typeName = this.library.mapType(type) + const typeName = this.nameConverter.convert(type) const ref = idl.createReferenceType(decl.name) this.onNewSyntheticTypeAlias(typeName, ref) } diff --git a/src/peer-generation/printers/BridgeCcPrinter.ts b/src/peer-generation/printers/BridgeCcPrinter.ts index 6e983296..dcdb8bf1 100644 --- a/src/peer-generation/printers/BridgeCcPrinter.ts +++ b/src/peer-generation/printers/BridgeCcPrinter.ts @@ -107,7 +107,7 @@ class BridgeCcVisitor { let result = `${it.param}_value` this.generatedApi.writeStatement(it.convertorDeserialize(`${result}_buf`, `thisDeserializer`, (expr) => { return new ExpressionStatement(this.generatedApi.makeString( - `${this.generatedApi.stringifyType(it.nativeType())} ${result} = ${expr.asString()};` + `${this.generatedApi.getNodeName(it.nativeType())} ${result} = ${expr.asString()};` )) }, this.generatedApi)) } diff --git a/src/peer-generation/printers/ComponentsPrinter.ts b/src/peer-generation/printers/ComponentsPrinter.ts index fb6a1e6c..50fda6ee 100644 --- a/src/peer-generation/printers/ComponentsPrinter.ts +++ b/src/peer-generation/printers/ComponentsPrinter.ts @@ -128,7 +128,7 @@ class TSComponentFileVisitor implements ComponentFileVisitor { private printComponent(peer: PeerClass) { const callableMethods = peer.methods.filter(it => it.isCallSignature).map(it => it.method) const callableMethod = callableMethods.length ? collapseSameNamedMethods(callableMethods) : undefined - const mappedCallableParams = callableMethod?.signature.args.map((it, index) => `${callableMethod.signature.argName(index)}${isOptionalType(it) ? "?" : ""}: ${this.printer.stringifyType(it)}`) + const mappedCallableParams = callableMethod?.signature.args.map((it, index) => `${callableMethod.signature.argName(index)}${isOptionalType(it) ? "?" : ""}: ${this.printer.getNodeName(it)}`) const mappedCallableParamsValues = callableMethod?.signature.args.map((_, index) => callableMethod.signature.argName(index)) const componentClassName = generateArkComponentName(peer.componentName) const parentComponentClassName = peer.parentComponentName ? generateArkComponentName(peer.parentComponentName!) : `ComponentBase` diff --git a/src/peer-generation/printers/EventsPrinter.ts b/src/peer-generation/printers/EventsPrinter.ts index 3863fb03..c00fae97 100644 --- a/src/peer-generation/printers/EventsPrinter.ts +++ b/src/peer-generation/printers/EventsPrinter.ts @@ -306,7 +306,7 @@ class IdlCEventsVisitor extends CEventsVisitorBase { protected override printEventMethodDeclaration(event: IdlCallbackInfo) { const args = ["Ark_Int32 nodeId", ...event.args.map(it => - `const ${this.impl.stringifyType(idl.maybeOptional(this.library.typeConvertor(it.name, it.type, it.nullable).nativeType(), it.nullable))} ${it.name}`)] + `const ${this.impl.getNodeName(idl.maybeOptional(this.library.typeConvertor(it.name, it.type, it.nullable).nativeType(), it.nullable))} ${it.name}`)] printMethodDeclaration(this.impl.printer, "void", `${event.methodName}Impl`, args) } diff --git a/src/peer-generation/printers/InterfacePrinter.ts b/src/peer-generation/printers/InterfacePrinter.ts index 5925687d..e4648a3a 100644 --- a/src/peer-generation/printers/InterfacePrinter.ts +++ b/src/peer-generation/printers/InterfacePrinter.ts @@ -76,7 +76,7 @@ export class TSDeclConvertor implements DeclarationConvertor { throw "Enums are processed separately" } convertTypedef(node: idl.IDLTypedef): void { - this.writer.print(`export declare type ${node.name} = ${this.writer.stringifyType(node.type)};`) + this.writer.print(`export declare type ${node.name} = ${this.writer.getNodeName(node.type)};`) } protected replaceImportTypeNodes(text: string): string {///operate on stringOrNone[] for (const [stub, src] of [...this.peerLibrary.importTypesStubToSource.entries()].reverse()) { @@ -438,7 +438,7 @@ export class ArkTSDeclConvertor extends TSDeclConvertor { private seenInterfaceNames = new Set() convertTypedef(node: idl.IDLTypedef) { - const type = this.peerLibrary.mapType(node.type) + const type = this.typeNameConvertor.getNodeName(node.type) const typeParams = this.printTypeParameters(node.typeParameters) // TODO: needs to be implemented correctly on the idl side if (node.name === "Resource") { @@ -590,7 +590,7 @@ export class ArkTSDeclConvertor extends TSDeclConvertor { } private convertType(idlType: idl.IDLType): string { - return this.typeNameConvertor.stringifyType(idlType) + return this.typeNameConvertor.getNodeName(idlType) } private printCallback(node: idl.IDLCallback | idl.IDLInterface, @@ -722,7 +722,7 @@ class CJDeclarationConvertor implements DeclarationConvertor { const param = 'param' for (const [index, memberType] of members.entries()) { const memberName = `value${index}` - writer.writeFieldDeclaration(memberName, memberType, [FieldModifier.PRIVATE], true, writer.makeString(`None<${writer.stringifyType(memberType)}>`)) + writer.writeFieldDeclaration(memberName, memberType, [FieldModifier.PRIVATE], true, writer.makeString(`None<${writer.getNodeName(memberType)}>`)) writer.writeConstructorImplementation( 'init', diff --git a/src/peer-generation/printers/NativeModuleRecorderPrinter.ts b/src/peer-generation/printers/NativeModuleRecorderPrinter.ts index 1a65a66d..62923889 100644 --- a/src/peer-generation/printers/NativeModuleRecorderPrinter.ts +++ b/src/peer-generation/printers/NativeModuleRecorderPrinter.ts @@ -65,7 +65,7 @@ class NativeModuleRecorderVisitor { this.nativeModuleRecorder.writeInterface(`${clazz.componentName}Interface`, w => { for (const method of clazz.methods) { for (const arg of method.argConvertors) { - w.print(`${method.overloadedName}_${arg.param}?: ${w.stringifyType(arg.idlType)}`) + w.print(`${method.overloadedName}_${arg.param}?: ${w.getNodeName(arg.idlType)}`) } } }, clazz.parentComponentName ? [`${clazz.parentComponentName}Interface`, `UIElement`] : undefined) @@ -318,7 +318,7 @@ class NativeModuleRecorderVisitor { printConstructor(writer: LanguageWriter) { const [paramType] = this.library.factory.generateCallback( - (type) => writer.stringifyType(type), + (type) => writer.getNodeName(type), [createParameter('type', IDLI32Type)], IDLStringType ) diff --git a/src/peer-generation/printers/OverloadsPrinter.ts b/src/peer-generation/printers/OverloadsPrinter.ts index 8887513b..7dfc4629 100644 --- a/src/peer-generation/printers/OverloadsPrinter.ts +++ b/src/peer-generation/printers/OverloadsPrinter.ts @@ -178,7 +178,7 @@ export class OverloadsPrinter { ) ) } - this.printer.print(`const ${castedArgName} = ${argName} as (${this.printer.stringifyType(castedType)})`) + this.printer.print(`const ${castedArgName} = ${argName} as (${this.printer.getNodeName(castedType)})`) return castedArgName }) const isStatic = collapsedMethod.modifiers?.includes(MethodModifier.STATIC) diff --git a/src/peer-generation/printers/PeersPrinter.ts b/src/peer-generation/printers/PeersPrinter.ts index 73da1ed6..bd3a6ebc 100644 --- a/src/peer-generation/printers/PeersPrinter.ts +++ b/src/peer-generation/printers/PeersPrinter.ts @@ -197,7 +197,7 @@ class PeerFileVisitor { printer.print(`applyAttributes(attributes: ${typeParam}): void {}`) return } - printer.print(`applyAttributes(attributes: T): ${printer.stringifyType(IDLVoidType)} {`) + printer.print(`applyAttributes(attributes: T): ${printer.getNodeName(IDLVoidType)} {`) printer.pushIndent() printer.print(`super.applyAttributes(attributes)`) printer.popIndent() diff --git a/src/peer-generation/printers/SerializerPrinter.ts b/src/peer-generation/printers/SerializerPrinter.ts index e26e2322..ac293701 100644 --- a/src/peer-generation/printers/SerializerPrinter.ts +++ b/src/peer-generation/printers/SerializerPrinter.ts @@ -306,7 +306,7 @@ class IdlDeserializerPrinter {///converge w/ IdlSerP? return if (PeerGeneratorConfig.ignoredCallbacks.has(target.name)) return - const methodName = this.library.getEntryName(target) + const methodName = this.library.getInteropName(target) const type = idl.createReferenceType(target.name) this.writer.writeMethodImplementation(new Method(`read${methodName}`, new NamedMethodSignature(type, [], [])), writer => { const resourceName = "_resource" diff --git a/src/peer-generation/printers/StructPrinter.ts b/src/peer-generation/printers/StructPrinter.ts index 795c7dc3..c72b7c24 100644 --- a/src/peer-generation/printers/StructPrinter.ts +++ b/src/peer-generation/printers/StructPrinter.ts @@ -77,7 +77,7 @@ export class StructPrinter { continue } const targetType = idl.isType(target) ? target : idl.createReferenceType(idl.forceAsNamedNode(target).name) - let nameAssigned = this.library.getNodeName(target) + let nameAssigned = structs.getNodeName(target) if (nameAssigned === 'Tag') continue if (!nameAssigned) { @@ -114,7 +114,7 @@ export class StructPrinter { concreteDeclarations.print("union {") concreteDeclarations.pushIndent() target.types.forEach((it, index) => - concreteDeclarations.print(`${this.library.getTypeName(it)} value${index};`)) + concreteDeclarations.print(`${structs.getNodeName(it)} value${index};`)) concreteDeclarations.popIndent() concreteDeclarations.print("};") } else if (idl.isClass(target) || idl.isInterface(target) || idl.isAnonymousInterface(target) || idl.isTupleInterface(target)) { @@ -125,7 +125,7 @@ export class StructPrinter { properties.forEach(it => { // TODO Change to // concreteDeclarations.print(`${this.library.computeTargetName(it.type, it.isOptional)} ${concreteDeclarations.escapeKeyword(it.name)};`) - concreteDeclarations.print(`${this.library.getTypeName(idl.maybeOptional(it.type, it.isOptional))} ${concreteDeclarations.escapeKeyword(it.name)};`) + concreteDeclarations.print(`${structs.getNodeName(idl.maybeOptional(it.type, it.isOptional))} ${concreteDeclarations.escapeKeyword(it.name)};`) }) } else if (idl.isContainerType(target)) { let fieldNames: string[] = [] @@ -137,7 +137,7 @@ export class StructPrinter { fieldNames = ["keys", "values"] } target.elementType.forEach((it, index) => { - concreteDeclarations.print(`${this.library.getTypeName(it)}* ${fieldNames[index]};`) + concreteDeclarations.print(`${structs.getNodeName(it)}* ${fieldNames[index]};`) }) if (idl.IDLContainerUtils.isSequence(target)) { concreteDeclarations.print(`${PrimitiveType.Int32.getText()} length;`) @@ -178,10 +178,10 @@ export class StructPrinter { seenNames: Set, ) { const isPointer = this.isPointerDeclaration(target) - const nameAssigned = this.library.getNodeName(target) + const nameAssigned = concreteDeclarations.getNodeName(target) const nameOptional = idl.isType(target) - ? this.library.getTypeName(idl.createOptionalType(target)) - : PrimitiveType.OptionalPrefix + cleanPrefix(this.library.getEntryName(target as idl.IDLEntry), PrimitiveType.Prefix) + ? concreteDeclarations.getNodeName(idl.createOptionalType(target)) + : PrimitiveType.OptionalPrefix + cleanPrefix(concreteDeclarations.getNodeName(target as idl.IDLEntry), PrimitiveType.Prefix) if (seenNames.has(nameOptional)) { return } @@ -229,7 +229,7 @@ export class StructPrinter { for (let i = 0; i < target.types.length; i++) { writer.print(`case ${i}: return runtimeType(value.value${i});`) } - writer.print(`default: throw "Bad selector in ${writer.stringifyType(targetType)}: " + std::to_string(value.selector);`) + writer.print(`default: throw "Bad selector in ${writer.getNodeName(targetType)}: " + std::to_string(value.selector);`) writer.popIndent() writer.print("}") } @@ -299,7 +299,7 @@ export class StructPrinter { private generateArrayWriteToString(name: string, target: idl.IDLContainerType, printer: LanguageWriter) { let convertor = this.library.typeConvertor("param", target.elementType[0]) let isPointerField = convertor.isPointerType() - let elementNativeType = this.library.getTypeName(convertor.nativeType()) + let elementNativeType = printer.getNodeName(convertor.nativeType()) let constCast = isPointerField ? `(const ${elementNativeType}*)` : `` printer.print( @@ -329,8 +329,8 @@ inline void WriteToString(std::string* result, const ${name}* value) { const valueConvertor = this.library.typeConvertor("_", valueType) let isPointerKeyField = keyConvertor.isPointerType() let isPointerValueField = valueConvertor.isPointerType() - let keyNativeType = this.library.getTypeName(keyConvertor.nativeType()) - let valueNativeType = this.library.getTypeName(valueConvertor.nativeType()) + let keyNativeType = printer.getNodeName(keyConvertor.nativeType()) + let valueNativeType = printer.getNodeName(valueConvertor.nativeType()) let keyConstCast = isPointerKeyField ? `(const ${keyNativeType}*)` : `` let valueConstCast = isPointerValueField ? `(const ${valueNativeType}*)` : `` @@ -401,7 +401,7 @@ inline void WriteToString(std::string* result, const ${name}* value) { printer.print(`result->append(", ");`); target.types.forEach((type, index) => { const isPointerField = this.isPointerDeclaration(this.library.toDeclaration(type)) - printer.print(`// ${this.library.getTypeName(type)}`) + printer.print(`// ${printer.getNodeName(type)}`) printer.print(`if (value${access}selector == ${index}) {`) printer.pushIndent() printer.print(`result->append(".value${index}=");`); @@ -414,7 +414,7 @@ inline void WriteToString(std::string* result, const ${name}* value) { printer.print(`result->append("{");`) collectProperties(target, this.library) .forEach((field, index) => { - printer.print(`// ${this.library.getTypeName(field.type)} ${field.name}`) + printer.print(`// ${printer.getNodeName(field.type)} ${field.name}`) let isPointerField = this.isPointerDeclaration(this.library.toDeclaration(field.type), field.isOptional) if (index > 0) printer.print(`result->append(", ");`) printer.print(`result->append(".${field.name}=");`) @@ -425,7 +425,7 @@ inline void WriteToString(std::string* result, const ${name}* value) { printer.print(`result->append("{");`) collectProperties(target, this.library) .forEach((field, index) => { - printer.print(`// ${this.library.getTypeName(field.type)} ${field.name}`) + printer.print(`// ${printer.getNodeName(field.type)} ${field.name}`) if (index > 0) printer.print(`result->append(", ");`) printer.print(`result->append("${field.name}: ");`) const isPointerField = this.isPointerDeclaration(this.library.toDeclaration(field.type), field.isOptional) @@ -442,7 +442,7 @@ inline void WriteToString(std::string* result, const ${name}* value) { printer.print(`result->append("{");`) collectProperties(target, this.library) .forEach((field, index) => { - printer.print(`// ${this.library.getTypeName(field.type)} ${field.name}`) + printer.print(`// ${printer.getNodeName(field.type)} ${field.name}`) if (index > 0) printer.print(`result->append(", ");`) printer.print(`result->append(".${field.name}=");`) let isPointerField = this.isPointerDeclaration(this.library.toDeclaration(field.type), field.isOptional) diff --git a/src/peer-generation/printers/TypeCheckPrinter.ts b/src/peer-generation/printers/TypeCheckPrinter.ts index 3f06cae9..b1b79d8d 100644 --- a/src/peer-generation/printers/TypeCheckPrinter.ts +++ b/src/peer-generation/printers/TypeCheckPrinter.ts @@ -209,7 +209,7 @@ class ARKTSTypeCheckerPrinter extends TypeCheckerPrinter { } protected writeArrayChecker(typeName: string, type: idl.IDLType): void { - this.writeInstanceofChecker(this.library.mapType(type), generateTypeCheckerName(typeName), 0) + this.writeInstanceofChecker(this.writer.getNodeName(type), generateTypeCheckerName(typeName), 0) } } diff --git a/src/skoala-generation/idl/idlSkoalaLibrary.ts b/src/skoala-generation/idl/idlSkoalaLibrary.ts index 55290dcc..bee64895 100644 --- a/src/skoala-generation/idl/idlSkoalaLibrary.ts +++ b/src/skoala-generation/idl/idlSkoalaLibrary.ts @@ -64,6 +64,8 @@ export class IdlSkoalaLibrary implements LibraryInterface { readonly typeMap = new Map() public name: string = "" + public language = Language.TS + public readonly files: IldSkoalaFile[] = [] findFileByOriginalFilename(filename: string): IldSkoalaFile | undefined { return this.files.find(it => it.originalFilename === filename) @@ -285,7 +287,7 @@ export class IdlWrapperClassConvertor extends BaseArgConvertor { } override unionDiscriminator(value: string, index: number, writer: LanguageWriter, duplicates: Set): LanguageExpression | undefined { return writer.discriminatorFromExpressions(value, RuntimeType.OBJECT, - [writer.makeString(`${value} instanceof ${writer.stringifyType(this.idlType)}`)]) + [writer.makeString(`${value} instanceof ${writer.getNodeName(this.idlType)}`)]) } } -- Gitee From 696e50afd99041ced4e38748fffc0c69bf3942d9 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Tue, 19 Nov 2024 12:01:31 +0000 Subject: [PATCH 33/53] !989 Callbacks and deferred API --- external | 2 +- native/meson.build | 2 +- package.json | 5 +- peer_lib/call_log/meson.build | 2 +- peer_lib/sig/arkoala/loader/loader.ts | 199 ----------------------- rollup.config.dummy-panda.mjs | 2 +- templates/arkoala_api_prologue.h | 7 + templates/arkoala_node_api.h | 16 +- templates/arkts/NativeModule_template.ts | 12 +- templates/bridge_custom_prologue.cc | 13 +- templates/dummy_impl_epilogue.cc | 1 + templates/dummy_impl_prologue.cc | 22 ++- templates/library_template.cc | 6 +- tsconfig-loader.json | 4 +- 14 files changed, 60 insertions(+), 233 deletions(-) delete mode 100644 peer_lib/sig/arkoala/loader/loader.ts diff --git a/external b/external index e274b827..675b0eaf 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit e274b827bdff63bac1e1674bce0f1864d0d33b8d +Subproject commit 675b0eafd975fa4d8686ba1feba59846dcbe7a8d diff --git a/native/meson.build b/native/meson.build index bb4178e6..539d8eb8 100644 --- a/native/meson.build +++ b/native/meson.build @@ -107,7 +107,7 @@ libace_sources = [ endif node_library_name = 'NativeBridgeNapi' -arkts_library_name = 'NativeBridgeArk' +arkts_library_name = 'ArkoalaNative_ark' jni_library_name = 'NativeBridgeJni' cj_library_name = 'NativeBridgeCJ' ohos_library_name = 'NativeBridge_ohos' diff --git a/package.json b/package.json index 8eeefd09..fa4eb5c3 100644 --- a/package.json +++ b/package.json @@ -118,11 +118,8 @@ "run:java": "npm run compile:java && npm run compile:native-node-host-java-subset && ACE_LIBRARY_PATH=./native java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Main", "run:java:concurrent": "npm run compile:java && npm run compile:native-node-host-java-subset && java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Concurrent", "compile:dummy-panda": "npm run compile:java && npm run rollup:host:subset && cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs", - "run:dummy-panda:java": "npm run compile:java && npm run compile:native-node-host-java-subset && java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Application", - "run:dummy-panda:panda": "rimraf build && npm run make:arkts && bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-application.json && npm run compile:native-node-host-arkts-subset && LD_LIBRARY_PATH=./native PANDA_LIB_PATH=./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/ bash ./external/incremental/tools/panda/arkts/ark --ark-boot-files ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/Application.abc", "run:app:java": "npm run compile:dummy-panda && ACE_LIBRARY_PATH=./native node lib/loader.js java", - "run:app:panda": "cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs && npm run compile:all:arkts && PANDA_HOME=./external/incremental/tools/panda/node_modules/@panda/sdk ACE_LIBRARY_PATH=./native node lib/loader.js panda", - "run:es2panda": "npm run compile && npm run compile:dummy-panda && node lib/loader.js es2panda", + "run:app:panda": "cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs && npm run compile:all:arkts:idl && PANDA_HOME=./external/incremental/tools/panda/node_modules/@panda/sdk ACE_LIBRARY_PATH=./native node lib/loader.js panda", "compile:native-ohos-subset-arm32": "npm run check:subset && node ./native/nativeBuild.mjs subset arm32", "compile:native-ohos-subset-arm64": "npm run check:subset && node ./native/nativeBuild.mjs subset arm64", "compile:native-ohos-full-arm32": "npm run check:peers && node ./native/nativeBuild.mjs full arm32", diff --git a/peer_lib/call_log/meson.build b/peer_lib/call_log/meson.build index 9d6019a4..5719da98 100644 --- a/peer_lib/call_log/meson.build +++ b/peer_lib/call_log/meson.build @@ -7,7 +7,7 @@ sources = [ ] CXX = meson.get_compiler('cpp') deps = CXX.find_library( - 'NativeBridgeArk', + 'ArkoalaNative_ark', dirs : [meson.current_source_dir() + '/../../native/'] ) # for subset: diff --git a/peer_lib/sig/arkoala/loader/loader.ts b/peer_lib/sig/arkoala/loader/loader.ts deleted file mode 100644 index 104e0466..00000000 --- a/peer_lib/sig/arkoala/loader/loader.ts +++ /dev/null @@ -1,199 +0,0 @@ -/* -* Copyright (c) 2024 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 { env } from "node:process" -import { int32 } from "@koalaui/common" -import { Worker, isMainThread, parentPort } from "node:worker_threads" -import { callCallback, wrapCallback } from "./CallbackRegistry" -import { KInt, KPointer, KUint8ArrayPtr, pointer } from "./types" - -export interface LoaderOps { - _LoadVirtualMachine(vmKind: int32, appClassPath: string, appLibPath: string): int32 - _StartApplication(arg0: string, arg1: string): KPointer - _RunApplication(arg0: int32, arg1: int32): boolean - _SetCallbackDispatcher(dispatcher: (id: int32, args: Uint8Array, length: int32) => int32): void -} - -// todo: for control VSYNC -export interface NativeControl extends LoaderOps { - // todo: implement native methods - _GetPipelineContext(ptr0: KPointer): KPointer - _SetVsyncCallback(ptr0: KPointer, arg: KInt): void - _UnblockVsyncWait(ptr0: KPointer): void -} - -let theModule: NativeControl | undefined = undefined - -declare const LOAD_NATIVE: NativeControl - -export function nativeModule(): NativeControl { - if (theModule) return theModule - theModule = LOAD_NATIVE as NativeControl - if (!theModule) - throw new Error("Cannot load native module") - theModule._SetCallbackDispatcher(callCallback) - return theModule -} - -let rootPointer: KPointer - -function getNativePipelineContext(): KPointer { - const root = rootPointer - return nativeModule()._GetPipelineContext(root!) -} - -function waitVSync(pipelineContext: KPointer): Promise { - return new Promise((resolve, reject) => { - nativeModule()._SetVsyncCallback(pipelineContext, wrapCallback((args: KUint8ArrayPtr, length: int32) => { - if (args instanceof Uint8Array) { - const values = new Int32Array(args.buffer) - if (values[0] != 0) - resolve() - } else - reject(new Error("vsync failed")) - return 0 - })) - }) -} - -function delay(ms: int32): Promise { - return new Promise(resolve => setTimeout(resolve, ms)) -} - -const useDelayAsVsync = true - -export async function runEventLoop() { - const pipelineContext = getNativePipelineContext() - let vsync = useDelayAsVsync ? () => delay(500) : () => waitVSync(pipelineContext) - while (!nativeModule()._RunApplication(0, 0)) { - await vsync() - } -} - -function runEs2Panda(msg: WorkerRequest): WorkerResponse { - console.log(`JS: es2panda ${msg.files}`) - return { - id: msg.id, - result: nativeModule()._LoadVirtualMachine(3, msg.files.join(","), msg.nativePath) - } -} - -let workers = new Array() -let requests = new Map void>() -let requestId = 0 - -interface WorkerRequest { - kind: string - id: int32 - files: string[] - nativePath: string -} - -interface WorkerResponse { - id: int32 - result: int32 -} - -function compile(worker: Worker, nativePath: string, index: int32): Promise { - return new Promise(resolve => { - let id = requestId++ - requests.set(id, (result: int32) => { - resolve(result) - requests.delete(id) - }) - worker.postMessage({ - kind: "compile", - id: id, - nativePath: nativePath, - files: [`file${index}.sts`, `shmile${index}.sts`] - }) - }) -} - -function runEs2PandaMain(nativePath: string): int32 { - if (!isMainThread) return 0 - - for (let i = 0; i < 10; i++) { - workers.push(new Worker(__filename)) - workers[i].on("message", (response: WorkerResponse) => { - requests.get(response.id)!(response.result) - }) - } - setTimeout(async () => { - await Promise.all( - workers.map((worker, index) => compile(worker, nativePath, index))) - workers.forEach(worker => worker.terminate()) - }, 0) - return 0 -} - -export function initWorker() { - // Here we're in the worker. - parentPort!.addListener("message", (request: WorkerRequest) => { - processRequest(request) - .then((response) => { - parentPort!.postMessage(response) - }) - }) - - function processRequest(request: WorkerRequest): Promise { - return new Promise((resolve, reject) => { - if (request.kind == "compile") { - resolve(runEs2Panda(request)) - } else { - reject(`Unknown request: ${request}`) - } - }) - } -} - -export function checkLoader(variant: string): int32 { - let vm = -1 - let classPath = "" - let nativePath = __dirname + "/../native" - env.ACE_LIBRARY_PATH = nativePath - - switch (variant) { - case 'java': { - vm = 1 - classPath = __dirname + "/../out/java-subset/bin" - break - } - case 'panda': { - vm = 2 - classPath = __dirname + "/../external/arkoala-arkts/build" - break - } - case 'es2panda': { - vm = 3 - return runEs2PandaMain(nativePath) - } - } - let result = nativeModule()._LoadVirtualMachine(vm, classPath, nativePath) - - if (result == 0) { - rootPointer = nativeModule()._StartApplication("LoaderApp", "LoaderAppParams"); - setTimeout(async () => runEventLoop(), 0) - } else { - throw new Error(`Cannot start VM: ${result}`) - } - - return result -} - -if (isMainThread) { - checkLoader(process.argv.length >= 1 ? process.argv[process.argv.length - 1] : "java") -} else { - initWorker() -} \ No newline at end of file diff --git a/rollup.config.dummy-panda.mjs b/rollup.config.dummy-panda.mjs index a53f320d..a1f23a1a 100644 --- a/rollup.config.dummy-panda.mjs +++ b/rollup.config.dummy-panda.mjs @@ -34,7 +34,7 @@ function crossPathRelative(from, to) { const mode = process.env.mode console.log(`rollup args: mode = ${mode}`) -const arkoalaLoaderSrcDir = `peer_lib/sig/arkoala/loader` +const arkoalaLoaderSrcDir = `external/arkoala-arkts/loader/src` const tsconfigFile = path.resolve(`tsconfig-loader.json`) const outDir = path.resolve('lib') diff --git a/templates/arkoala_api_prologue.h b/templates/arkoala_api_prologue.h index 6d308256..d3d64b67 100644 --- a/templates/arkoala_api_prologue.h +++ b/templates/arkoala_api_prologue.h @@ -85,6 +85,13 @@ struct _Ark_Node; typedef struct _Ark_Node* Ark_NodeHandle; struct _Ark_Canvas; typedef struct _Ark_Canvas* Ark_CanvasHandle; +typedef struct Ark_Deferred { + void* handler; + void* context; + void (*resolve)(struct Ark_Deferred* thiz, uint8_t* data, int32_t length); + void (*reject)(struct Ark_Deferred* thiz, const char* message); + void (*release)(struct Ark_Deferred* thiz); +} Ark_Deferred; enum Ark_APINodeFlags { %CPP_PREFIX%CUSTOM_NONE = 0, diff --git a/templates/arkoala_node_api.h b/templates/arkoala_node_api.h index c1f42709..21da1083 100644 --- a/templates/arkoala_node_api.h +++ b/templates/arkoala_node_api.h @@ -69,7 +69,7 @@ typedef struct ServiceLogger { } ServiceLogger; typedef struct GenericServiceAPI { - Ark_Int32 version; + int32_t version; void (*setLogger)(const ServiceLogger* logger); } GenericServiceAPI; @@ -136,18 +136,16 @@ typedef struct %CPP_PREFIX%ArkUIExtendedNodeAPI { /// Vsync support Ark_PipelineContext (*getPipelineContext)(Ark_NodeHandle node); - void (*setVsyncCallback)(Ark_VMContext vmContext, - Ark_PipelineContext pipelineContext, - Ark_Int32 callbackId); + void (*setVsyncCallback)(Ark_PipelineContext pipelineContext, + Ark_Deferred* deferred); void (*unblockVsyncWait)(Ark_VMContext vmContext, Ark_PipelineContext pipelineContext); - void (*setChildTotalCount)(Ark_NodeHandle node, - Ark_Int32 totalCount); - - /// Error reporting. - void (*showCrash)(Ark_CharPtr message); + void (*setChildTotalCount)(Ark_NodeHandle node, + Ark_Int32 totalCount); + /// Error reporting. + void (*showCrash)(Ark_CharPtr message); } %CPP_PREFIX%ArkUIExtendedNodeAPI; /** diff --git a/templates/arkts/NativeModule_template.ts b/templates/arkts/NativeModule_template.ts index 37d1cfb7..2def50d1 100644 --- a/templates/arkts/NativeModule_template.ts +++ b/templates/arkts/NativeModule_template.ts @@ -15,14 +15,14 @@ import { callCallback } from "../CallbackRegistry" import { int32 } from "@koalaui/common" -import { +import { KBoolean, KUInt, - KInt, + KInt, KLong, KFloat, - KPointer, - KStringPtr, + KPointer, + KStringPtr, KUint8ArrayPtr, KInt32ArrayPtr, KFloat32ArrayPtr, @@ -41,8 +41,8 @@ export function nativeModule(): NativeModule { export class NativeModule { static { - loadLibrary("NativeBridgeArk") - NativeModule.init(); + loadLibrary("ArkoalaNative_ark") + NativeModule.init() } static native init(): void; diff --git a/templates/bridge_custom_prologue.cc b/templates/bridge_custom_prologue.cc index 29f1a84a..3d9fb744 100644 --- a/templates/bridge_custom_prologue.cc +++ b/templates/bridge_custom_prologue.cc @@ -343,13 +343,16 @@ void impl_SetLazyItemIndexer(KVMContext vmContext, Ark_NativePointer nodePtr, Ar } KOALA_INTEROP_CTX_V2(SetLazyItemIndexer, Ark_NativePointer, Ark_Int32) -void impl_SetVsyncCallback(KVMContext vmContext, Ark_NativePointer pipelineContext, Ark_Int32 callbackId) + +KVMObjectHandle impl_VSyncAwait(KVMContext vmContext, Ark_NativePointer pipelineContext) { - Ark_VMContext vmContextCast = (Ark_VMContext) vmContext; Ark_PipelineContext pipelineContextCast = (Ark_PipelineContext) pipelineContext; - GetArkUIExtendedNodeAPI()->setVsyncCallback(vmContextCast, pipelineContextCast, callbackId); + KVMObjectHandle result = nullptr; + KVMDeferred* deferred = CreateDeferred(vmContext, &result); + GetArkUIExtendedNodeAPI()->setVsyncCallback(pipelineContextCast, (Ark_Deferred*)deferred); + return result; } -KOALA_INTEROP_CTX_V2(SetVsyncCallback, Ark_NativePointer, Ark_Int32) +KOALA_INTEROP_CTX_1(VSyncAwait, KVMObjectHandle, Ark_NativePointer) void impl_UnblockVsyncWait(KVMContext vmContext, Ark_NativePointer pipelineContext) { @@ -495,7 +498,7 @@ KVMObjectHandle impl_LoadUserView(KVMContext vm, const KStringPtr& viewClass, co EtsEnv* env = reinterpret_cast(vm); std:: string className(viewClass.c_str()); // TODO: hack, fix it! - if (className == "ViewArkTSLoaderApp") className = "Page.App"; + if (className == "ViewLoaderApp") className = "Page.App"; std::replace(className.begin(), className.end(), '.', '/'); ets_class viewClassClass = env->FindClass(className.c_str()); if (!viewClassClass) { diff --git a/templates/dummy_impl_epilogue.cc b/templates/dummy_impl_epilogue.cc index 7dfa32d8..e52a89d8 100644 --- a/templates/dummy_impl_epilogue.cc +++ b/templates/dummy_impl_epilogue.cc @@ -77,6 +77,7 @@ void setLogger(const ServiceLogger* logger) { SetDummyLogger(reinterpret_cast(logger)); } + const GenericServiceAPI* GetServiceAPI() { static const GenericServiceAPI serviceAPIImpl = { diff --git a/templates/dummy_impl_prologue.cc b/templates/dummy_impl_prologue.cc index 8909b7a2..7b63e046 100644 --- a/templates/dummy_impl_prologue.cc +++ b/templates/dummy_impl_prologue.cc @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include "arkoala_api_generated.h" #include "Serializers.h" @@ -136,6 +138,7 @@ void DumpTree(TreeNode *node, Ark_Int32 indent) { } } +// TODO: remove in favour of callbackCallerInstance! GENERATED_Ark_APICallbackMethod *callbacks = nullptr; int TreeNode::_globalId = 1; @@ -769,8 +772,23 @@ void SetLazyItemIndexer(Ark_VMContext vmContext, Ark_NodeHandle nodePtr, Ark_Int Ark_PipelineContext GetPipelineContext(Ark_NodeHandle node) { return nullptr; } -void SetVsyncCallback(Ark_VMContext vmContext, Ark_PipelineContext pipelineContext, Ark_Int32 callbackId) {} -void UnblockVsyncWait(Ark_VMContext vmContext, Ark_PipelineContext pipelineContext) {} + +Ark_Deferred* currentVsyncWait = nullptr; +void SetVsyncCallback(Ark_PipelineContext pipelineContext, Ark_Deferred* deferred) { + auto delayed_call = std::async(std::launch::async, [deferred] { + currentVsyncWait = deferred; + std::this_thread::sleep_for(1000ms); + if (currentVsyncWait) + deferred->resolve(currentVsyncWait, nullptr, 0); + currentVsyncWait = nullptr; + }); +} +void UnblockVsyncWait(Ark_VMContext vmContext, Ark_PipelineContext pipelineContext) { + if (currentVsyncWait) { + currentVsyncWait->reject(currentVsyncWait, "Reject vsync"); + currentVsyncWait = nullptr; + } +} void SetChildTotalCount(Ark_NodeHandle node, Ark_Int32 totalCount) {} void ShowCrash(Ark_CharPtr message) {} } diff --git a/templates/library_template.cc b/templates/library_template.cc index 3333569e..df92b978 100644 --- a/templates/library_template.cc +++ b/templates/library_template.cc @@ -87,9 +87,11 @@ const %CPP_PREFIX%ArkUIAnyAPI* GetAnyImpl(int kind, int version, std::string* re return nullptr; } } - // Provide custom logger to loaded libs. + // Provide custom logger and callback caller to loaded libs. auto service = (const GenericServiceAPI*)(*getAPI)(GENERIC_SERVICE, GENERIC_SERVICE_API_VERSION); - if (service && logger) service->setLogger(reinterpret_cast(logger)); + if (service) { + if (logger) service->setLogger(reinterpret_cast(logger)); + } impl = (*getAPI)(kind, version); if (!impl) { diff --git a/tsconfig-loader.json b/tsconfig-loader.json index 58464493..5a5e15ab 100644 --- a/tsconfig-loader.json +++ b/tsconfig-loader.json @@ -13,7 +13,7 @@ "skipLibCheck": true, "removeComments": false, "outDir": "build/lib", - "rootDirs": ["peer_lib/sig/arkoala/loader", "external/incremental", "external/interop"], + "rootDirs": ["external/arkoala-arkts/loader/src", "external/incremental", "external/interop"], "module": "CommonJS", "baseUrl": ".", "paths": { @@ -22,7 +22,7 @@ "@koalaui/compat": ["./external/incremental/compat/src/typescript"], } }, - "include": ["peer_lib/sig/arkoala/loader/*.ts"], + "include": ["./external/arkoala-arkts/loader/src/loader.ts"], "references": [ { "path": "./external/incremental/common" }, { "path": "./external/interop" }, -- Gitee From 29cf462297ce5d6e1629d8fa6eb577cf741706cb Mon Sep 17 00:00:00 2001 From: scherbatiyalexander Date: Tue, 19 Nov 2024 12:52:02 +0000 Subject: [PATCH 34/53] !990 Avoid enum duplicates in index-full.d.ts * Avoid duplicate ContentType enum definition in index-full.d.ts --- src/peer-generation/printers/DeclarationPrinter.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/peer-generation/printers/DeclarationPrinter.ts b/src/peer-generation/printers/DeclarationPrinter.ts index 7f4976e6..2652082d 100644 --- a/src/peer-generation/printers/DeclarationPrinter.ts +++ b/src/peer-generation/printers/DeclarationPrinter.ts @@ -21,7 +21,13 @@ import { LanguageWriter } from "../LanguageWriters" export function printDeclarations(peerLibrary: PeerLibrary): Array { const result = [] + const seenEnums = new Set() for (const decl of peerLibrary.declarations) { + if (idl.isEnum(decl)) { + // One more hack to avoid double definition of ContentType enum. + if (seenEnums.has(decl.name)) continue + seenEnums.add(decl.name) + } const visitor = new DtsPrintVisitor(type => peerLibrary.resolveTypeReference(type), peerLibrary.language) if ((idl.isInterface(decl) || idl.isClass(decl)) && isMaterialized(decl)) continue visitor.visit(decl) -- Gitee From 2f9df09af0a5e3cc72339bcdbe2fb0279676c8ae Mon Sep 17 00:00:00 2001 From: scherbatiyalexander Date: Tue, 19 Nov 2024 13:02:27 +0000 Subject: [PATCH 35/53] !991 Fix type declarations brackets * Fix type params brackets --- src/from-idl/DtsPrinter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/from-idl/DtsPrinter.ts b/src/from-idl/DtsPrinter.ts index 84d04334..36e3474f 100644 --- a/src/from-idl/DtsPrinter.ts +++ b/src/from-idl/DtsPrinter.ts @@ -228,7 +228,7 @@ export class CustomPrintVisitor { const text = isCallback(node) ? this.callback(node) : hasExtAttribute(node, IDLExtendedAttributes.Import) ? IDLAnyType.name : this.printTypeForTS(node.type) - const typeParams = node.typeParameters ? `<${node.typeParameters.join(",")}>` : "" + const typeParams = node.typeParameters && node.typeParameters.length > 0 ? `<${node.typeParameters.join(",")}>` : "" this.print(`declare type ${getName(node)}${typeParams} = ${text};`) } -- Gitee From 7cdd17ee2c71a812f3ba1e77b13267386e2963c9 Mon Sep 17 00:00:00 2001 From: vadimdolgachev Date: Tue, 19 Nov 2024 14:07:02 +0000 Subject: [PATCH 36/53] !997 Added import of Length type for NativeModule * Adds necessary import --- templates/arkts/NativeModule_template.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/arkts/NativeModule_template.ts b/templates/arkts/NativeModule_template.ts index 2def50d1..ad651be4 100644 --- a/templates/arkts/NativeModule_template.ts +++ b/templates/arkts/NativeModule_template.ts @@ -27,8 +27,7 @@ import { KInt32ArrayPtr, KFloat32ArrayPtr, } from "@koalaui/interop" - - +import { Length } from "../ArkUnitsInterfaces.ts" let theModule: NativeModule -- Gitee From 0ddb9f55433ee6306ddde681a5ab3fbcf45df3d7 Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Tue, 19 Nov 2024 14:19:21 +0000 Subject: [PATCH 37/53] !996 There is not the generated object for SwiperContentTransitionProxy (the same name for both TS and native levels of ArkUI) * update src/peer-generation/ArgConvertors.ts. --- src/peer-generation/ArgConvertors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/peer-generation/ArgConvertors.ts b/src/peer-generation/ArgConvertors.ts index 847aacdc..e33d587d 100644 --- a/src/peer-generation/ArgConvertors.ts +++ b/src/peer-generation/ArgConvertors.ts @@ -1235,7 +1235,7 @@ export class MaterializedClassConvertor extends BaseArgConvertor { // return assigneer(readStatement) } nativeType(): idl.IDLType { - return idl.createReferenceType('Materialized') + return idl.createReferenceType(this.type.name) } interopType(language: Language): string { throw new Error("Must never be used") -- Gitee From 4633ed102a7d3ac6f88f47df206125219682a1b2 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Wed, 20 Nov 2024 06:44:12 +0000 Subject: [PATCH 38/53] !1000 Defer change followup --- external | 2 +- package.json | 2 +- predefined/sys/node.idl | 5 +++-- src/peer-generation/ArgConvertors.ts | 2 +- src/peer-generation/PeerGeneratorConfig.ts | 2 -- templates/arkoala_api_prologue.h | 1 - templates/arkts/NativeModule_template.ts | 3 ++- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/external b/external index 675b0eaf..035835fe 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit 675b0eafd975fa4d8686ba1feba59846dcbe7a8d +Subproject commit 035835fe84268d52ca5096204306a8ca85628313 diff --git a/package.json b/package.json index fa4eb5c3..077c08ae 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "run:java:concurrent": "npm run compile:java && npm run compile:native-node-host-java-subset && java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Concurrent", "compile:dummy-panda": "npm run compile:java && npm run rollup:host:subset && cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs", "run:app:java": "npm run compile:dummy-panda && ACE_LIBRARY_PATH=./native node lib/loader.js java", - "run:app:panda": "cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs && npm run compile:all:arkts:idl && PANDA_HOME=./external/incremental/tools/panda/node_modules/@panda/sdk ACE_LIBRARY_PATH=./native node lib/loader.js panda", + "run:app:panda": "cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs && npm run compile:all:arkts && PANDA_HOME=./external/incremental/tools/panda/node_modules/@panda/sdk ACE_LIBRARY_PATH=./native node lib/loader.js panda", "compile:native-ohos-subset-arm32": "npm run check:subset && node ./native/nativeBuild.mjs subset arm32", "compile:native-ohos-subset-arm64": "npm run check:subset && node ./native/nativeBuild.mjs subset arm64", "compile:native-ohos-full-arm32": "npm run check:peers && node ./native/nativeBuild.mjs full arm32", diff --git a/predefined/sys/node.idl b/predefined/sys/node.idl index f603ed0f..a7796b13 100644 --- a/predefined/sys/node.idl +++ b/predefined/sys/node.idl @@ -33,8 +33,9 @@ interface Node { void SetRangeUpdater(pointer ptr0, i32 arg); void SetLazyItemIndexer(pointer ptr0, i32 arg); pointer GetPipelineContext(pointer ptr0); - void SetVsyncCallback(pointer ptr0, i32 arg); - void UnblockVsyncWait(pointer ptr0); + // TODO: Actually Promise, fix! + Object VSyncAwait(pointer pipeline); + void UnblockVsyncWait(pointer pipeline); void SetChildTotalCount(pointer ptr0, i32 arg); void ShowCrash(String message); i32 CheckArkoalaGeneratedEvents(sequence result, i32 size); diff --git a/src/peer-generation/ArgConvertors.ts b/src/peer-generation/ArgConvertors.ts index e33d587d..2c0c0878 100644 --- a/src/peer-generation/ArgConvertors.ts +++ b/src/peer-generation/ArgConvertors.ts @@ -1235,7 +1235,7 @@ export class MaterializedClassConvertor extends BaseArgConvertor { // return assigneer(readStatement) } nativeType(): idl.IDLType { - return idl.createReferenceType(this.type.name) + return idl.createReferenceType(this.type.name) } interopType(language: Language): string { throw new Error("Must never be used") diff --git a/src/peer-generation/PeerGeneratorConfig.ts b/src/peer-generation/PeerGeneratorConfig.ts index 79f07f60..19d6d676 100644 --- a/src/peer-generation/PeerGeneratorConfig.ts +++ b/src/peer-generation/PeerGeneratorConfig.ts @@ -182,8 +182,6 @@ export class PeerGeneratorConfig { static isConflictedDeclaration(node: ts.Declaration): boolean { if (!this.needInterfaces) return false - // duplicate type declarations with different signatures - if (ts.isTypeAliasDeclaration(node) && node.name.text === 'OnWillScrollCallback') return true // has same named class and interface if ((ts.isInterfaceDeclaration(node) || ts.isClassDeclaration(node)) && node.name?.text === 'LinearGradient') return true // just has ugly dependency WrappedBuilder - there is conflict in generic types diff --git a/templates/arkoala_api_prologue.h b/templates/arkoala_api_prologue.h index d3d64b67..a4e14cee 100644 --- a/templates/arkoala_api_prologue.h +++ b/templates/arkoala_api_prologue.h @@ -90,7 +90,6 @@ typedef struct Ark_Deferred { void* context; void (*resolve)(struct Ark_Deferred* thiz, uint8_t* data, int32_t length); void (*reject)(struct Ark_Deferred* thiz, const char* message); - void (*release)(struct Ark_Deferred* thiz); } Ark_Deferred; enum Ark_APINodeFlags { diff --git a/templates/arkts/NativeModule_template.ts b/templates/arkts/NativeModule_template.ts index ad651be4..68f7ac69 100644 --- a/templates/arkts/NativeModule_template.ts +++ b/templates/arkts/NativeModule_template.ts @@ -27,7 +27,8 @@ import { KInt32ArrayPtr, KFloat32ArrayPtr, } from "@koalaui/interop" -import { Length } from "../ArkUnitsInterfaces.ts" + +import { Length } from "../ArkUnitsInterfaces" let theModule: NativeModule -- Gitee From ec31603955a793af1dc4659cc9dae67cf3ea6b70 Mon Sep 17 00:00:00 2001 From: scherbatiyalexander Date: Wed, 20 Nov 2024 06:50:49 +0000 Subject: [PATCH 39/53] !1002 Fix enum declaration when namespace is used * Check namespace for enum declare keyword declaration --- src/from-idl/DtsPrinter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/from-idl/DtsPrinter.ts b/src/from-idl/DtsPrinter.ts index 36e3474f..d3a8aca7 100644 --- a/src/from-idl/DtsPrinter.ts +++ b/src/from-idl/DtsPrinter.ts @@ -202,7 +202,7 @@ export class CustomPrintVisitor { printEnum(node: IDLEnum) { const namespace = getExtAttribute(node, IDLExtendedAttributes.Namespace)?.split(",").reverse() this.openNamespace(namespace) - this.print(`declare enum ${node.name} {`) + this.print(`${namespace ? "" : "declare "}enum ${node.name} {`) this.pushIndent() node.elements.forEach(it => { const initializer = (it.initializer !== undefined) -- Gitee From f728b7523e1a2c7a4ae16e3d5f4ffc5b6efb4128 Mon Sep 17 00:00:00 2001 From: Aleksandr Veselov Date: Wed, 20 Nov 2024 06:58:05 +0000 Subject: [PATCH 40/53] !992 Use types from koala instead of ad-hoc declaration --- demos/xml/generated/ts/CallbacksChecker.ts | 3 +- demos/xml/generated/ts/DeserializerBase.ts | 6 +- demos/xml/generated/ts/ResourceManager.ts | 65 ------------------- demos/xml/generated/ts/SerializerBase.ts | 4 +- demos/xml/generated/ts/types.ts | 7 -- demos/xml/generated/ts/xml.ts | 7 +- demos/xml/generated/ts/xmlNative.ts | 3 +- demos/xml/generated/ts/xmlSerializer.ts | 4 +- demos/xml/rollup.config.mjs | 5 +- src/peer-generation/FileGenerators.ts | 5 +- src/peer-generation/OhosGenerator.ts | 4 -- .../printers/SerializerPrinter.ts | 2 - templates/ts/CallbacksChecker.ts | 3 +- templates/ts/DeserializerBase.ts | 6 +- templates/ts/OHOSNativeModule_template.ts | 3 +- templates/ts/OHOSPeer_template.ts | 7 +- templates/ts/ResourceManager.ts | 65 ------------------- templates/ts/SerializerBase.ts | 4 +- templates/ts/types.ts | 7 -- 19 files changed, 35 insertions(+), 175 deletions(-) delete mode 100644 demos/xml/generated/ts/ResourceManager.ts delete mode 100644 demos/xml/generated/ts/types.ts delete mode 100644 templates/ts/ResourceManager.ts delete mode 100644 templates/ts/types.ts diff --git a/demos/xml/generated/ts/CallbacksChecker.ts b/demos/xml/generated/ts/CallbacksChecker.ts index a4416344..aa13f218 100644 --- a/demos/xml/generated/ts/CallbacksChecker.ts +++ b/demos/xml/generated/ts/CallbacksChecker.ts @@ -1,5 +1,4 @@ -import { float32, int32, pointer, Finalizable } from "./types" -import { ResourceHolder } from "./ResourceManager" +import { ResourceHolder } from "@koalaui/interop" import { Deserializer, deserializeAndCallCallback } from "./xmlSerializer" import { getXMLNativeModule } from "./xmlNative" diff --git a/demos/xml/generated/ts/DeserializerBase.ts b/demos/xml/generated/ts/DeserializerBase.ts index cbdb8989..1f21e03a 100644 --- a/demos/xml/generated/ts/DeserializerBase.ts +++ b/demos/xml/generated/ts/DeserializerBase.ts @@ -12,9 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {float32, int32, pointer} from "./types" -import {RuntimeType, Tags, CallbackResource } from "./SerializerBase"; -// import { Length } from "@arkoala/arkui" +import { float32, int32 } from "@koalaui/common" +import { pointer } from "@koalaui/interop" +import { Tags, CallbackResource } from "./SerializerBase"; export class DeserializerBase { private position = 0 diff --git a/demos/xml/generated/ts/ResourceManager.ts b/demos/xml/generated/ts/ResourceManager.ts deleted file mode 100644 index c5248bcb..00000000 --- a/demos/xml/generated/ts/ResourceManager.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -import { int32 } from "./types" - -export type ResourceId = int32 - -interface ResourceInfo { - resource: object - holdersCount: int32 -} - -export class ResourceHolder { - private static nextResourceId: ResourceId = 100 - private resources: Map = new Map() - private static _instance: ResourceHolder|undefined = undefined - static instance(): ResourceHolder { - if (ResourceHolder._instance == undefined) { - ResourceHolder._instance = new ResourceHolder() - } - return ResourceHolder._instance! - } - - public hold(resourceId: ResourceId) { - if (!this.resources.has(resourceId)) - throw new Error(`Resource ${resourceId} does not exists, can not hold`) - this.resources.get(resourceId)!.holdersCount++ - } - - public release(resourceId: ResourceId) { - if (!this.resources.has(resourceId)) - throw new Error(`Resource ${resourceId} does not exists, can not release`) - const resource = this.resources.get(resourceId)! - resource.holdersCount-- - if (resource.holdersCount <= 0) - this.resources.delete(resourceId) - } - - public registerAndHold(resource: object): ResourceId { - const resourceId = ResourceHolder.nextResourceId++ - this.resources.set(resourceId, { - resource: resource, - holdersCount: 1, - }) - return resourceId - } - - public get(resourceId: ResourceId): object { - if (!this.resources.has(resourceId)) - throw new Error(`Resource ${resourceId} does not exists`) - return this.resources.get(resourceId)!.resource - } -} diff --git a/demos/xml/generated/ts/SerializerBase.ts b/demos/xml/generated/ts/SerializerBase.ts index d3ae5332..25e5f5df 100644 --- a/demos/xml/generated/ts/SerializerBase.ts +++ b/demos/xml/generated/ts/SerializerBase.ts @@ -12,9 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { float32, int32, pointer, Finalizable } from "./types" +import { float32, int32 } from "@koalaui/common" +import { pointer, ResourceHolder, ResourceId } from "@koalaui/interop" import { getXMLNativeModule as nativeModule, CallbackKind } from "./xmlNative" -import { ResourceHolder, ResourceId } from "./ResourceManager" /** * Value representing possible JS runtime object type. diff --git a/demos/xml/generated/ts/types.ts b/demos/xml/generated/ts/types.ts deleted file mode 100644 index 8a60088b..00000000 --- a/demos/xml/generated/ts/types.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type pointer = bigint -export type int32 = number -export type float32 = number -export type KPointer = pointer -export type Finalizable = { ptr: pointer } - -export const nullptr: pointer = BigInt(0) diff --git a/demos/xml/generated/ts/xml.ts b/demos/xml/generated/ts/xml.ts index c4050ffd..90b81dbb 100644 --- a/demos/xml/generated/ts/xml.ts +++ b/demos/xml/generated/ts/xml.ts @@ -1,7 +1,10 @@ -import { pointer, int32, KPointer, Finalizable } from "./types" -import { Tags, RuntimeType, runtimeType, isInstanceOf, unsafeCast } from "./SerializerBase" +import { int32 } from "@koalaui/common" +import { KPointer, pointer } from "@koalaui/interop" +import { RuntimeType, runtimeType, unsafeCast } from "./SerializerBase" import { Serializer } from "./xmlSerializer" +type Finalizable = { ptr: pointer } + import { XMLNativeModule, getXMLNativeModule, diff --git a/demos/xml/generated/ts/xmlNative.ts b/demos/xml/generated/ts/xmlNative.ts index 80259b2c..e3e2ea11 100644 --- a/demos/xml/generated/ts/xmlNative.ts +++ b/demos/xml/generated/ts/xmlNative.ts @@ -1,4 +1,5 @@ -import { pointer, int32, KPointer, Finalizable } from "./types" +import { int32 } from "@koalaui/common" +import { pointer, KPointer } from "@koalaui/interop" export enum CallbackKind { Kind_Callback_Boolean_void, diff --git a/demos/xml/generated/ts/xmlSerializer.ts b/demos/xml/generated/ts/xmlSerializer.ts index 4d1d6038..f03e3f8e 100644 --- a/demos/xml/generated/ts/xmlSerializer.ts +++ b/demos/xml/generated/ts/xmlSerializer.ts @@ -15,10 +15,10 @@ import { SerializerBase, RuntimeType, runtimeType, CallbackResource } from "./SerializerBase" import { DeserializerBase } from "./DeserializerBase" -import { int32, KPointer, nullptr } from "./types" +import { int32 } from "@koalaui/common" +import { KPointer, nullptr, ResourceHolder } from "@koalaui/interop" import { getXMLNativeModule, CallbackKind } from "./xmlNative" import { xml, ParseInfo, ParseOptions } from "./xml" -import { ResourceHolder } from "./ResourceManager" export class Serializer extends SerializerBase { private static cache?: Serializer | undefined = undefined diff --git a/demos/xml/rollup.config.mjs b/demos/xml/rollup.config.mjs index ff013f53..4e712e5e 100644 --- a/demos/xml/rollup.config.mjs +++ b/demos/xml/rollup.config.mjs @@ -3,6 +3,7 @@ import { defineConfig } from "rollup" import typescript from "@rollup/plugin-typescript" import resolve from "@rollup/plugin-node-resolve" import inject from "@rollup/plugin-inject" +import commonjs from "@rollup/plugin-commonjs" export default defineConfig({ input: "src/index.ts", @@ -19,6 +20,8 @@ export default defineConfig({ moduleResolution: "nodenext", outDir: "build/node" }), - resolve() + resolve(), + // TODO Runtime JS modules should be in ES6 format + commonjs(), ] }) diff --git a/src/peer-generation/FileGenerators.ts b/src/peer-generation/FileGenerators.ts index 3c9f7edc..40094fda 100644 --- a/src/peer-generation/FileGenerators.ts +++ b/src/peer-generation/FileGenerators.ts @@ -306,13 +306,14 @@ export function makeSerializerForOhos(library: PeerLibrary, nativeModule: { name destFile.content.nativeModuleAccessor = nativeModule.name destFile.imports.addFeatures(["SerializerBase", "RuntimeType", "runtimeType", "CallbackResource"], "./SerializerBase") destFile.imports.addFeatures(["DeserializerBase" ], "./DeserializerBase") - destFile.imports.addFeatures(["int32", "KPointer", "nullptr"], "./types") + destFile.imports.addFeatures(["int32"], "@koalaui/common") + destFile.imports.addFeatures(["KPointer", "nullptr"], "@koalaui/interop") destFile.imports.addFeatures([nativeModule.name, "CallbackKind"], nativeModule.path) writeSerializerFile(library, destFile, "", declarationPath) writeDeserializerFile(library, destFile, "", declarationPath) const deserializeCallImpls = makeDeserializeAndCall(library, Language.TS, nativeModule.path) as TsSourceFile deserializeCallImpls.imports.clear() // TODO fix dependencies - deserializeCallImpls.imports.addFeatures(["ResourceHolder"], "./ResourceManager") + deserializeCallImpls.imports.addFeatures(["ResourceHolder"], "@koalaui/interop") destFile.merge(deserializeCallImpls) return destFile } else { diff --git a/src/peer-generation/OhosGenerator.ts b/src/peer-generation/OhosGenerator.ts index 71112794..3fa10737 100644 --- a/src/peer-generation/OhosGenerator.ts +++ b/src/peer-generation/OhosGenerator.ts @@ -672,7 +672,6 @@ class OHOSVisitor { const serializerText = makeSerializerForOhos(this.library, managedCodeModuleInfo, fileNamePrefix).printToString() fs.writeFileSync(path.join(managedOutDir, `${fileNamePrefix}${ext}`), peerText, 'utf-8') fs.writeFileSync(path.join(managedOutDir, `${fileNamePrefix}Serializer${ext}`), serializerText, 'utf-8') - fs.writeFileSync(path.join(managedOutDir, `types${ext}`), readLangTemplate(`types${ext}`, this.library.language)) fs.writeFileSync(path.join(managedOutDir, `SerializerBase${ext}`), readLangTemplate(`SerializerBase${ext}`, this.library.language) .replaceAll("%NATIVE_MODULE_ACCESSOR%", managedCodeModuleInfo.name) @@ -694,9 +693,6 @@ class OHOSVisitor { .replaceAll("%NATIVE_MODULE_ACCESSOR%", managedCodeModuleInfo.name) .replaceAll("%NATIVE_MODULE_PATH%", managedCodeModuleInfo.path) ) - fs.writeFileSync(path.join(managedOutDir, `ResourceManager${ext}`), - readLangTemplate(`ResourceManager${ext}`, this.library.language) - ) } } diff --git a/src/peer-generation/printers/SerializerPrinter.ts b/src/peer-generation/printers/SerializerPrinter.ts index ac293701..72a46878 100644 --- a/src/peer-generation/printers/SerializerPrinter.ts +++ b/src/peer-generation/printers/SerializerPrinter.ts @@ -29,7 +29,6 @@ import { } from '../idl/IdlPeerGeneratorVisitor'; import { isSyntheticDeclaration, makeSyntheticDeclarationsFiles } from '../idl/IdlSyntheticDeclarations'; import { collectProperties } from '../printers/StructPrinter'; -import { MakeAssignOptions, MethodArgPrintHint } from '../LanguageWriters/LanguageWriter'; import { FieldModifier, IfStatement, MethodModifier, ProxyStatement, ReturnStatement } from '../LanguageWriters/LanguageWriter'; import { DeclarationNameConvertor } from '../idl/IdlNameConvertor'; @@ -39,7 +38,6 @@ import { IDLEntry } from "../../idl"; import { convertDeclaration } from '../LanguageWriters/nameConvertor'; import { collectMaterializedImports } from '../Materialized'; import { CallbackKind, generateCallbackKindAccess, stubIsTypeCallback } from '../ArgConvertors'; -import { createSourceFile, ModifierFlags } from 'typescript'; import { SourceFile, TsSourceFile } from './SourceFile'; class IdlSerializerPrinter { diff --git a/templates/ts/CallbacksChecker.ts b/templates/ts/CallbacksChecker.ts index 7d98decd..119e664f 100644 --- a/templates/ts/CallbacksChecker.ts +++ b/templates/ts/CallbacksChecker.ts @@ -1,5 +1,4 @@ -import { float32, int32, pointer, Finalizable } from "./types" -import { ResourceHolder } from "./ResourceManager" +import { ResourceHolder } from "@koalaui/interop" import { Deserializer, deserializeAndCallCallback } from "%SERIALIZER_PATH%" import { %NATIVE_MODULE_ACCESSOR% } from "%NATIVE_MODULE_PATH%" diff --git a/templates/ts/DeserializerBase.ts b/templates/ts/DeserializerBase.ts index cbdb8989..1f21e03a 100644 --- a/templates/ts/DeserializerBase.ts +++ b/templates/ts/DeserializerBase.ts @@ -12,9 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {float32, int32, pointer} from "./types" -import {RuntimeType, Tags, CallbackResource } from "./SerializerBase"; -// import { Length } from "@arkoala/arkui" +import { float32, int32 } from "@koalaui/common" +import { pointer } from "@koalaui/interop" +import { Tags, CallbackResource } from "./SerializerBase"; export class DeserializerBase { private position = 0 diff --git a/templates/ts/OHOSNativeModule_template.ts b/templates/ts/OHOSNativeModule_template.ts index 3ca314d0..5f2ad2c3 100644 --- a/templates/ts/OHOSNativeModule_template.ts +++ b/templates/ts/OHOSNativeModule_template.ts @@ -1,4 +1,5 @@ -import { pointer, int32, KPointer, Finalizable } from "./types" +import { int32 } from "@koalaui/common" +import { pointer, KPointer } from "@koalaui/interop" %NATIVE_MODULE_CONTENT% diff --git a/templates/ts/OHOSPeer_template.ts b/templates/ts/OHOSPeer_template.ts index 99f4997c..b67f8081 100644 --- a/templates/ts/OHOSPeer_template.ts +++ b/templates/ts/OHOSPeer_template.ts @@ -1,5 +1,8 @@ -import { pointer, int32, KPointer, Finalizable } from "./types" -import { Tags, RuntimeType, runtimeType, isInstanceOf, unsafeCast } from "./SerializerBase" +import { int32 } from "@koalaui/common" +import { KPointer, pointer } from "@koalaui/interop" +import { RuntimeType, runtimeType, unsafeCast } from "./SerializerBase" import { Serializer } from "%SERIALIZER_PATH%" +type Finalizable = { ptr: pointer } + %PEER_CONTENT% diff --git a/templates/ts/ResourceManager.ts b/templates/ts/ResourceManager.ts deleted file mode 100644 index c5248bcb..00000000 --- a/templates/ts/ResourceManager.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -import { int32 } from "./types" - -export type ResourceId = int32 - -interface ResourceInfo { - resource: object - holdersCount: int32 -} - -export class ResourceHolder { - private static nextResourceId: ResourceId = 100 - private resources: Map = new Map() - private static _instance: ResourceHolder|undefined = undefined - static instance(): ResourceHolder { - if (ResourceHolder._instance == undefined) { - ResourceHolder._instance = new ResourceHolder() - } - return ResourceHolder._instance! - } - - public hold(resourceId: ResourceId) { - if (!this.resources.has(resourceId)) - throw new Error(`Resource ${resourceId} does not exists, can not hold`) - this.resources.get(resourceId)!.holdersCount++ - } - - public release(resourceId: ResourceId) { - if (!this.resources.has(resourceId)) - throw new Error(`Resource ${resourceId} does not exists, can not release`) - const resource = this.resources.get(resourceId)! - resource.holdersCount-- - if (resource.holdersCount <= 0) - this.resources.delete(resourceId) - } - - public registerAndHold(resource: object): ResourceId { - const resourceId = ResourceHolder.nextResourceId++ - this.resources.set(resourceId, { - resource: resource, - holdersCount: 1, - }) - return resourceId - } - - public get(resourceId: ResourceId): object { - if (!this.resources.has(resourceId)) - throw new Error(`Resource ${resourceId} does not exists`) - return this.resources.get(resourceId)!.resource - } -} diff --git a/templates/ts/SerializerBase.ts b/templates/ts/SerializerBase.ts index 2fdf1aea..848b791a 100644 --- a/templates/ts/SerializerBase.ts +++ b/templates/ts/SerializerBase.ts @@ -12,9 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { float32, int32, pointer, Finalizable } from "./types" +import { float32, int32 } from "@koalaui/common" +import { pointer, ResourceHolder, ResourceId } from "@koalaui/interop" import { %NATIVE_MODULE_ACCESSOR% as nativeModule, CallbackKind } from "%NATIVE_MODULE_PATH%" -import { ResourceHolder, ResourceId } from "./ResourceManager" /** * Value representing possible JS runtime object type. diff --git a/templates/ts/types.ts b/templates/ts/types.ts deleted file mode 100644 index 8a60088b..00000000 --- a/templates/ts/types.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type pointer = bigint -export type int32 = number -export type float32 = number -export type KPointer = pointer -export type Finalizable = { ptr: pointer } - -export const nullptr: pointer = BigInt(0) -- Gitee From c6a93f3c66a2ef6a74bb6a802c95ef0c5640a460 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Wed, 20 Nov 2024 12:34:57 +0300 Subject: [PATCH 41/53] Fix typo Signed-off-by: Nikolay Igotti --- doc/DESIGN.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/DESIGN.md b/doc/DESIGN.md index a7b371a2..3335e3de 100644 --- a/doc/DESIGN.md +++ b/doc/DESIGN.md @@ -32,8 +32,7 @@ project and language-specific glue code to allow invocation of APIs across langu Important part of interop problem is mapping of data types between languages and runtimes. To solve that universal type system based serialization/deserialization mechanism is designed. It works by analyzing types aggregation and inheritance -and created automated serializers and deserializers for data transfer. This way every API call and callback can be - +and created automated serializers and deserializers for data transfer. This way every API call and callback can be systematically processed by tool to provide cross-language interaction via FFI in languages-specific manner. ## Challenges -- Gitee From a28312c2d9aa67207837606805449dae7089d6c0 Mon Sep 17 00:00:00 2001 From: tsvetkovaelena Date: Wed, 20 Nov 2024 11:29:25 +0000 Subject: [PATCH 42/53] !986 Extended arkts subset [3] --- tests/arkts-subset/ets/common.d.ts | 9 +++ tests/arkts-subset/ets/divider.d.ts | 25 ++++++ tests/arkts-subset/ets/enums.d.ts | 38 +++++++++ tests/arkts-subset/ets/image.d.ts | 1 + tests/arkts-subset/ets/list.d.ts | 4 + tests/arkts-subset/ets/list_item.d.ts | 102 +++++++++++++++++++++++++ tests/arkts-subset/ets/navigator.d.ts | 28 +++++++ tests/arkts-subset/ets/span.d.ts | 39 ++++++++++ tests/arkts-subset/ets/stack.d.ts | 31 ++++++++ tests/arkts-subset/ets/swiper.d.ts | 4 + tests/arkts-subset/ets/tabs.d.ts | 39 ++++++++-- tests/arkts-subset/ets/text_input.d.ts | 15 ++++ tests/arkts-subset/ets/toggle.d.ts | 40 ++++++++++ tests/arkts-subset/ets/units.d.ts | 19 +++++ 14 files changed, 387 insertions(+), 7 deletions(-) create mode 100644 tests/arkts-subset/ets/divider.d.ts create mode 100644 tests/arkts-subset/ets/list_item.d.ts create mode 100644 tests/arkts-subset/ets/navigator.d.ts create mode 100644 tests/arkts-subset/ets/stack.d.ts create mode 100644 tests/arkts-subset/ets/toggle.d.ts diff --git a/tests/arkts-subset/ets/common.d.ts b/tests/arkts-subset/ets/common.d.ts index ea74f92b..9ac59683 100644 --- a/tests/arkts-subset/ets/common.d.ts +++ b/tests/arkts-subset/ets/common.d.ts @@ -437,6 +437,15 @@ declare class CommonMethod { aspectRatio(value: number): T; + visibility(value: Visibility): T; + + backgroundImage(src: ResourceStr | PixelMap, repeat?: ImageRepeat): T; + + backgroundImageSize(value: SizeOptions | ImageSize): T; + + offset(value: Position | Edges | LocalizedEdges): T; + + enabled(value: boolean): T; } declare interface Rectangle { diff --git a/tests/arkts-subset/ets/divider.d.ts b/tests/arkts-subset/ets/divider.d.ts new file mode 100644 index 00000000..1bbc5daf --- /dev/null +++ b/tests/arkts-subset/ets/divider.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 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. + */ + +interface DividerInterface { + (): DividerAttribute; + } + + declare class DividerAttribute extends CommonMethod { + vertical(value: boolean): DividerAttribute; + color(value: ResourceColor): DividerAttribute; + strokeWidth(value: number | string): DividerAttribute; + lineCap(value: LineCapStyle): DividerAttribute; + } \ No newline at end of file diff --git a/tests/arkts-subset/ets/enums.d.ts b/tests/arkts-subset/ets/enums.d.ts index 1057ac17..91a96f01 100644 --- a/tests/arkts-subset/ets/enums.d.ts +++ b/tests/arkts-subset/ets/enums.d.ts @@ -143,3 +143,41 @@ declare enum BarState { Auto, On, } + +declare enum ImageRepeat { + NoRepeat, + X, + Y, + XY, +} + +declare enum Visibility { + Visible, + Hidden, + None, +} + +declare enum ImageSize { + Auto, + Cover, + Contain, + FILL = 3, +} + +declare enum Alignment { + TopStart, + Top, + TopEnd, + Start, + Center, + End, + BottomStart, + Bottom, + BottomEnd, +} + +declare enum LineCapStyle { + Butt, + Round, + Square, +} \ No newline at end of file diff --git a/tests/arkts-subset/ets/image.d.ts b/tests/arkts-subset/ets/image.d.ts index 993ce8cc..212073b7 100644 --- a/tests/arkts-subset/ets/image.d.ts +++ b/tests/arkts-subset/ets/image.d.ts @@ -26,6 +26,7 @@ declare interface ImageInterface { declare class ImageAttribute extends CommonMethod { objectFit(value: ImageFit): ImageAttribute; + fillColor(value: ResourceColor): ImageAttribute; } declare const Image: ImageInterface \ No newline at end of file diff --git a/tests/arkts-subset/ets/list.d.ts b/tests/arkts-subset/ets/list.d.ts index 57e9f3dd..356d77c5 100644 --- a/tests/arkts-subset/ets/list.d.ts +++ b/tests/arkts-subset/ets/list.d.ts @@ -29,6 +29,10 @@ declare class ListAttribute extends ScrollableCommonMethod { someOptional(param: Optional): ListAttribute onScrollVisibleContentChange(handler: OnScrollVisibleContentChangeCallback): ListAttribute; + + listDirection(value: Axis): ListAttribute; + + onScrollIndex(event: (start: number, end: number, center: number) => void): ListAttribute; } declare const List: ListInterface diff --git a/tests/arkts-subset/ets/list_item.d.ts b/tests/arkts-subset/ets/list_item.d.ts new file mode 100644 index 00000000..4699ca2f --- /dev/null +++ b/tests/arkts-subset/ets/list_item.d.ts @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2024 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 enum Sticky { + None, + Normal, + Opacity, +} + +declare enum EditMode { + None, + Deletable, + Movable, +} + + +declare enum SwipeEdgeEffect { + Spring, + None, +} + +declare enum SwipeActionState { + COLLAPSED, + EXPANDED, + ACTIONING, +} + +declare interface SwipeActionItem { + + builder?: CustomBuilder; + + actionAreaDistance?: Length; + + onAction?: () => void; + + onEnterActionArea?: () => void; + + onExitActionArea?: () => void; + + onStateChange?: (state: SwipeActionState) => void; +} + +declare interface SwipeActionOptions { + + start?: CustomBuilder | SwipeActionItem; + + + end?: CustomBuilder | SwipeActionItem; + + + edgeEffect?: SwipeEdgeEffect; + + + onOffsetChange?: (offset: number) => void; +} + +declare enum ListItemStyle { + + NONE = 0, + + CARD = 1, +} + +declare interface ListItemOptions { + style?: ListItemStyle; +} + +interface ListItemInterface { + (value?: ListItemOptions): ListItemAttribute; + (value?: string): ListItemAttribute; +} + +declare class ListItemAttribute extends CommonMethod { + sticky(value: Sticky): ListItemAttribute; + + editable(value: boolean | EditMode): ListItemAttribute; + + selectable(value: boolean): ListItemAttribute; + + selected(value: boolean): ListItemAttribute; + + swipeAction(value: SwipeActionOptions): ListItemAttribute; + + onSelect(event: (isSelected: boolean) => void): ListItemAttribute; +} + +declare const ListItemInstance: ListItemAttribute; + +declare const ListItem: ListItemInterface; + diff --git a/tests/arkts-subset/ets/navigator.d.ts b/tests/arkts-subset/ets/navigator.d.ts new file mode 100644 index 00000000..b01af1eb --- /dev/null +++ b/tests/arkts-subset/ets/navigator.d.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 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. + */ + +interface NavigatorInterface { + (): NavigatorAttribute; + // (value?: { target: string; type?: NavigationType }): NavigatorAttribute; +} + +declare class NavigatorAttribute extends CommonMethod { + // active(value: boolean): NavigatorAttribute; + // type(value: NavigationType): NavigatorAttribute; + // target(value: string): NavigatorAttribute; + // params(value: object): NavigatorAttribute; +} +declare const Navigator: NavigatorInterface; +declare const NavigatorInstance: NavigatorAttribute; \ No newline at end of file diff --git a/tests/arkts-subset/ets/span.d.ts b/tests/arkts-subset/ets/span.d.ts index 752c1d96..c4169fb0 100644 --- a/tests/arkts-subset/ets/span.d.ts +++ b/tests/arkts-subset/ets/span.d.ts @@ -1,3 +1,42 @@ +/* + * Copyright (c) 2024 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 interface TextBackgroundStyle { + color?: ResourceColor; + radius?: Dimension | BorderRadiuses; + } declare class BaseSpan extends CommonMethod { + textBackgroundStyle(style: TextBackgroundStyle): T; + baselineOffset(value: LengthMetrics): T; +} + +interface SpanInterface { + (value: string | Resource): SpanAttribute; +} + +declare class SpanAttribute extends BaseSpan { + fontSize(value: number | string | Resource): SpanAttribute; + fontWeight(value: number | FontWeight | string): SpanAttribute; + fontColor(value: ResourceColor): SpanAttribute; + // font(value: Font): SpanAttribute; + // fontStyle(value: FontStyle): SpanAttribute; + // fontFamily(value: string | Resource): SpanAttribute; + // decoration(value: DecorationStyleInterface): SpanAttribute; + // letterSpacing(value: number | string): SpanAttribute; + // textCase(value: TextCase): SpanAttribute; + // lineHeight(value: Length): SpanAttribute; + // textShadow(value: ShadowOptions | Array): SpanAttribute; } \ No newline at end of file diff --git a/tests/arkts-subset/ets/stack.d.ts b/tests/arkts-subset/ets/stack.d.ts new file mode 100644 index 00000000..896952dd --- /dev/null +++ b/tests/arkts-subset/ets/stack.d.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 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 interface StackOptions { + alignContent?: Alignment; +} + +interface StackInterface { + (options?: StackOptions): StackAttribute; +} + +declare class StackAttribute extends CommonMethod { + alignContent(value: Alignment): StackAttribute; + pointLight(value: PointLightStyle): StackAttribute; +} + +declare const Stack: StackInterface; +declare const StackInstance: StackAttribute; diff --git a/tests/arkts-subset/ets/swiper.d.ts b/tests/arkts-subset/ets/swiper.d.ts index 2787aa7e..3085ba2d 100644 --- a/tests/arkts-subset/ets/swiper.d.ts +++ b/tests/arkts-subset/ets/swiper.d.ts @@ -101,6 +101,10 @@ declare class SwiperAttribute extends CommonMethod { indicator(value: DotIndicator): SwiperAttribute; // indicator(value: DotIndicator | DigitIndicator | boolean): SwiperAttribute; + autoPlay(value: boolean): SwiperAttribute; + loop(value: boolean): SwiperAttribute; + vertical(value: boolean): SwiperAttribute; + interval(value: number): SwiperAttribute; } declare const Swiper: SwiperInterface; diff --git a/tests/arkts-subset/ets/tabs.d.ts b/tests/arkts-subset/ets/tabs.d.ts index fe5ab829..3703ea40 100644 --- a/tests/arkts-subset/ets/tabs.d.ts +++ b/tests/arkts-subset/ets/tabs.d.ts @@ -14,19 +14,44 @@ */ declare enum BarMode { - Scrollable = 0, - Fixed = 1, + Scrollable = 0, + Fixed = 1, } -declare interface TabsInterface { - (): TabsAttribute +declare class TabsController { + constructor(); + changeIndex(value: number): void; + // preloadItems(indices: Optional>): Promise; + // setTabBarTranslate(translate: TranslateOptions): void; + // setTabBarOpacity(opacity: number): void; +} + +declare enum BarPosition { + Start, + End, +} + +declare interface TabsOptions { + barPosition?: BarPosition; + index?: number; + controller?: TabsController +} + +declare interface TabsInterface { + (options?: TabsOptions): TabsAttribute; } declare class TabsAttribute extends CommonMethod { - // TBD: Fix for the TestGeneratorVisitor - // barMode(value: BarMode.Fixed): TabsAttribute; - barMode(value: BarMode): TabsAttribute; + // TBD: Fix for the TestGeneratorVisitor + // barMode(value: BarMode.Fixed): TabsAttribute; + barMode(value: BarMode): TabsAttribute; + barWidth(value: Length): TabsAttribute; + barHeight(value: Length): TabsAttribute; + barPosition(value: BarPosition): TabsAttribute; + animationDuration(value: number): TabsAttribute; + scrollable(value: boolean): TabsAttribute; + } declare const Tabs: TabsInterface \ No newline at end of file diff --git a/tests/arkts-subset/ets/text_input.d.ts b/tests/arkts-subset/ets/text_input.d.ts index 3872f294..7a081584 100644 --- a/tests/arkts-subset/ets/text_input.d.ts +++ b/tests/arkts-subset/ets/text_input.d.ts @@ -19,6 +19,16 @@ declare enum InputType { Number, } +declare enum EnterKeyType { + Go = 2, + Search = 3, + Send = 4, + Next = 5, + Done = 6, + PREVIOUS = 7, + NEW_LINE = 8, + } + declare enum ContentType { USER_NAME = 0, @@ -46,6 +56,11 @@ declare class TextInputAttribute extends CommonMethod { contentType(value: ContentType): TextInputAttribute; onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute; + + placeholderFont(value?: Font): TextInputAttribute; + + enterKeyType(value: EnterKeyType): TextInputAttribute; + } declare const TextInput: TextInputInterface; diff --git a/tests/arkts-subset/ets/toggle.d.ts b/tests/arkts-subset/ets/toggle.d.ts new file mode 100644 index 00000000..d3a94ea5 --- /dev/null +++ b/tests/arkts-subset/ets/toggle.d.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 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 enum ToggleType { + Checkbox, + Switch, + Button, + } + + declare interface ToggleOptions { + type: ToggleType; + isOn?: boolean + } + + interface ToggleInterface { + (options: ToggleOptions): ToggleAttribute; + } + + declare class ToggleAttribute extends CommonMethod { + // onChange(callback: (isOn: boolean) => void): ToggleAttribute; + // contentModifier(modifier: ContentModifier): ToggleAttribute; + // selectedColor(value: ResourceColor): ToggleAttribute; + // switchPointColor(color: ResourceColor): ToggleAttribute; + // switchStyle(value: SwitchStyle): ToggleAttribute; + } + +declare const Toggle: ToggleInterface; +declare const ToggleInstance: ToggleAttribute; diff --git a/tests/arkts-subset/ets/units.d.ts b/tests/arkts-subset/ets/units.d.ts index 7cc54209..0a93b1e8 100644 --- a/tests/arkts-subset/ets/units.d.ts +++ b/tests/arkts-subset/ets/units.d.ts @@ -81,3 +81,22 @@ declare type Margin = Padding; declare type LocalizedMargin = LocalizedPadding; declare type VoidCallback = () => void; + +declare interface SizeOptions { + width?: Length; + height?: Length; +} + +declare interface Edges { + top?: Dimension; + left?: Dimension; + bottom?: Dimension; + right?: Dimension; +} + +declare interface LocalizedEdges { + top?: LengthMetrics; + start?: LengthMetrics; + bottom?: LengthMetrics; + end?: LengthMetrics; +} \ No newline at end of file -- Gitee From 8d83b990245e6067cf4914933001b7d316307caa Mon Sep 17 00:00:00 2001 From: vadimdolgachev Date: Wed, 20 Nov 2024 12:04:56 +0000 Subject: [PATCH 43/53] =?UTF-8?q?!945=20[ArkTS]=20Fixes=20generation=20for?= =?UTF-8?q?=20some=20files=20from=20the=20full=20SDK=20*=20Fixes=20check:a?= =?UTF-8?q?rkts:subset:tsc=20*=20Adds=20necessary=20d.ts=20files=20for=20r?= =?UTF-8?q?unning=20test=20*=20Fixes=20'CancelButtonOptions=20|=20CancelBu?= =?UTF-8?q?ttonSymbolOptions'=20type=20processing=20*=20Left=20minimal=20s?= =?UTF-8?q?et=20of=20d.ts=20files=20*=20Removes=20unnecessary=20files=20*?= =?UTF-8?q?=20Fixes=20the=20last=20merge=20*=20Update=20sdk=20files=20*=20?= =?UTF-8?q?Update=20d.ts=20from=20sdk=20*=20Updated=20nav=5Fdestination.d.?= =?UTF-8?q?ts=20*=20Updated=20d.ts=20files=20*=20Added=20tests/arkts-sdk?= =?UTF-8?q?=20for=20testing=20full=20sdk=20*=20Adds=20new=20d.ts=20files?= =?UTF-8?q?=20*=20Fixes=20last=20merge=20*=20Added/Updated=20d.ts=20files?= =?UTF-8?q?=20*=20Adds=20necessary=20imports=20for=20type=5Fcheck=20*=20Fi?= =?UTF-8?q?xes=20for=20name=20collisions=20between=20modules=20*=20Fixes?= =?UTF-8?q?=20for=20duplicate=20declarations=20*=20Fixes=20check:arkts:sub?= =?UTF-8?q?set:tsc=20target=20*=20Updates=20d.ts=20*=20Fixes=20a=20typo=20?= =?UTF-8?q?*=20Fixes=20last=20merge=20*=20Fixes=20main.ts=20*=20Updates=20?= =?UTF-8?q?d.ts=20files=20*=20More=20d.ts=20from=20full=20sdk=20*=20Fixes?= =?UTF-8?q?=20last=20merging=20*=20Updates=20column.d.ts=20*=20Fixed=20typ?= =?UTF-8?q?e=20inference=20for=20native=20side=20if=20it=20is=20a=20confli?= =?UTF-8?q?cting=20declaration=20*=20Generate=20alias=20for=20resource=20t?= =?UTF-8?q?ype=20correctly=20*=20Fixes=20LinearGradient=20serialization=20?= =?UTF-8?q?*=20Fixes=20native=20code=20compilation=20*=20More=20correct=20?= =?UTF-8?q?Date=20serialization=20*=20Updated=20external=20*=20Removed=20d?= =?UTF-8?q?ebug=20code=20*=20Fixes=20materialized=20classes=20compilation?= =?UTF-8?q?=20*=20More=20d.ts=20from=20full=20sdk=20*=20Pass=20isGenericTy?= =?UTF-8?q?pe=3Dtrue=20to=20CustomTypeConvertor=20for=20type=20generic=20p?= =?UTF-8?q?arameters=20*=20Printing=20tuple=20correctly=20*=20Added=20--su?= =?UTF-8?q?ppress-warnings=20flag=20*=20Fixes=20serialization=20of=20Time?= =?UTF-8?q?=20type=20*=20Fixes=20collecting=20of=20properties=20in=20TypeC?= =?UTF-8?q?hecker=20*=20Fixed=20printing=20of=20tuples=20with=20type=20par?= =?UTF-8?q?ameters=20*=20Fixes=20error:=20"TypeError:=20IMonitor=20is=20no?= =?UTF-8?q?t=20abstract=20and=20does=20not=20overrid=E2=80=A6=20*=20Update?= =?UTF-8?q?s=20d.ts=20*=20Makes=20the=20correct=20type=20of=20overloaded?= =?UTF-8?q?=20property=20*=20Fixes=20"TypeError:=20Method=20size():=20Lite?= =?UTF-8?q?ral=5FNumber=5Fheight=5Fwidth|undefined=E2=80=A6=20*=20More=20d?= =?UTF-8?q?.ts=20*=20Fixes=20compilation=20errors=20*=20Fixes=20namespace?= =?UTF-8?q?=20prefix=20generation=20*=20Adds=20d.ts=20files=20from=20sdk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- external | 2 +- package.json | 2 +- .../arkoala-arkts/arkui/src/generated/main.ts | 140 +- .../src/generated/peers/SerializerBase.ts | 27 +- src/IDLVisitor.ts | 17 +- src/main.ts | 51 +- src/peer-generation/ArgConvertors.ts | 15 +- src/peer-generation/FileGenerators.ts | 2 +- src/peer-generation/ImportsCollector.ts | 13 +- .../LanguageWriters/LanguageWriter.ts | 2 +- .../convertors/ETSConvertors.ts | 9 +- .../convertors/TSConvertors.ts | 18 +- .../writers/ETSLanguageWriter.ts | 18 +- src/peer-generation/PeerGeneratorConfig.ts | 2 +- src/peer-generation/PeerLibrary.ts | 4 +- .../idl/IdlPeerGeneratorVisitor.ts | 39 +- .../printers/InterfacePrinter.ts | 63 +- .../printers/MaterializedPrinter.ts | 24 +- .../printers/TypeCheckPrinter.ts | 82 +- tests/arkts-sdk/ets/ability_component.d.ts | 102 + tests/arkts-sdk/ets/action_sheet.d.ts | 878 + tests/arkts-sdk/ets/alert_dialog.d.ts | 1329 + tests/arkts-sdk/ets/alphabet_indexer.d.ts | 1036 + tests/arkts-sdk/ets/animator.d.ts | 309 + tests/arkts-sdk/ets/badge.d.ts | 916 + tests/arkts-sdk/ets/blank.d.ts | 235 + tests/arkts-sdk/ets/button.d.ts | 1319 + tests/arkts-sdk/ets/calendar.d.ts | 1907 ++ tests/arkts-sdk/ets/calendar_picker.d.ts | 584 + tests/arkts-sdk/ets/canvas.d.ts | 6204 ++++ tests/arkts-sdk/ets/checkbox.d.ts | 583 + tests/arkts-sdk/ets/checkboxgroup.d.ts | 703 + tests/arkts-sdk/ets/circle.d.ts | 343 + tests/arkts-sdk/ets/column.d.ts | 364 + tests/arkts-sdk/ets/column_split.d.ts | 254 + tests/arkts-sdk/ets/common.d.ts | 24541 +++++++++++++++ tests/arkts-sdk/ets/component3d.d.ts | 212 + tests/arkts-sdk/ets/container_span.d.ts | 141 + .../ets/content_slot.d.ts} | 89 +- .../ets/context_menu.d.ts} | 67 +- tests/arkts-sdk/ets/counter.d.ts | 335 + .../ets/custom_dialog_controller.d.ts | 633 + tests/arkts-sdk/ets/data_panel.d.ts | 734 + tests/arkts-sdk/ets/date_picker.d.ts | 1121 + tests/arkts-sdk/ets/divider.d.ts | 355 + .../ets/effect_component.d.ts} | 70 +- tests/arkts-sdk/ets/ellipse.d.ts | 333 + tests/arkts-sdk/ets/embedded_component.d.ts | 127 + tests/arkts-sdk/ets/enums.d.ts | 9822 ++++++ tests/arkts-sdk/ets/flex.d.ts | 469 + tests/arkts-sdk/ets/flow_item.d.ts | 143 + tests/arkts-sdk/ets/focus.d.ts | 102 + tests/arkts-sdk/ets/folder_stack.d.ts | 377 + tests/arkts-sdk/ets/for_each.d.ts | 165 + tests/arkts-sdk/ets/form_component.d.ts | 521 + tests/arkts-sdk/ets/form_link.d.ts | 238 + tests/arkts-sdk/ets/gauge.d.ts | 740 + tests/arkts-sdk/ets/gesture.d.ts | 4003 +++ tests/arkts-sdk/ets/grid.d.ts | 1346 + tests/arkts-sdk/ets/gridItem.d.ts | 437 + tests/arkts-sdk/ets/grid_col.d.ts | 576 + .../ets/grid_container.d.ts | 0 tests/arkts-sdk/ets/grid_row.d.ts | 1103 + tests/arkts-sdk/ets/hyperlink.d.ts | 127 + tests/arkts-sdk/ets/image.d.ts | 1954 ++ tests/arkts-sdk/ets/image_animator.d.ts | 738 + tests/arkts-sdk/ets/image_common.d.ts | 134 + tests/arkts-sdk/ets/image_span.d.ts | 319 + tests/arkts-sdk/ets/index-full.d.ts | 152 + tests/arkts-sdk/ets/indicatorcomponent.d.ts | 217 + tests/arkts-sdk/ets/inspector.d.ts | 87 + tests/arkts-sdk/ets/isolated_component.d.ts | 128 + tests/arkts-sdk/ets/lazy_for_each.d.ts | 911 + tests/arkts-sdk/ets/line.d.ts | 437 + tests/arkts-sdk/ets/linearindicator.d.ts | 298 + tests/arkts-sdk/ets/list.d.ts | 2328 ++ tests/arkts-sdk/ets/list_item.d.ts | 906 + tests/arkts-sdk/ets/list_item_group.d.ts | 408 + tests/arkts-sdk/ets/loading_progress.d.ts | 418 + tests/arkts-sdk/ets/location_button.d.ts | 486 + tests/arkts-sdk/ets/marquee.d.ts | 730 + tests/arkts-sdk/ets/matrix2d.d.ts | 538 + tests/arkts-sdk/ets/media_cached_image.d.ts | 93 + tests/arkts-sdk/ets/menu.d.ts | 299 + tests/arkts-sdk/ets/menu_item.d.ts | 521 + tests/arkts-sdk/ets/menu_item_group.d.ts | 224 + .../ets/nav_destination.d.ts | 205 +- tests/arkts-sdk/ets/nav_router.d.ts | 356 + .../ets/navigation.d.ts | 198 +- tests/arkts-sdk/ets/navigator.d.ts | 397 + tests/arkts-sdk/ets/node_container.d.ts | 110 + tests/arkts-sdk/ets/page_transition.d.ts | 808 + tests/arkts-sdk/ets/panel.d.ts | 800 + .../ets/particle.d.ts | 0 tests/arkts-sdk/ets/paste_button.d.ts | 321 + tests/arkts-sdk/ets/path.d.ts | 405 + tests/arkts-sdk/ets/pattern_lock.d.ts | 643 + tests/arkts-sdk/ets/plugin_component.d.ts | 213 + tests/arkts-sdk/ets/polygon.d.ts | 372 + tests/arkts-sdk/ets/polyline.d.ts | 365 + tests/arkts-sdk/ets/progress.d.ts | 1634 + tests/arkts-sdk/ets/qrcode.d.ts | 294 + tests/arkts-sdk/ets/radio.d.ts | 607 + tests/arkts-sdk/ets/rating.d.ts | 659 + tests/arkts-sdk/ets/rect.d.ts | 654 + tests/arkts-sdk/ets/refresh.d.ts | 536 + tests/arkts-sdk/ets/relative_container.d.ts | 455 + tests/arkts-sdk/ets/remote_window.d.ts | 164 + tests/arkts-sdk/ets/repeat.d.ts | 206 + tests/arkts-sdk/ets/rich_editor.d.ts | 3937 +++ tests/arkts-sdk/ets/rich_text.d.ts | 204 + .../ets/root_scene.d.ts} | 74 +- tests/arkts-sdk/ets/row.d.ts | 356 + tests/arkts-sdk/ets/row_split.d.ts | 166 + tests/arkts-sdk/ets/save_button.d.ts | 486 + .../select.d.ts => arkts-sdk/ets/screen.d.ts} | 71 +- tests/arkts-sdk/ets/scroll.d.ts | 1622 + tests/arkts-sdk/ets/scroll_bar.d.ts | 333 + tests/arkts-sdk/ets/search.d.ts | 1635 + tests/arkts-sdk/ets/security_component.d.ts | 530 + tests/arkts-sdk/ets/select.d.ts | 932 + tests/arkts-sdk/ets/shape.d.ts | 930 + tests/arkts-sdk/ets/sidebar.d.ts | 1083 + tests/arkts-sdk/ets/slider.d.ts | 1582 + tests/arkts-sdk/ets/span.d.ts | 688 + tests/arkts-sdk/ets/stack.d.ts | 297 + tests/arkts-sdk/ets/state_management.d.ts | 189 + tests/arkts-sdk/ets/stepper.d.ts | 291 + tests/arkts-sdk/ets/stepper_item.d.ts | 348 + tests/arkts-sdk/ets/styled_string.d.ts | 1672 ++ tests/arkts-sdk/ets/swiper.d.ts | 2251 ++ tests/arkts-sdk/ets/symbol_span.d.ts | 239 + tests/arkts-sdk/ets/symbolglyph.d.ts | 770 + tests/arkts-sdk/ets/tab_content.d.ts | 1289 + tests/arkts-sdk/ets/tabs.d.ts | 1871 ++ tests/arkts-sdk/ets/text.d.ts | 1548 + tests/arkts-sdk/ets/text_area.d.ts | 1733 ++ tests/arkts-sdk/ets/text_clock.d.ts | 697 + tests/arkts-sdk/ets/text_common.d.ts | 1098 + tests/arkts-sdk/ets/text_input.d.ts | 2664 ++ tests/arkts-sdk/ets/text_picker.d.ts | 1205 + tests/arkts-sdk/ets/text_timer.d.ts | 708 + tests/arkts-sdk/ets/time_picker.d.ts | 975 + tests/arkts-sdk/ets/toggle.d.ts | 666 + .../arkts-sdk/ets/ui_extension_component.d.ts | 427 + tests/arkts-sdk/ets/units.d.ts | 3492 +++ tests/arkts-sdk/ets/video.d.ts | 1389 + tests/arkts-sdk/ets/water_flow.d.ts | 809 + tests/arkts-sdk/ets/web.d.ts | 42 + tests/arkts-sdk/ets/window_scene.d.ts | 82 + tests/arkts-sdk/ets/with_theme.d.ts | 108 + tests/arkts-sdk/ets/xcomponent.d.ts | 510 + tests/arkts-sdk/resource/resource.d.ts | 127 + tests/arkts-subset/ets/alert_dialog.d.ts | 1329 + tests/arkts-subset/ets/blank.d.ts | 36 +- tests/arkts-subset/ets/button.d.ts | 1300 +- tests/arkts-subset/ets/calendar_picker.d.ts | 18 - tests/arkts-subset/ets/canvas.d.ts | 150 - tests/arkts-subset/ets/circle.d.ts | 343 + tests/arkts-subset/ets/column.d.ts | 376 +- tests/arkts-subset/ets/common.d.ts | 24801 +++++++++++++++- tests/arkts-subset/ets/counter.d.ts | 29 - tests/arkts-subset/ets/divider.d.ts | 25 - tests/arkts-subset/ets/ellipse.d.ts | 333 + tests/arkts-subset/ets/enums.d.ts | 9869 +++++- tests/arkts-subset/ets/focus.d.ts | 102 + tests/arkts-subset/ets/form_component.d.ts | 19 - tests/arkts-subset/ets/gesture.d.ts | 3980 ++- tests/arkts-subset/ets/image.d.ts | 1936 +- tests/arkts-subset/ets/image_common.d.ts | 120 +- .../arkts-subset/ets/indicatorcomponent.d.ts | 217 + tests/arkts-subset/ets/list.d.ts | 2312 +- tests/arkts-subset/ets/list_item.d.ts | 102 - tests/arkts-subset/ets/matrix2d.d.ts | 47 - tests/arkts-subset/ets/path.d.ts | 405 + tests/arkts-subset/ets/rect.d.ts | 642 +- tests/arkts-subset/ets/rich_editor.d.ts | 3937 +++ tests/arkts-subset/ets/row.d.ts | 30 - tests/arkts-subset/ets/scroll.d.ts | 1587 +- tests/arkts-subset/ets/search.d.ts | 1635 + .../arkts-subset/ets/security_component.d.ts | 3 - tests/arkts-subset/ets/shape.d.ts | 11 - tests/arkts-subset/ets/sidebar.d.ts | 12 - tests/arkts-subset/ets/slider.d.ts | 24 - tests/arkts-subset/ets/span.d.ts | 682 +- tests/arkts-subset/ets/stack.d.ts | 31 - tests/arkts-subset/ets/styled_string.d.ts | 1634 +- tests/arkts-subset/ets/swiper.d.ts | 2225 +- tests/arkts-subset/ets/symbolglyph.d.ts | 762 +- tests/arkts-subset/ets/tab_content.d.ts | 108 - tests/arkts-subset/ets/test.d.ts | 294 - tests/arkts-subset/ets/text.d.ts | 61 - tests/arkts-subset/ets/text_common.d.ts | 1098 + tests/arkts-subset/ets/text_input.d.ts | 2642 +- tests/arkts-subset/ets/text_picker.d.ts | 101 +- tests/arkts-subset/ets/toggle.d.ts | 40 - .../ets/ui_extension_component.d.ts | 72 - tests/arkts-subset/ets/units.d.ts | 3444 ++- tests/arkts-subset/ets/vector.d.ts | 30 - 199 files changed, 198076 insertions(+), 2255 deletions(-) create mode 100644 tests/arkts-sdk/ets/ability_component.d.ts create mode 100644 tests/arkts-sdk/ets/action_sheet.d.ts create mode 100644 tests/arkts-sdk/ets/alert_dialog.d.ts create mode 100644 tests/arkts-sdk/ets/alphabet_indexer.d.ts create mode 100644 tests/arkts-sdk/ets/animator.d.ts create mode 100644 tests/arkts-sdk/ets/badge.d.ts create mode 100644 tests/arkts-sdk/ets/blank.d.ts create mode 100644 tests/arkts-sdk/ets/button.d.ts create mode 100644 tests/arkts-sdk/ets/calendar.d.ts create mode 100644 tests/arkts-sdk/ets/calendar_picker.d.ts create mode 100644 tests/arkts-sdk/ets/canvas.d.ts create mode 100644 tests/arkts-sdk/ets/checkbox.d.ts create mode 100644 tests/arkts-sdk/ets/checkboxgroup.d.ts create mode 100644 tests/arkts-sdk/ets/circle.d.ts create mode 100644 tests/arkts-sdk/ets/column.d.ts create mode 100644 tests/arkts-sdk/ets/column_split.d.ts create mode 100644 tests/arkts-sdk/ets/common.d.ts create mode 100644 tests/arkts-sdk/ets/component3d.d.ts create mode 100644 tests/arkts-sdk/ets/container_span.d.ts rename tests/{arkts-subset/ets/tabs.d.ts => arkts-sdk/ets/content_slot.d.ts} (32%) rename tests/{arkts-subset/ets/embedded_component.d.ts => arkts-sdk/ets/context_menu.d.ts} (39%) create mode 100644 tests/arkts-sdk/ets/counter.d.ts create mode 100644 tests/arkts-sdk/ets/custom_dialog_controller.d.ts create mode 100644 tests/arkts-sdk/ets/data_panel.d.ts create mode 100644 tests/arkts-sdk/ets/date_picker.d.ts create mode 100644 tests/arkts-sdk/ets/divider.d.ts rename tests/{arkts-subset/ets/flex.d.ts => arkts-sdk/ets/effect_component.d.ts} (31%) create mode 100644 tests/arkts-sdk/ets/ellipse.d.ts create mode 100644 tests/arkts-sdk/ets/embedded_component.d.ts create mode 100644 tests/arkts-sdk/ets/enums.d.ts create mode 100644 tests/arkts-sdk/ets/flex.d.ts create mode 100644 tests/arkts-sdk/ets/flow_item.d.ts create mode 100644 tests/arkts-sdk/ets/focus.d.ts create mode 100644 tests/arkts-sdk/ets/folder_stack.d.ts create mode 100644 tests/arkts-sdk/ets/for_each.d.ts create mode 100644 tests/arkts-sdk/ets/form_component.d.ts create mode 100644 tests/arkts-sdk/ets/form_link.d.ts create mode 100644 tests/arkts-sdk/ets/gauge.d.ts create mode 100644 tests/arkts-sdk/ets/gesture.d.ts create mode 100644 tests/arkts-sdk/ets/grid.d.ts create mode 100644 tests/arkts-sdk/ets/gridItem.d.ts create mode 100644 tests/arkts-sdk/ets/grid_col.d.ts rename tests/{arkts-subset => arkts-sdk}/ets/grid_container.d.ts (100%) create mode 100644 tests/arkts-sdk/ets/grid_row.d.ts create mode 100644 tests/arkts-sdk/ets/hyperlink.d.ts create mode 100644 tests/arkts-sdk/ets/image.d.ts create mode 100644 tests/arkts-sdk/ets/image_animator.d.ts create mode 100644 tests/arkts-sdk/ets/image_common.d.ts create mode 100644 tests/arkts-sdk/ets/image_span.d.ts create mode 100644 tests/arkts-sdk/ets/index-full.d.ts create mode 100644 tests/arkts-sdk/ets/indicatorcomponent.d.ts create mode 100644 tests/arkts-sdk/ets/inspector.d.ts create mode 100644 tests/arkts-sdk/ets/isolated_component.d.ts create mode 100644 tests/arkts-sdk/ets/lazy_for_each.d.ts create mode 100644 tests/arkts-sdk/ets/line.d.ts create mode 100644 tests/arkts-sdk/ets/linearindicator.d.ts create mode 100644 tests/arkts-sdk/ets/list.d.ts create mode 100644 tests/arkts-sdk/ets/list_item.d.ts create mode 100644 tests/arkts-sdk/ets/list_item_group.d.ts create mode 100644 tests/arkts-sdk/ets/loading_progress.d.ts create mode 100644 tests/arkts-sdk/ets/location_button.d.ts create mode 100644 tests/arkts-sdk/ets/marquee.d.ts create mode 100644 tests/arkts-sdk/ets/matrix2d.d.ts create mode 100644 tests/arkts-sdk/ets/media_cached_image.d.ts create mode 100644 tests/arkts-sdk/ets/menu.d.ts create mode 100644 tests/arkts-sdk/ets/menu_item.d.ts create mode 100644 tests/arkts-sdk/ets/menu_item_group.d.ts rename tests/{arkts-subset => arkts-sdk}/ets/nav_destination.d.ts (76%) create mode 100644 tests/arkts-sdk/ets/nav_router.d.ts rename tests/{arkts-subset => arkts-sdk}/ets/navigation.d.ts (93%) create mode 100644 tests/arkts-sdk/ets/navigator.d.ts create mode 100644 tests/arkts-sdk/ets/node_container.d.ts create mode 100644 tests/arkts-sdk/ets/page_transition.d.ts create mode 100644 tests/arkts-sdk/ets/panel.d.ts rename tests/{arkts-subset => arkts-sdk}/ets/particle.d.ts (100%) create mode 100644 tests/arkts-sdk/ets/paste_button.d.ts create mode 100644 tests/arkts-sdk/ets/path.d.ts create mode 100644 tests/arkts-sdk/ets/pattern_lock.d.ts create mode 100644 tests/arkts-sdk/ets/plugin_component.d.ts create mode 100644 tests/arkts-sdk/ets/polygon.d.ts create mode 100644 tests/arkts-sdk/ets/polyline.d.ts create mode 100644 tests/arkts-sdk/ets/progress.d.ts create mode 100644 tests/arkts-sdk/ets/qrcode.d.ts create mode 100644 tests/arkts-sdk/ets/radio.d.ts create mode 100644 tests/arkts-sdk/ets/rating.d.ts create mode 100644 tests/arkts-sdk/ets/rect.d.ts create mode 100644 tests/arkts-sdk/ets/refresh.d.ts create mode 100644 tests/arkts-sdk/ets/relative_container.d.ts create mode 100644 tests/arkts-sdk/ets/remote_window.d.ts create mode 100644 tests/arkts-sdk/ets/repeat.d.ts create mode 100644 tests/arkts-sdk/ets/rich_editor.d.ts create mode 100644 tests/arkts-sdk/ets/rich_text.d.ts rename tests/{arkts-subset/ets/navigator.d.ts => arkts-sdk/ets/root_scene.d.ts} (30%) create mode 100644 tests/arkts-sdk/ets/row.d.ts create mode 100644 tests/arkts-sdk/ets/row_split.d.ts create mode 100644 tests/arkts-sdk/ets/save_button.d.ts rename tests/{arkts-subset/ets/select.d.ts => arkts-sdk/ets/screen.d.ts} (34%) create mode 100644 tests/arkts-sdk/ets/scroll.d.ts create mode 100644 tests/arkts-sdk/ets/scroll_bar.d.ts create mode 100644 tests/arkts-sdk/ets/search.d.ts create mode 100644 tests/arkts-sdk/ets/security_component.d.ts create mode 100644 tests/arkts-sdk/ets/select.d.ts create mode 100644 tests/arkts-sdk/ets/shape.d.ts create mode 100644 tests/arkts-sdk/ets/sidebar.d.ts create mode 100644 tests/arkts-sdk/ets/slider.d.ts create mode 100644 tests/arkts-sdk/ets/span.d.ts create mode 100644 tests/arkts-sdk/ets/stack.d.ts create mode 100644 tests/arkts-sdk/ets/state_management.d.ts create mode 100644 tests/arkts-sdk/ets/stepper.d.ts create mode 100644 tests/arkts-sdk/ets/stepper_item.d.ts create mode 100644 tests/arkts-sdk/ets/styled_string.d.ts create mode 100644 tests/arkts-sdk/ets/swiper.d.ts create mode 100644 tests/arkts-sdk/ets/symbol_span.d.ts create mode 100644 tests/arkts-sdk/ets/symbolglyph.d.ts create mode 100644 tests/arkts-sdk/ets/tab_content.d.ts create mode 100644 tests/arkts-sdk/ets/tabs.d.ts create mode 100644 tests/arkts-sdk/ets/text.d.ts create mode 100644 tests/arkts-sdk/ets/text_area.d.ts create mode 100644 tests/arkts-sdk/ets/text_clock.d.ts create mode 100644 tests/arkts-sdk/ets/text_common.d.ts create mode 100644 tests/arkts-sdk/ets/text_input.d.ts create mode 100644 tests/arkts-sdk/ets/text_picker.d.ts create mode 100644 tests/arkts-sdk/ets/text_timer.d.ts create mode 100644 tests/arkts-sdk/ets/time_picker.d.ts create mode 100644 tests/arkts-sdk/ets/toggle.d.ts create mode 100644 tests/arkts-sdk/ets/ui_extension_component.d.ts create mode 100644 tests/arkts-sdk/ets/units.d.ts create mode 100644 tests/arkts-sdk/ets/video.d.ts create mode 100644 tests/arkts-sdk/ets/water_flow.d.ts create mode 100644 tests/arkts-sdk/ets/web.d.ts create mode 100644 tests/arkts-sdk/ets/window_scene.d.ts create mode 100644 tests/arkts-sdk/ets/with_theme.d.ts create mode 100644 tests/arkts-sdk/ets/xcomponent.d.ts create mode 100644 tests/arkts-sdk/resource/resource.d.ts create mode 100644 tests/arkts-subset/ets/alert_dialog.d.ts delete mode 100644 tests/arkts-subset/ets/calendar_picker.d.ts delete mode 100644 tests/arkts-subset/ets/canvas.d.ts create mode 100644 tests/arkts-subset/ets/circle.d.ts delete mode 100644 tests/arkts-subset/ets/counter.d.ts delete mode 100644 tests/arkts-subset/ets/divider.d.ts create mode 100644 tests/arkts-subset/ets/ellipse.d.ts create mode 100644 tests/arkts-subset/ets/focus.d.ts delete mode 100644 tests/arkts-subset/ets/form_component.d.ts create mode 100644 tests/arkts-subset/ets/indicatorcomponent.d.ts delete mode 100644 tests/arkts-subset/ets/list_item.d.ts delete mode 100644 tests/arkts-subset/ets/matrix2d.d.ts create mode 100644 tests/arkts-subset/ets/path.d.ts create mode 100644 tests/arkts-subset/ets/rich_editor.d.ts delete mode 100644 tests/arkts-subset/ets/row.d.ts create mode 100644 tests/arkts-subset/ets/search.d.ts delete mode 100644 tests/arkts-subset/ets/security_component.d.ts delete mode 100644 tests/arkts-subset/ets/shape.d.ts delete mode 100644 tests/arkts-subset/ets/sidebar.d.ts delete mode 100644 tests/arkts-subset/ets/slider.d.ts delete mode 100644 tests/arkts-subset/ets/stack.d.ts delete mode 100644 tests/arkts-subset/ets/tab_content.d.ts delete mode 100644 tests/arkts-subset/ets/test.d.ts delete mode 100644 tests/arkts-subset/ets/text.d.ts create mode 100644 tests/arkts-subset/ets/text_common.d.ts delete mode 100644 tests/arkts-subset/ets/toggle.d.ts delete mode 100644 tests/arkts-subset/ets/ui_extension_component.d.ts delete mode 100644 tests/arkts-subset/ets/vector.d.ts diff --git a/external b/external index 035835fe..675b0eaf 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit 035835fe84268d52ca5096204306a8ca85628313 +Subproject commit 675b0eafd975fa4d8686ba1feba59846dcbe7a8d diff --git a/package.json b/package.json index 077c08ae..df74d31e 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "compile:arkts:common": "cd ./external/incremental/common/ && npm run compile:arkts", "compile:arkts:runtime": "cd ./external/incremental/runtime/ && npm run compile:arkts && echo ATTENTION: the runtime is compiled without unmemoization here!", "compile:arkts:interop": "cd ./external/interop/ && npm run compile:arkts && echo ATTENTION: an interop is compiled without unmemoization here!", - "compile:arkts:peers": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-peers.json --ets-module --extension sts --list-files --compiler-memory-size=1073741824", + "compile:arkts:peers": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-peers.json --ets-module --extension sts --list-files", "compile:arkts:subset": "npm run make:arkts && npm run compile:arkts", "compile:arkts:subset:main": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-subset-main.json --extension sts --list-files", "compile:arkts:peers:main": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-peers-main.json --extension sts --list-files", diff --git a/peer_lib/sig/arkoala-arkts/arkui/src/generated/main.ts b/peer_lib/sig/arkoala-arkts/arkui/src/generated/main.ts index da22bb46..6e8e9a97 100644 --- a/peer_lib/sig/arkoala-arkts/arkui/src/generated/main.ts +++ b/peer_lib/sig/arkoala-arkts/arkui/src/generated/main.ts @@ -20,36 +20,39 @@ import { ArkColumnPeer } from "@arkoala/arkui/peers/ArkColumnPeer" import { ArkUINodeType } from "@arkoala/arkui/peers/ArkUINodeType" import { ButtonType, LabelStyle } from '@arkoala/arkui/ArkButtonInterfaces' import { BlurOptions, - SheetSize, - BlurStyle, - SheetType, - SheetDismiss, - DismissSheetAction, - SpringBackAction, - EdgeWidths, - LocalizedEdgeWidths, - EdgeColors, - LocalizedEdgeColors, - BorderStyle, - ShadowOptions, - ShadowStyle, - SheetMode, - Callback, - SheetTitleOptions, - SheetOptions, - CustomBuilder, - EdgeStyles, - UIContext, - ScrollSizeMode, - Position, - SheetKeyboardAvoidMode } from "@arkoala/arkui/ArkCommonInterfaces" + SheetSize, + BlurStyle, + SheetType, + SheetDismiss, + DismissSheetAction, + SpringBackAction, + EdgeWidths, + LocalizedEdgeWidths, + EdgeColors, + LocalizedEdgeColors, + BorderStyle, + ShadowOptions, + ShadowStyle, + SheetMode, + Callback, + SheetTitleOptions, + SheetOptions, + CustomBuilder, + EdgeStyles, + UIContext, + ScrollSizeMode, + Position, + SheetKeyboardAvoidMode, + HoverModeAreaType } from "@arkoala/arkui/ArkCommonInterfaces" import { Dimension, - Length, - LengthMetrics, - Resource, - ResourceColor, - ResourceStr, - Font } from "@arkoala/arkui/ArkUnitsInterfaces" + Length, + LengthMetrics, + ResourceColor, + ResourceStr, + Font, + Position } from "@arkoala/arkui/ArkUnitsInterfaces" + +import { Resource } from "./ArkResourceInterfaces" import { TextOverflow, TextHeightAdaptivePolicy } from "@arkoala/arkui/ArkEnumsInterfaces" @@ -177,39 +180,40 @@ class SheetTitleOptionsImpl implements SheetTitleOptions { this._subtitle = arg } } - class SheetOptionsImpl implements SheetOptions { - _title: SheetTitleOptions | CustomBuilder| undefined - _detents: [(SheetSize | Length), (SheetSize | Length) | undefined, (SheetSize | Length) | undefined] | undefined - _height: SheetSize | Length| undefined - _dragBar: boolean| undefined - _maskColor: ResourceColor| undefined - _blurStyle: BlurStyle| undefined - _showClose: boolean | Resource| undefined - _preferType: SheetType| undefined - _shouldDismiss: ((sheetDismiss: SheetDismiss) => void) | undefined - _onWillDismiss: Callback| undefined - _onWillSpringBackWhenDismiss: Callback| undefined - _enableOutsideInteractive: boolean| undefined - _width: Dimension| undefined - _borderWidth: Dimension | EdgeWidths | LocalizedEdgeWidths| undefined - _borderColor: ResourceColor | EdgeColors | LocalizedEdgeColors| undefined - _borderStyle: BorderStyle | EdgeStyles| undefined - _shadow: ShadowOptions | ShadowStyle| undefined - _onHeightDidChange: Callback| undefined - _mode: SheetMode| undefined - _scrollSizeMode?: ScrollSizeMode | undefined - _onDetentsDidChange: Callback| undefined - _onWidthDidChange: Callback| undefined - _onTypeDidChange: Callback| undefined - _uiContext: UIContext| undefined - _backgroundColor: ResourceColor | undefined - _onAppear: (() => void) | undefined - _onDisappear: (() => void) | undefined - _onWillAppear: (() => void) | undefined - _onWillDisappear: (() => void) | undefined - _keyboardAvoidMode: SheetKeyboardAvoidMode | undefined - _offset: Position | undefined + _height: SheetSize | Length|undefined; + _dragBar: boolean|undefined; + _maskColor: ResourceColor|undefined; + _detents: [ SheetSize | Length, SheetSize | Length | undefined, SheetSize | Length | undefined ]|undefined; + _blurStyle: BlurStyle|undefined; + _showClose: boolean | Resource|undefined; + _preferType: SheetType|undefined; + _title: SheetTitleOptions | CustomBuilder|undefined; + _shouldDismiss: Callback|undefined; + _onWillDismiss: Callback|undefined; + _onWillSpringBackWhenDismiss: Callback|undefined; + _enableOutsideInteractive: boolean|undefined; + _width: Dimension|undefined; + _borderWidth: Dimension | EdgeWidths | LocalizedEdgeWidths|undefined; + _borderColor: ResourceColor | EdgeColors | LocalizedEdgeColors|undefined; + _borderStyle: BorderStyle | EdgeStyles|undefined; + _shadow: ShadowOptions | ShadowStyle|undefined; + _onHeightDidChange: Callback|undefined; + _mode: SheetMode|undefined; + _scrollSizeMode: ScrollSizeMode|undefined; + _onDetentsDidChange: Callback|undefined; + _onWidthDidChange: Callback|undefined; + _onTypeDidChange: Callback|undefined; + _uiContext: UIContext|undefined; + _keyboardAvoidMode: SheetKeyboardAvoidMode|undefined; + _enableHoverMode: boolean|undefined; + _hoverModeArea: HoverModeAreaType|undefined; + _backgroundColor: ResourceColor|undefined; + _onAppear: (() => void)|undefined; + _onDisappear: (() => void)|undefined; + _onWillAppear: (() => void)|undefined; + _onWillDisappear: (() => void)|undefined; + _offset?: Position; constructor(title?: SheetTitleOptions) { this._title = title @@ -383,6 +387,20 @@ class SheetOptionsImpl implements SheetOptions { this._uiContext = arg } + get enableHoverMode(): boolean | undefined { + return this._enableHoverMode + } + set enableHoverMode(arg: boolean | undefined) { + this._enableHoverMode = arg + } + + get hoverModeArea(): HoverModeAreaType | undefined { + return this._hoverModeArea + } + set hoverModeArea(arg: HoverModeAreaType | undefined) { + this._hoverModeArea = arg + } + get backgroundColor(): ResourceColor | undefined { return this._backgroundColor } diff --git a/peer_lib/sig/arkoala-arkts/arkui/src/generated/peers/SerializerBase.ts b/peer_lib/sig/arkoala-arkts/arkui/src/generated/peers/SerializerBase.ts index cb60e88d..c504d51a 100644 --- a/peer_lib/sig/arkoala-arkts/arkui/src/generated/peers/SerializerBase.ts +++ b/peer_lib/sig/arkoala-arkts/arkui/src/generated/peers/SerializerBase.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { float32, float64, int32, int8 } from "@koalaui/common" +import { float32, float64, int8, int32, int64 } from "@koalaui/common" import { pointer, KUint8ArrayPtr, KBuffer, ResourceId, ResourceHolder } from "@koalaui/interop" import { CallbackKind } from "./CallbackKind" import { Length } from "../ArkUnitsInterfaces" @@ -79,7 +79,7 @@ export function isResource(value: Object|undefined): boolean { return false } -export function isInstanceOf(className: string, value: Object): boolean { +export function isInstanceOf(className: string, value: Object|undefined): boolean { // TODO: fix me! return false } @@ -227,6 +227,18 @@ export class SerializerBase { this.setInt32(this.position, value) this.position += 4 } + writeInt64(value: int64) { + this.checkCapacity(8) + this.buffer.set(this.position + 0, ((value ) & 0xff) as int8) + this.buffer.set(this.position + 1, ((value >> 8) & 0xff) as int8) + this.buffer.set(this.position + 2, ((value >> 16) & 0xff) as int8) + this.buffer.set(this.position + 3, ((value >> 24) & 0xff) as int8) + this.buffer.set(this.position + 4, ((value >> 32) & 0xff) as int8) + this.buffer.set(this.position + 5, ((value >> 40) & 0xff) as int8) + this.buffer.set(this.position + 6, ((value >> 48) & 0xff) as int8) + this.buffer.set(this.position + 7, ((value >> 56) & 0xff) as int8) + this.position += 8 + } writeFloat32(value: float32) { // TODO: this is wrong! this.checkCapacity(4) @@ -240,16 +252,7 @@ export class SerializerBase { if (typeof value === "bigint") // todo where it is possible to be called from? throw new Error("Not implemented") - this.checkCapacity(8) - this.buffer.set(this.position + 0, ((value ) & 0xff) as int8) - this.buffer.set(this.position + 1, ((value >> 8) & 0xff) as int8) - this.buffer.set(this.position + 2, ((value >> 16) & 0xff) as int8) - this.buffer.set(this.position + 3, ((value >> 24) & 0xff) as int8) - this.buffer.set(this.position + 4, ((value >> 32) & 0xff) as int8) - this.buffer.set(this.position + 5, ((value >> 40) & 0xff) as int8) - this.buffer.set(this.position + 6, ((value >> 48) & 0xff) as int8) - this.buffer.set(this.position + 7, ((value >> 56) & 0xff) as int8) - this.position += 8 + this.writeInt64(value) } writeBoolean(value: boolean|undefined) { this.checkCapacity(1) diff --git a/src/IDLVisitor.ts b/src/IDLVisitor.ts index d27f3509..5df94ee0 100644 --- a/src/IDLVisitor.ts +++ b/src/IDLVisitor.ts @@ -560,7 +560,7 @@ export class IDLVisitor implements GenericVisitor { }) } - serializeTupleType(node: ts.TupleTypeNode, nameSuggestion?: NameSuggestion, typeParameters?: ts.NodeArray, withOperator: boolean = false): idl.IDLInterface { + serializeTupleType(node: ts.TupleTypeNode, nameSuggestion?: NameSuggestion, typeParameters?: ts.NodeArray, withOperator: boolean = false): idl.IDLInterface { const properties = node.elements.map((it, index) => this.serializeTupleProperty(it, index, withOperator)) const syntheticName = `Tuple_${properties.map(it => this.computeTypeName(it.type)).join("_")}` const selectedName = selectName(nameSuggestion, syntheticName) @@ -785,7 +785,7 @@ export class IDLVisitor implements GenericVisitor { } return idl.createTypeParameterReference(paramName) } - return this.serializeType(arg) + return this.serializeType(arg, undefined, typeArgs) }) } @@ -797,7 +797,7 @@ export class IDLVisitor implements GenericVisitor { } } - serializeType(type: ts.TypeNode | undefined, nameSuggestion?: NameSuggestion): idl.IDLType { + serializeType(type: ts.TypeNode | undefined, nameSuggestion?: NameSuggestion, typeArgs?: ts.NodeArray): idl.IDLType { if (type == undefined) return idl.IDLUndefinedType // TODO: can we have implicit types in d.ts? if (type.kind == ts.SyntaxKind.UndefinedKeyword) { @@ -873,7 +873,7 @@ export class IDLVisitor implements GenericVisitor { return idl.createContainerType("sequence", [this.serializeType(type.elementType, nameSuggestion)]) } if (ts.isTupleTypeNode(type)) { - const tupleType = this.serializeTupleType(type, nameSuggestion) + const tupleType = this.serializeTupleType(type, nameSuggestion, typeArgs) this.addSyntheticType(tupleType) return idl.createReferenceType(tupleType.name) } @@ -1329,8 +1329,13 @@ export class IDLVisitor implements GenericVisitor { throw new Error(`Cannot infer type of ${declaration.getText()}`) } - private collectTypeParameters(typeParameters: ts.NodeArray | undefined): string[] | undefined { - return this.context.typeParameterMap ? undefined : typeParameters?.map(it => it.getText()) + private collectTypeParameters(typeParameters: ts.NodeArray | undefined): string[] | undefined { + return this.context.typeParameterMap ? undefined : typeParameters?.flatMap(it => { + if (ts.isTupleTypeNode(it)) { + return it.elements.map(it => it.getText()) + } + return it.getText() + }) } } diff --git a/src/main.ts b/src/main.ts index 12cbf295..3fadbe30 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,7 +19,15 @@ import * as path from "path" import { fromIDL } from "./from-idl/common" import { idlToString } from "./from-idl/DtsPrinter" import { generate } from "./idlize" -import { forEachChild, IDLEntry, toIDLString, transformMethodsAsync2ReturnPromise } from "./idl" +import { + forEachChild, + IDLEntry, + isClass, + isEnum, + isInterface, + toIDLString, + transformMethodsAsync2ReturnPromise +} from "./idl" import { LinterVisitor, toLinterString } from "./linter" import { LinterMessage } from "./LinterMessage" import { IDLVisitor } from "./IDLVisitor" @@ -334,7 +342,23 @@ if (options.dts2peer) { { compilerOptions: defaultCompilerOptions, onSingleFile(entries: IDLEntry[], outputDir, sourceFile) { - entries.forEach(transformMethodsAsync2ReturnPromise) + // Search for duplicate declarations + entries = entries.filter(newEntry => + !idlLibrary.files.find(peerFile => peerFile.entries.find(entry => { + if (([newEntry, entry].every(isInterface) + || [newEntry, entry].every(isClass) + || [newEntry, entry].every(isEnum))) { + if (newEntry.name === entry.name) { + console.warn(`WARNING: Skip entry:'${newEntry.name}'(${sourceFile.fileName}) already exists in ${peerFile.originalFilename}`) + return true + } + } + })) + ) + entries.forEach(it => { + transformMethodsAsync2ReturnPromise(it) + correctOverloadedProperties(it, idlLibrary) + }) const file = new PeerFile(sourceFile.fileName, entries, idlLibrary.componentsToGenerate) idlLibrary.files.push(file) }, @@ -403,3 +427,26 @@ if (options.dts2peer) { if (!didJob) { program.help() } + +function correctOverloadedProperties(entry: IDLEntry, idlLibrary: PeerLibrary) { + if (idlLibrary.language !== Language.ARKTS) { + return; + } + if (!isInterface(entry) && !isClass(entry)) { + return; + } + if (entry.inheritance.length !== 1) { + return; + } + const firstParent = idlLibrary.toDeclaration(entry.inheritance[0]) + if (!isInterface(firstParent) && !isClass(firstParent)) { + return; + } + entry.properties.forEach(prop => { + const overloadedProp = + firstParent.properties.find(it => it.name === prop.name) + if (overloadedProp !== undefined) { + prop.type = overloadedProp.type + } + }) +} \ No newline at end of file diff --git a/src/peer-generation/ArgConvertors.ts b/src/peer-generation/ArgConvertors.ts index 2c0c0878..a57c66b8 100644 --- a/src/peer-generation/ArgConvertors.ts +++ b/src/peer-generation/ArgConvertors.ts @@ -908,10 +908,11 @@ export class InterfaceConvertor extends BaseArgConvertor { // writer.makeString(`${castExpr.asString()}.type`), writer.makeString(`GestureName.${gestureType}`)]) } - if (this.declaration.name === "CancelButtonSymbolOptions") { - return writer.makeNaryOp("&&", [ - writer.makeString(`${value}.hasOwnProperty("icon")`), - writer.makeString(`isInstanceOf("SymbolGlyphModifier", ${value}.icon)`)]) + //TODO: Need to check this in TypeChecker + if (this.declaration.name === "CancelButtonSymbolOptions" + && writer.language !== Language.ARKTS) { + return writer.makeHasOwnProperty(value, "CancelButtonSymbolOptions", + "icon", "SymbolGlyphModifier") } // Try to figure out interface by examining field sets const uniqueFields = this.declaration?.properties.filter(it => !duplicates.has(it.name)) @@ -1191,9 +1192,11 @@ export class DateConvertor extends BaseArgConvertor { // convertorSerialize(param: string, value: string, writer: LanguageWriter): void { if (writer.language === Language.CPP) { writer.writeMethodCall(`${param}Serializer`, "writeInt64", [value]) - return + } else { + writer.writeMethodCall(`${param}Serializer`, "writeInt64", [ + writer.makeCast(writer.makeString(`${value}.getTime()`), idl.IDLI64Type).asString() + ]) } - writer.writeMethodCall(`${param}Serializer`, "writeInt64", [`${value}.getTime()`]) } convertorDeserialize(bufferName: string, deserializerName: string, assigneer: ExpressionAssigneer, writer: LanguageWriter): LanguageStatement { const deserializeTime = writer.makeMethodCall(`${deserializerName}`, "readInt64", []) diff --git a/src/peer-generation/FileGenerators.ts b/src/peer-generation/FileGenerators.ts index 40094fda..dc4cfc6f 100644 --- a/src/peer-generation/FileGenerators.ts +++ b/src/peer-generation/FileGenerators.ts @@ -292,7 +292,7 @@ export function makeTSSerializer(library: PeerLibrary): LanguageWriter { if (printer.language == Language.ARKTS) { imports.addFeatures(["NativeModule"], "#components") imports.addFeatures(["CallbackKind"], "CallbackKind") - imports.addFeatures(['KStringPtr', 'nullptr', 'KInt', 'KPointer'], '@koalaui/interop') + imports.addFeatures(['KStringPtr', 'nullptr', 'KInt', 'KPointer', 'KLong'], '@koalaui/interop') } imports.print(printer, '') writeSerializer(library, printer, "") diff --git a/src/peer-generation/ImportsCollector.ts b/src/peer-generation/ImportsCollector.ts index 32a271bb..8bc15807 100644 --- a/src/peer-generation/ImportsCollector.ts +++ b/src/peer-generation/ImportsCollector.ts @@ -26,8 +26,17 @@ export class ImportsCollector { * @param module Module name - can be package started with `@` or relative path from current package root */ addFeature(feature: string, module: string) { - const dependencies = getOrPut(this.moduleToFeatures, path.normalize(module), () => new Set()) - dependencies.add(feature) + module = path.normalize(module) + // Checking for name collisions between modules + // TODO: needs to be done more effectively + const featureInAnotherModule = [...this.moduleToFeatures.entries()] + .find(it => it[0] !== module && it[1].has(feature)) + if (featureInAnotherModule) { + console.warn(`WARNING: Skip feature:'${feature}' is already imported into '${featureInAnotherModule[0]}'`) + } else { + const dependencies = getOrPut(this.moduleToFeatures, module, () => new Set()) + dependencies.add(feature) + } } addFeatures(features: string[], module: string) { diff --git a/src/peer-generation/LanguageWriters/LanguageWriter.ts b/src/peer-generation/LanguageWriters/LanguageWriter.ts index 2a1c90de..668a8694 100644 --- a/src/peer-generation/LanguageWriters/LanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/LanguageWriter.ts @@ -199,7 +199,7 @@ export class MultiBranchIfStatement implements LanguageStatement { writer.print("}") }) - if (this.elseStatement !== undefined) { + if (this.statements.length > 0 && this.elseStatement !== undefined) { writer.print(" else {") writer.pushIndent() this.elseStatement.write(writer) diff --git a/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts b/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts index c073b0c1..1b63fbc1 100644 --- a/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts +++ b/src/peer-generation/LanguageWriters/convertors/ETSConvertors.ts @@ -15,14 +15,15 @@ import * as idl from "../../../idl"; import { TsIDLNodeToStringConverter } from "./TSConvertors"; -import {createReferenceType, IDLReferenceType, IDLType} from "../../../idl"; +import { createReferenceType, IDLEntry, IDLReferenceType } from "../../../idl"; import { createDeclarationNameConvertor, DeclarationNameConvertor } from "../../idl/IdlNameConvertor"; import { convertDeclaration } from "../nameConvertor"; import { Language } from "../../../Language"; +import { stringOrNone } from "../../../util"; export class EtsIDLNodeToStringConvertor extends TsIDLNodeToStringConverter { convertTypeReference(type: IDLReferenceType): string { - // Only to deal with namespaces. TODO: remove later + // Only to deal with namespaces. TODO: remove later const decl = this.resolver.resolveTypeReference(type) if (decl && idl.isEnum(decl)) { return convertDeclaration(createDeclarationNameConvertor(Language.ARKTS), decl) @@ -107,4 +108,8 @@ export class EtsIDLNodeToStringConvertor extends TsIDLNodeToStringConverter { }) return `Function${types.length}<${types.join(",")}${types.length > 0 ? "," : ""}${this.convert(decl.returnType)}>` } + + protected getNamespacePrefix(decl: IDLEntry): stringOrNone { + return idl.getExtAttribute(decl, idl.IDLExtendedAttributes.Namespace); + } } diff --git a/src/peer-generation/LanguageWriters/convertors/TSConvertors.ts b/src/peer-generation/LanguageWriters/convertors/TSConvertors.ts index c5585887..ca9ddda5 100644 --- a/src/peer-generation/LanguageWriters/convertors/TSConvertors.ts +++ b/src/peer-generation/LanguageWriters/convertors/TSConvertors.ts @@ -16,7 +16,8 @@ import { convertNode, IdlNameConvertor, NodeConvertor } from '../nameConvertor' import * as idl from '../../../idl' import { ReferenceResolver } from '../../ReferenceResolver' -import { throwException } from '../../../util' +import { stringOrNone, throwException } from '../../../util' +import { IDLEntry } from "../../../idl"; export class TsIDLNodeToStringConverter implements NodeConvertor, IdlNameConvertor { @@ -79,6 +80,15 @@ export class TsIDLNodeToStringConverter implements NodeConvertor, IdlNam const [where, what] = match.slice(2) return `IMPORT_${what}_FROM_${where}`.match(/[a-zA-Z]+/g)!.join('_') } + + protected getNamespacePrefix(decl: IDLEntry): stringOrNone { + let namespace = idl.getExtAttribute(decl, idl.IDLExtendedAttributes.Namespace) + if (namespace !== undefined) { + namespace += "." + } + return namespace + } + convertTypeReference(type: idl.IDLReferenceType): string { const decl = this.resolver.resolveTypeReference(type)! let namespacePrefix = '' @@ -94,9 +104,9 @@ export class TsIDLNodeToStringConverter implements NodeConvertor, IdlNam } } if (idl.isEnum(decl)) { - const namespaceAttr = idl.getExtAttribute(decl, idl.IDLExtendedAttributes.Namespace) - if (namespaceAttr) { - namespacePrefix = namespaceAttr + '.' + const prefix = this.getNamespacePrefix(decl) + if (prefix !== undefined) { + namespacePrefix = prefix; } } } diff --git a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts index 823b3ac7..dd35bde9 100644 --- a/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/ETSLanguageWriter.ts @@ -219,10 +219,9 @@ export class ETSLanguageWriter extends TSLanguageWriter { value: string, accessors: string[], duplicates: Set): LanguageExpression { - if (convertor instanceof CustomTypeConvertor) { - return this.makeString(`${value} instanceof ${convertor.customTypeName}`) - } - if (convertor instanceof AggregateConvertor || convertor instanceof InterfaceConvertor) { + if (convertor instanceof AggregateConvertor + || convertor instanceof InterfaceConvertor + || convertor instanceof CustomTypeConvertor) { return this.instanceOf(convertor, value, duplicates) } return this.makeString(`${value} instanceof ${convertor.targetType(this)}`) @@ -271,7 +270,7 @@ export class ETSLanguageWriter extends TSLanguageWriter { propertyTypeName: string): LanguageExpression { return this.makeNaryOp("&&", [ this.makeString(`${value} instanceof ${valueTypeName}`), - this.makeString(`${value}.${property} instanceof ${propertyTypeName}`)]) + this.makeString(`isInstanceOf("${propertyTypeName}", ${value}.${property})`)]) } makeEquals(args: LanguageExpression[]): LanguageExpression { // TODO: Error elimination: 'TypeError: Both operands have to be reference types' @@ -289,7 +288,14 @@ export class ETSLanguageWriter extends TSLanguageWriter { override castToBoolean(value: string): string { return `${value} ? 1 : 0` } override instanceOf(convertor: BaseArgConvertor, value: string, duplicateMembers?: Set): LanguageExpression { - if (convertor instanceof InterfaceConvertor && convertor.declaration.properties.length > 0) { + if (convertor instanceof CustomTypeConvertor) { + return makeInterfaceTypeCheckerCall(value, + this.getNodeName(convertor.idlType), + [], + duplicateMembers!, + this) + } + if (convertor instanceof InterfaceConvertor && convertor.declaration.properties.length >= 0) { return makeInterfaceTypeCheckerCall(value, this.getNodeName(convertor.idlType), convertor.declaration.properties.map(it => it.name), diff --git a/src/peer-generation/PeerGeneratorConfig.ts b/src/peer-generation/PeerGeneratorConfig.ts index 19d6d676..0e8ce977 100644 --- a/src/peer-generation/PeerGeneratorConfig.ts +++ b/src/peer-generation/PeerGeneratorConfig.ts @@ -91,7 +91,7 @@ export class PeerGeneratorConfig { "GestureHandler", // class with generics // constant values need to be generated // "equals(id: TextMenuItemId): boolean" method leads to the "cycle detected" message - "TextMenuItemId", + // "TextMenuItemId", // SyntaxError: Unexpected token, expected 'private' or identifier [ArkTextCommonInterfaces.ts:52:24] "AnimatableArithmetic", // Unused generic class ] diff --git a/src/peer-generation/PeerLibrary.ts b/src/peer-generation/PeerLibrary.ts index 5f3d3f57..e3466e3b 100644 --- a/src/peer-generation/PeerLibrary.ts +++ b/src/peer-generation/PeerLibrary.ts @@ -216,7 +216,7 @@ export class PeerLibrary implements LibraryInterface { } if (idl.isTypeParameterType(type)) { // TODO: unlikely correct. - return new CustomTypeConvertor(param, this.targetNameConvertorInstance.convert(type)) + return new CustomTypeConvertor(param, this.targetNameConvertorInstance.convert(type), true) } throw new Error(`Cannot convert: ${type.kind}`) } @@ -329,6 +329,8 @@ export class PeerLibrary implements LibraryInterface { const decl = this.resolveTypeReference(type) if (!decl) { console.log(`WARNING: undeclared type ${idl.DebugUtils.debugPrintType(type)}`) + } else if (isConflictingDeclaration(decl)) { + return ArkCustomObject } return !decl ? ArkCustomObject // assume some builtin type : idl.isTypedef(decl) ? this.toDeclaration(decl.type) diff --git a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts index 3d6c916d..79bd83ce 100644 --- a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts +++ b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts @@ -14,7 +14,14 @@ */ import * as idl from "../../idl" -import { IDLReferenceType, IDLType, maybeOptional} from "../../idl" +import { + getExtAttribute, + IDLExtendedAttributes, + IDLNode, + IDLReferenceType, + IDLType, + maybeOptional +} from "../../idl" import { posix as path } from "path" import { capitalize, @@ -35,6 +42,7 @@ import { MaterializedClass, MaterializedField, MaterializedMethod, SuperElement import { createTypeNameConvertor, Field, FieldModifier, Method, MethodModifier, NamedMethodSignature } from "../LanguageWriters"; import { convertDeclaration, IdlNameConvertor } from "../LanguageWriters/nameConvertor"; import { + addSyntheticDeclarationDependency, isSyntheticDeclaration, makeSyntheticDeclCompletely, makeSyntheticTypeAliasDeclaration, @@ -286,6 +294,26 @@ class ArkTSImportsAggregateCollector extends ImportsAggregateCollector { super(peerLibrary, true) } + override convertImport(type: IDLReferenceType, importClause: string): IDLNode[] { + const generatedName = this.peerLibrary.mapType(type) + const ref = idl.createReferenceType(idl.forceAsNamedNode(type).name) + const resolvedType = this.peerLibrary.resolveTypeReference(ref) + if (resolvedType !== undefined && !idl.isTypedef(resolvedType)) { + const syntheticDeclaration = makeSyntheticTypeAliasDeclaration( + 'SyntheticDeclarations', generatedName, ref) + if (!this.peerLibrary.importTypesStubToSource.has(generatedName)) { + this.peerLibrary.importTypesStubToSource.set(generatedName, type.name) + } + addSyntheticDeclarationDependency(syntheticDeclaration, + convertDeclToFeature(this.peerLibrary, resolvedType)) + return [ + ...super.convertImport(type, importClause), + syntheticDeclaration + ] + } + return super.convertImport(type, importClause); + } + override convertContainer(type: idl.IDLContainerType): idl.IDLNode[] { if (idl.IDLContainerUtils.isSequence(type)) { // todo: check this.peerLibrary instanceof IdlPeerLibrary) @@ -1002,13 +1030,16 @@ export class IdlPeerProcessor { return new MaterializedMethod(decl.name, [], retConvertor, false, ctor) } - const generics = undefined // method.typeParameters?.map(it => it.getText()) + const methodTypeParams = getExtAttribute(method, IDLExtendedAttributes.TypeParameters) method.parameters.forEach(it => this.library.requestType(it.type!, true)) const argConvertors = method.parameters.map(param => generateArgConvertor(this.library, param)) const signature = generateSignature(method) const modifiers = idl.isConstructor(method) || method.isStatic ? [MethodModifier.STATIC] : [] return new MaterializedMethod(decl.name, argConvertors, retConvertor, false, - new Method(methodName, signature, modifiers, generics) + new Method(methodName, + signature, + modifiers, + methodTypeParams !== undefined ? [methodTypeParams] : undefined) ) } @@ -1205,7 +1236,7 @@ export function isConflictingDeclaration(decl: idl.IDLEntry): boolean {/// stole // just has ugly dependency WrappedBuilder - there is conflict in generic types if (idl.isInterface(decl) && decl.name === 'ContentModifier') return true // complicated type arguments - if (idl.isClass(decl) && decl.name === 'TransitionEffect') return true + // if (idl.isClass(decl) && decl.name === 'TransitionEffect') return true // inside namespace // if (idl.isEnum(decl) && decl.name === 'GestureType') return true // no return type in some methods diff --git a/src/peer-generation/printers/InterfacePrinter.ts b/src/peer-generation/printers/InterfacePrinter.ts index e4648a3a..cc5d789d 100644 --- a/src/peer-generation/printers/InterfacePrinter.ts +++ b/src/peer-generation/printers/InterfacePrinter.ts @@ -45,11 +45,11 @@ import { ARK_OBJECTBASE, ARKOALA_PACKAGE, ARKOALA_PACKAGE_PATH, INT_VALUE_GETTER import { printJavaImports } from '../printers/lang/JavaPrinters' import { collectJavaImports } from '../printers/lang/JavaIdlUtils' import { Language } from '../../Language' -import { escapeKeyword, IDLKind } from "../../idl"; import { ETSLanguageWriter } from '../LanguageWriters/writers/ETSLanguageWriter' import { collectProperties } from './StructPrinter' import { CustomPrintVisitor } from "../../from-idl/DtsPrinter" import { stubIsTypeCallback } from '../ArgConvertors' +import { escapeKeyword, IDLType } from "../../idl"; interface InterfacesVisitor { getInterfaces(): Map @@ -441,19 +441,19 @@ export class ArkTSDeclConvertor extends TSDeclConvertor { const type = this.typeNameConvertor.getNodeName(node.type) const typeParams = this.printTypeParameters(node.typeParameters) // TODO: needs to be implemented correctly on the idl side - if (node.name === "Resource") { - this.convertInterface(idl.createInterface(node.name, - IDLKind.Interface, - [], [], [], [ - idl.createProperty("bundleName", idl.createReferenceType("KStringPtr")), - idl.createProperty("moduleName", idl.createReferenceType("KStringPtr")), - idl.createProperty("params", idl.createReferenceType("Array"), false, false, true), - idl.createProperty("id", idl.createReferenceType("number")), - idl.createProperty("type", idl.createReferenceType("number"), false, false, true), - ], [], [])) - } else { - this.writer.print(`export declare type ${node.name}${typeParams} = ${type};`) - } + // if (node.name === "Resource") { + // this.convertInterface(idl.createInterface(node.name, + // idl.IDLKind.Interface, + // [], [], [], [ + // idl.createProperty("bundleName", idl.createReferenceType("KStringPtr")), + // idl.createProperty("moduleName", idl.createReferenceType("KStringPtr")), + // idl.createProperty("params", idl.createReferenceType("Array"), false, false, true), + // idl.createProperty("id", idl.createReferenceType("number")), + // idl.createProperty("type", idl.createReferenceType("number"), false, false, true), + // ], [], [])) + // } else { + // } + this.writer.print(`export declare type ${node.name}${typeParams} = ${type};`) } convertCallback(node: idl.IDLCallback) { @@ -472,6 +472,8 @@ export class ArkTSDeclConvertor extends TSDeclConvertor { result = this.printCallback(node, node.callables[0].parameters, node.callables[0].returnType) + } else if (idl.isTupleInterface(node)) { + result = this.printTuple(node).join("\n") } else { result = this.printInterface(node).join("\n") } @@ -541,8 +543,8 @@ export class ArkTSDeclConvertor extends TSDeclConvertor { } private printMethod(idl: idl.IDLMethod): stringOrNone[] { - // TODO dirty stub. We are not processing interfaces methods as a - // callbacks for now, so interfaces with methods can not be + // TODO dirty stub. We are not processing interfaces methods as a + // callbacks for now, so interfaces with methods can not be // deserialized in ArkTS return [] // return [ @@ -586,7 +588,7 @@ export class ArkTSDeclConvertor extends TSDeclConvertor { } private printTypeParameters(typeParameters: string[] | undefined): string { - return typeParameters?.length ? `<${typeParameters.join(",")}>` : "" + return typeParameters?.length ? `<${typeParameters.join(",").replace("[]", "")}>` : "" } private convertType(idlType: idl.IDLType): string { @@ -608,6 +610,33 @@ export class ArkTSDeclConvertor extends TSDeclConvertor { node.methods] .reduce((sum, value) => value.length + sum, 0) === 0 } + + private printTuple(tuple: idl.IDLInterface) { + const seenFields = new Set() + return ([`declare type ${this.printInterfaceName(tuple)} = [`] as stringOrNone[]) + .concat(tuple.properties + .map(it => this.iDLTypedEntryPrinter(it, it => { + //TODO: use ETSConvertor.processTupleType + let property = it; + if (property.isOptional) { + let types: IDLType[] = [] + if (idl.isUnionType(it.type)) { + types = it.type.types + } else if (idl.isPrimitiveType(it.type)) { + types = [it.type] + } else { + throwException(`Unprocessed type: ${idl.forceAsNamedNode(it.type)}`) + } + property = idl.createProperty(it.name, + idl.createUnionType([...types, idl.IDLUndefinedType]), + it.isReadonly, + it.isStatic, + false) + } + return [indentedBy(`${this.printPropNameWithType(property)},`, 1)] + }, seenFields) ).flat()) + .concat(["]"]) + } } class ArkTSInterfacesVisitor extends TSInterfacesVisitor { diff --git a/src/peer-generation/printers/MaterializedPrinter.ts b/src/peer-generation/printers/MaterializedPrinter.ts index 48047665..1e6b00b4 100644 --- a/src/peer-generation/printers/MaterializedPrinter.ts +++ b/src/peer-generation/printers/MaterializedPrinter.ts @@ -121,9 +121,13 @@ class TSMaterializedFileVisitor extends MaterializedFileVisitorBase { // TODO: workarond for ContentModifier which returns WrappedBuilder<[T]> // and the WrappedBuilder is defined as "class WrappedBuilder"" - let generics = clazz.generics - if (clazz.className === "ContentModifier") { - generics = ["T extends Object"] + let classTypeParameters = clazz.generics + const hasMethodWithTypeParams = clazz.methods.find(it => + it.method.signature.args.find(it => idl.isTypeParameterType(it)) !== undefined + ) + // Need to restrict generic type to the Object type + if (hasMethodWithTypeParams) { + classTypeParameters = ["T extends Object"] } printer.writeClass(clazz.className, writer => { @@ -174,13 +178,17 @@ class TSMaterializedFileVisitor extends MaterializedFileVisitorBase { }) // write construct(ptr: number) method - const typeArguments = clazz.generics const clazzRefType = idl.createReferenceType(clazz.className, - typeArguments?.map(idl.createTypeParameterReference)) + clazz.generics?.map(idl.createTypeParameterReference)) const constructSig = new NamedMethodSignature(clazzRefType, [idl.IDLPointerType], ["ptr"]) - writer.writeMethodImplementation(new Method("construct", constructSig, [MethodModifier.STATIC], typeArguments), writer => { + writer.writeMethodImplementation(new Method("construct", constructSig, [MethodModifier.STATIC], classTypeParameters), writer => { const objVar = `obj${clazz.className}` - writer.writeStatement(writer.makeAssign(objVar, clazzRefType, writer.makeNewObject(clazz.className), true)) + writer.writeStatement(writer.makeAssign(objVar, + clazzRefType, + //TODO: Need to pass IDLType instead of string to makeNewObject + writer.makeNewObject(writer.getNodeName(clazzRefType)), + true) + ) writer.writeStatement( writer.makeAssign(`${objVar}.peer`, toIDLType("Finalizable"), writer.makeString(`new Finalizable(ptr, ${clazz.className}.getFinalizer())`), false), @@ -262,7 +270,7 @@ class TSMaterializedFileVisitor extends MaterializedFileVisitorBase { writePeerMethod(writer, privateMethod, true, this.printerContext, this.dumpSerialized, "_serialize", "this.peer!.ptr", returnType) this.library.setCurrentContext(undefined) }) - }, superClassName, interfaces.length === 0 ? undefined : interfaces, generics) + }, superClassName, interfaces.length === 0 ? undefined : interfaces, classTypeParameters) } visit(): void { diff --git a/src/peer-generation/printers/TypeCheckPrinter.ts b/src/peer-generation/printers/TypeCheckPrinter.ts index b1b79d8d..60f4e0cf 100644 --- a/src/peer-generation/printers/TypeCheckPrinter.ts +++ b/src/peer-generation/printers/TypeCheckPrinter.ts @@ -9,13 +9,10 @@ import { MethodModifier, NamedMethodSignature } from "../LanguageWriters"; -import { throwException } from "../../util"; import { PeerLibrary } from "../PeerLibrary"; import { convertDeclToFeature, - createDependenciesCollector, isBuilderClass, - isMaterialized, } from "../idl/IdlPeerGeneratorVisitor"; import { getSyntheticDeclarationList } from "../idl/IdlSyntheticDeclarations"; import { createDeclarationNameConvertor, DeclarationNameConvertor } from "../idl/IdlNameConvertor"; @@ -66,14 +63,20 @@ class StructDescriptor { } function collectFields(library: PeerLibrary, target: idl.IDLInterface, struct: StructDescriptor): void { - const superType = idl.getSuperType(target) - if (superType && idl.isReferenceType(superType)) { - const decl = library.resolveTypeReference(superType) ?? throwException(`Wrong type reference ${idl.IDLKind[superType.kind]}`) - if ((idl.isInterface(decl) || idl.isClass(decl) || idl.isAnonymousInterface(decl))) { - collectFields(library, decl, struct) - } + //TODO: is it need to collect conflicting declarations properties? + if (library.conflictedDeclarations.has(target)) { + return } + //TODO: is recursive property collection necessary? + // const superType = idl.getSuperType(target) + // if (superType && idl.isReferenceType(superType)) { + // const decl = library.resolveTypeReference(superType) ?? throwException(`Wrong type reference ${idl.IDLKind[superType.kind]}`) + // if ((idl.isInterface(decl) || idl.isClass(decl) || idl.isAnonymousInterface(decl))) { + // collectFields(library, decl, struct) + // } + // } + target.properties?.filter(it => !it.isStatic).forEach(it => { struct.addField(new FieldRecord(it.type, it.name, it.isOptional)) }) @@ -103,9 +106,12 @@ abstract class TypeCheckerPrinter { for (const feature of features) { imports.addFeature(feature.feature, feature.module) } - for (const file of this.library.files) - for (const feature of file.serializeImportFeatures) + //TODO: needs to collect imports via DeclarationDependenciesCollector, this increases compilation time + for (const file of this.library.files) { + for (const feature of [...file.serializeImportFeatures, ...file.importFeatures]) { imports.addFeature(feature.feature, feature.module) + } + } imports.print(this.writer, 'arkts/type_check') } protected abstract writeInterfaceChecker(name: string, descriptor: StructDescriptor, type?: idl.IDLType): void @@ -115,23 +121,17 @@ abstract class TypeCheckerPrinter { const importFeatures: ImportFeature[] = [] const interfaces: { name: string, type?: idl.IDLType, descriptor: StructDescriptor }[] = [] const seenNames = new Set() - const declDependenciesCollector = createDependenciesCollector(this.library) const declNameConvertor = createDeclarationNameConvertor(this.library.language) for (const file of this.library.files) { - const declarations: idl.IDLEntry[] = [...Array.from(file.declarations), ...file.enums] - // Collects materialized and builder classes - for (const decl of file.entries) { - if ((idl.isClass(decl) || idl.isInterface(decl)) && (isMaterialized(decl) || isBuilderClass(decl))) { - declarations.push(decl, - ...declDependenciesCollector.convert(decl) - .filter((it): it is idl.IDLEntry => idl.isEntry(it)) - .map(it => it) - ) - } - } - for (const decl of declarations - .filter(it => !PeerGeneratorConfig.ignoreEntry(it.name, this.writer.language))) { + const builders = file.entries.filter(it => idl.isClass(it) && isBuilderClass(it)) + const declarations = [ + ...Array.from(file.declarations), + ...file.enums, + ...builders, + ...this.library.conflictedDeclarations + ].filter(it => !PeerGeneratorConfig.ignoreEntry(it.name, this.writer.language)) + for (const decl of declarations) { if ((idl.isInterface(decl) || idl.isAnonymousInterface(decl) || idl.isEnum(decl) || idl.isClass(decl)) && !seenNames.has(decl.name)) { seenNames.add(decl.name) @@ -193,7 +193,7 @@ class ARKTSTypeCheckerPrinter extends TypeCheckerPrinter { this.writer.writeMethodImplementation(new Method( checkerName, new NamedMethodSignature(IDLBooleanType, - [toIDLType('object|string|number|undefined|null'), ...argsNames.map(_ => IDLBooleanType)], + [toIDLType('object|string|number|undefined|null'), ...argsNames.map(_ => IDLBooleanType)], ['value', ...argsNames]), [MethodModifier.STATIC], ), writer => { @@ -222,14 +222,11 @@ class TSTypeCheckerPrinter extends TypeCheckerPrinter { protected writeInterfaceChecker(name: string, descriptor: StructDescriptor, type: idl.IDLType): void { const typeName = this.library.mapType(type) - if (descriptor.getFields().length === 0) { - return - } const argsNames = descriptor.getFields().map(it => `duplicated_${it.name}`) this.writer.writeMethodImplementation(new Method( generateTypeCheckerName(name), new NamedMethodSignature(IDLBooleanType, - [toIDLType('object|string|number|undefined|null'), ...argsNames.map(_ => IDLBooleanType)], + [toIDLType('object|string|number|undefined|null|boolean'), ...argsNames.map(_ => IDLBooleanType)], ['value', ...argsNames]), [MethodModifier.STATIC], ), writer => { @@ -238,16 +235,21 @@ class TSTypeCheckerPrinter extends TypeCheckerPrinter { const bWeight = b.optional ? 1 : 0 return aWeight - bWeight }) - const statement = writer.makeMultiBranchCondition(orderedFields.map(it => { - return { - expr: writer.makeNaryOp("&&", [ - writer.makeString(`!duplicated_${it.name}`), - writer.makeString(`value?.hasOwnProperty("${it.name}")`) - ]), - stmt: writer.makeReturn(writer.makeString('true')) - } - }), writer.makeThrowError(`Can not discriminate value typeof ${typeName}`)) - writer.writeStatement(statement) + + const throwErrorStatement = writer.makeThrowError(`Can not discriminate value typeof ${typeName}`) + let checkStatement = throwErrorStatement + if (orderedFields.length > 0) { + checkStatement = writer.makeMultiBranchCondition(orderedFields.map(it => { + return { + expr: writer.makeNaryOp("&&", [ + writer.makeString(`!duplicated_${it.name}`), + writer.makeString(`value?.hasOwnProperty("${it.name}")`) + ]), + stmt: writer.makeReturn(writer.makeString('true')) + } + }), throwErrorStatement) + } + writer.writeStatement(checkStatement) }) } diff --git a/tests/arkts-sdk/ets/ability_component.d.ts b/tests/arkts-sdk/ets/ability_component.d.ts new file mode 100644 index 00000000..f4c10c74 --- /dev/null +++ b/tests/arkts-sdk/ets/ability_component.d.ts @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provide an interface for the ability component. + * + * @interface AbilityComponentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + * @deprecated since 10 + * @useinstead UIExtensionComponentInterface + */ +interface AbilityComponentInterface { + /** + * Construct the ability component. + * Called when the ability component is used. + * + * @param { object } value + * @returns { AbilityComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + * @deprecated since 10 + * @useinstead UIExtensionComponentInterface + */ + (value: { want: import('../api/@ohos.app.ability.Want').default }): AbilityComponentAttribute; +} + +/** + * Define the attribute functions of ability component. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + * @deprecated since 10 + * @useinstead UIExtensionComponentAttribute + */ +declare class AbilityComponentAttribute extends CommonMethod { + /** + * Called when the component is connected to ability. + * + * @param { function } callback - A callback instance used when connected. + * @returns { AbilityComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + * @deprecated since 10 + * @useinstead UIExtensionComponent#onRemoteReady + */ + onConnect(callback: () => void): AbilityComponentAttribute; + /** + * Called when the component is disconnected. + * + * @param { function } callback - A callback instance used when disconnected. + * @returns { AbilityComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + * @deprecated since 10 + * @useinstead UIExtensionComponent#onRelease + */ + onDisconnect(callback: () => void): AbilityComponentAttribute; +} + +/** + * Defines AbilityComponent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @deprecated since 10 + * @useinstead UIExtensionComponent + */ +declare const AbilityComponent: AbilityComponentInterface; + +/** + * Defines AbilityComponent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @deprecated since 10 + * @useinstead UIExtensionComponentInstance + */ +declare const AbilityComponentInstance: AbilityComponentAttribute; diff --git a/tests/arkts-sdk/ets/action_sheet.d.ts b/tests/arkts-sdk/ets/action_sheet.d.ts new file mode 100644 index 00000000..d47c295e --- /dev/null +++ b/tests/arkts-sdk/ets/action_sheet.d.ts @@ -0,0 +1,878 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * The information of sheet. + * + * @interface SheetInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The information of sheet. + * + * @interface SheetInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The information of sheet. + * + * @interface SheetInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface SheetInfo { + /** + * Title Properties + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Title Properties + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Title Properties + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + title: string | Resource; + + /** + * Icon Properties. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Icon Properties. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Icon Properties. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + icon?: string | Resource; + + /** + * Callback method after the operation. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Callback method after the operation. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback method after the operation. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Callback method after the operation. + * + * @type { VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + action: VoidCallback; +} + +/** + * Component dialog dismiss action. + * + * @interface DismissDialogAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DismissDialogAction { + /** + * Defines dialog dismiss function. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: Callback; + + /** + * Dismiss reason type. + * + * @type { DismissReason } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reason: DismissReason; +} + +/** + * Base button params used for ActionSheet. + * + * @interface ActionSheetButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +interface ActionSheetButtonOptions { + /** + * Enable switch of confirmation button + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Enable switch of confirmation button + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enabled?: boolean; + + /** + * Default focus switch of confirmation button + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default focus switch of confirmation button + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + defaultFocus?: boolean; + + /** + * Style of confirmation button. + * @type { ?DialogButtonStyle } + * @default DialogButtonStyle.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Style of confirmation button. + * @type { ?DialogButtonStyle } + * @default DialogButtonStyle.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style?: DialogButtonStyle; + + /** + * Text content of the confirmation button. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text content of the confirmation button. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text content of the confirmation button. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string | Resource; + + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Method executed by the callback. + * + * @type { VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + action: VoidCallback; +} + +/** + * ActionSheet offset. + * + * @interface ActionSheetOffset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +interface ActionSheetOffset { + /** + * Dx of the pop-up window relative to the alignment position. + * + * @type { number | string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + dx: number | string | Resource; + /** + * Dy of the pop-up window relative to the alignment position. + * + * @type { number | string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + dy: number | string | Resource; +} + +/** + * The options of ActionSheet. + * + * @interface ActionSheetOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The options of ActionSheet. + * + * @interface ActionSheetOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The options of ActionSheet. + * + * @interface ActionSheetOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface ActionSheetOptions +{ + /** + * Title Properties + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Title Properties + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Title Properties + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + title: string | Resource; + + /** + * Subtitle Properties + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Subtitle Properties + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + subtitle?: ResourceStr; + + /** + * message Properties + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * message Properties + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * message Properties + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + message: string | Resource; + + /** + * Invoke the commit function. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Invoke the commit function. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoke the commit function. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Invoke the commit function. + * + * @type { ?ActionSheetButtonOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + confirm?: ActionSheetButtonOptions; + + /** + * Execute Cancel Function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Execute Cancel Function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Execute Cancel Function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Execute Cancel Function. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + cancel?: VoidCallback; + + /** + * The Array of sheets + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The Array of sheets + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Array of sheets + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + sheets: Array; + + /** + * Allows users to click the mask layer to exit. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Allows users to click the mask layer to exit. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Allows users to click the mask layer to exit. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + autoCancel?: boolean; + + /** + * Alignment in the vertical direction. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Alignment in the vertical direction. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Alignment in the vertical direction. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + alignment?: DialogAlignment; + + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?ActionSheetOffset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + offset?: ActionSheetOffset; + + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maskRect?: Rectangle; + + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showInSubWindow?: boolean; + + /** + * Whether it is a modal dialog + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether it is a modal dialog + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isModal?: boolean; + + /** + * Defines the actionSheet's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the actionSheet's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Defines the actionSheet's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the actionSheet's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Callback function when the actionSheet interactive dismiss + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: Callback; + + /** + * Transition parameters of opening/closing ActionSheet. + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Defines the actionSheet's corner radius. + * + * @type { ?(Dimension | BorderRadiuses | LocalizedBorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cornerRadius?: Dimension | BorderRadiuses | LocalizedBorderRadiuses; + + /** + * Defines the actionSheet's width. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width?: Dimension; + + /** + * Defines the actionSheet's height. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + height?: Dimension; + + /** + * Defines the actionSheet's border width. + * + * @type { ?(Dimension | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderWidth?: Dimension | EdgeWidths | LocalizedEdgeWidths; + + /** + * Defines the actionSheet's border color. + * + * @type { ?(ResourceColor | EdgeColors | LocalizedEdgeColors) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderColor?: ResourceColor | EdgeColors | LocalizedEdgeColors; + + /** + * Defines the actionSheet's border style. + * + * @type { ?(BorderStyle | EdgeStyles) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderStyle?: BorderStyle | EdgeStyles; + + /** + * Defines the actionSheet's shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the actionSheet's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; +} + +/** + * Declare the ActionSheet + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Declare the ActionSheet + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the ActionSheet + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class ActionSheet { + /** + * Invoking method display. + * + * @param { ActionSheetOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Invoking method display. + * + * @param { ActionSheetOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoking method display. + * + * @param { ActionSheetOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + static show(value: ActionSheetOptions); +} diff --git a/tests/arkts-sdk/ets/alert_dialog.d.ts b/tests/arkts-sdk/ets/alert_dialog.d.ts new file mode 100644 index 00000000..e53813bc --- /dev/null +++ b/tests/arkts-sdk/ets/alert_dialog.d.ts @@ -0,0 +1,1329 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * The alignment of dialog, + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The alignment of dialog, + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The alignment of dialog, + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum DialogAlignment { + /** + * Vertical top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Vertical top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Top, + + /** + * Align vertically to the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Align vertically to the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align vertically to the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Center, + + /** + * Vertical bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Vertical bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * Default alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Default alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Default, + + /** + * Align the upper left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Align the upper left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the upper left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TopStart, + + /** + * Align the upper right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Align the upper right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the upper right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TopEnd, + + /** + * Left center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Left center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Left center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CenterStart, + + /** + * Right center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Right center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Right center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CenterEnd, + + /** + * Align the lower left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Align the lower left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the lower left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BottomStart, + + /** + * Align the lower right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Align the lower right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the lower right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BottomEnd, +} + +/** +* The arrangement of buttons in dialog. +* +* @enum { number } +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @since 10 +*/ +/** +* The arrangement of buttons in dialog. +* +* @enum { number } +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 11 +*/ +declare enum DialogButtonDirection { + /** + * Two or fewer buttons are arranged horizontally, + * and two or more buttons are arranged vertically. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Two or fewer buttons are arranged horizontally, + * and two or more buttons are arranged vertically. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + AUTO = 0, + + /** + * Buttons are arranged horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Buttons are arranged horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + HORIZONTAL = 1, + + /** + * Buttons are arranged vertically. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Buttons are arranged vertically. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + VERTICAL = 2, +} + +/** + * Base button param. + * + * @interface AlertDialogButtonBaseOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare interface AlertDialogButtonBaseOptions { + /** + * Enable switch of button. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Enable switch of button. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enabled?: boolean; + + /** + * Default focus switch of button. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default focus switch of button. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + defaultFocus?: boolean; + + /** + * Style of button. + * + * @type { ?DialogButtonStyle } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Style of button. + * + * @type { ?DialogButtonStyle } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style?: DialogButtonStyle; + + /** + * Text content of button. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text content of button. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: ResourceStr; + + /** + * Text color of button. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text color of button. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor?: ResourceColor; + + /** + * Background color of button. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Background color of button. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundColor?: ResourceColor; + + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Method executed by the callback. + * + * @type { VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + action: VoidCallback; +} + +/** + * Base button param used for AlertDialogParamWithOptions. + * + * @interface AlertDialogButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Base button param used for AlertDialogParamWithOptions. + * + * @interface AlertDialogButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Button param used for AlertDialogParamWithOptions. + * + * @interface AlertDialogButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare interface AlertDialogButtonOptions extends AlertDialogButtonBaseOptions { + /** + * Define whether the button responds to Enter/Space key by default. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + primary?: boolean; +} + +/** + * Defines TextStyle in the AlertDialog. + * + * @interface TextStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextStyle { + /** + * Set the word break type. + * + * @type { ?WordBreak } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + wordBreak?: WordBreak; +} + +/** + * Base param used for AlertDialog.show method. + * + * @interface AlertDialogParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Base param used for AlertDialog.show method. + * + * @interface AlertDialogParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Base param used for AlertDialog.show method. + * + * @interface AlertDialogParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface AlertDialogParam { + /** + * Title Properties + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Title Properties + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Title Properties + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + title?: ResourceStr; + + /** + * Subtitle Properties + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Subtitle Properties + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + subtitle?: ResourceStr; + + /** + * message Properties + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * message Properties + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * message Properties + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + message: ResourceStr; + + /** + * Allows users to click the mask layer to exit. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Allows users to click the mask layer to exit. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Allows users to click the mask layer to exit. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + autoCancel?: boolean; + + /** + * Execute Cancel Function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Execute Cancel Function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Execute Cancel Function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Execute Cancel Function. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + cancel?: VoidCallback; + + /** + * Alignment in the vertical direction. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Alignment in the vertical direction. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Alignment in the vertical direction. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + alignment?: DialogAlignment; + + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Offset; + + /** + * Grid count of dialog. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Grid count of dialog. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Grid count of dialog. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + gridCount?: number; + + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maskRect?: Rectangle; + + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showInSubWindow?: boolean; + + /** + * Whether it is a modal dialog + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether it is a modal dialog + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isModal?: boolean; + + /** + * Defines the alertDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the alertDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Defines the alertDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the alertDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Callback function when the dialog interactive dismiss + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: Callback; + + /** + * Transition parameters of opening/closing AlertDialog. + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Defines the alertDialog's corner radius. + * + * @type { ?(Dimension | BorderRadiuses | LocalizedBorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cornerRadius?: Dimension | BorderRadiuses | LocalizedBorderRadiuses; + + /** + * Defines the alertDialog's width. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width?: Dimension; + + /** + * Defines the alertDialog's height. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + height?: Dimension; + + /** + * Defines the alertDialog's border width. + * + * @type { ?(Dimension | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderWidth?: Dimension | EdgeWidths | LocalizedEdgeWidths; + + /** + * Defines the alertDialog's border color. + * + * @type { ?(ResourceColor | EdgeColors | LocalizedEdgeColors) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderColor?: ResourceColor | EdgeColors | LocalizedEdgeColors; + + /** + * Defines the alertDialog's border style. + * + * @type { ?(BorderStyle | EdgeStyles) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderStyle?: BorderStyle | EdgeStyles; + + /** + * Defines the alertDialog's shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Set the alertDialog's textStyle. + * + * @type { ?TextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textStyle?: TextStyle; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the alertDialog's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; +} + +/** + * Defines the AlertDialog with confirm button. + * + * @interface AlertDialogParamWithConfirm + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the AlertDialog with confirm button. + * + * @interface AlertDialogParamWithConfirm + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the AlertDialog with confirm button. + * + * @interface AlertDialogParamWithConfirm + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface AlertDialogParamWithConfirm extends AlertDialogParam { + /** + * Invoke the commit function. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Invoke the commit function. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoke the commit function. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Invoke the commit function. + * + * @type { ?AlertDialogButtonBaseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + confirm?: AlertDialogButtonBaseOptions; +} + +/** + * Component dialog dismiss action. + * + * @interface DismissDialogAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DismissDialogAction { + /** + * Defines dialog dismiss function. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: Callback; + + /** + * Dismiss reason type. + * + * @type { DismissReason } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reason: DismissReason; +} + +/** + * Defines the dialog param with buttons. + * + * @interface AlertDialogParamWithButtons + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the dialog param with buttons. + * + * @interface AlertDialogParamWithButtons + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the dialog param with buttons. + * + * @interface AlertDialogParamWithButtons + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface AlertDialogParamWithButtons extends AlertDialogParam { + /** + * First button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * First button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * First button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * First button. + * + * @type { AlertDialogButtonBaseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + primaryButton: AlertDialogButtonBaseOptions; + + /** + * Second button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Second button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Second button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Second button. + * + * @type { AlertDialogButtonBaseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + secondaryButton: AlertDialogButtonBaseOptions; +} + +/** + * Defines the dialog param with options. + * + * @interface AlertDialogParamWithOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the dialog param with options. + * + * @interface AlertDialogParamWithOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface AlertDialogParamWithOptions extends AlertDialogParam { + /** + * The array of buttons. + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The array of buttons. + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + buttons: Array; + + /** + * The arrangement of buttons. + * @type { ?DialogButtonDirection } + * @default DialogButtonDirection.AUTO + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The arrangement of buttons. + * @type { ?DialogButtonDirection } + * @default DialogButtonDirection.AUTO + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + buttonDirection?: DialogButtonDirection; +} + +/** + * Defines AlertDialog which uses show method to show alert dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines AlertDialog which uses show method to show alert dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines AlertDialog which uses show method to show alert dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class AlertDialog { + /** + * Invoking method display. + * + * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Invoking method display. + * + * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions} value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoking method display. + * + * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions} value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + static show(value: AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions); +} + diff --git a/tests/arkts-sdk/ets/alphabet_indexer.d.ts b/tests/arkts-sdk/ets/alphabet_indexer.d.ts new file mode 100644 index 00000000..a3db96ff --- /dev/null +++ b/tests/arkts-sdk/ets/alphabet_indexer.d.ts @@ -0,0 +1,1036 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * indexer align property. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * indexer align property. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * indexer align property. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum IndexerAlign { + /** + * A dialog box is displayed on the right of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * A dialog box is displayed on the right of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * A dialog box is displayed on the right of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Left, + + /** + * A dialog box is displayed on the left of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * A dialog box is displayed on the left of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * A dialog box is displayed on the left of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Right, + + /** + * A dialog box is displayed on the start of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + START, + + /** + * A dialog box is displayed on the end of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + END, +} + +/** + * AlphabetIndexer constructor options. + * + * @interface AlphabetIndexerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface AlphabetIndexerOptions { + /** + * Alphabetical index string array. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Alphabetical index string array. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Alphabetical index string array. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrayValue: Array; + /** + * ID of the selected item. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * ID of the selected item. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * ID of the selected item. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selected: number; +} + +/** + * Alphabet index bar. + * + * @interface AlphabetIndexerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Alphabet index bar. + * + * @interface AlphabetIndexerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Alphabet index bar. + * + * @interface AlphabetIndexerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface AlphabetIndexerInterface { + /** + * ArrayValue: Alphabetical index string array. + * selected: ID of the selected item. + * + * @param { object } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * ArrayValue: Alphabetical index string array. + * selected: ID of the selected item. + * + * @param { object } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * ArrayValue: Alphabetical index string array. + * selected: ID of the selected item. + * + * @param { object } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Construct the alphabet indexer component. + * Called when the alphabet indexer component is used. + * + * @param { AlphabetIndexerOptions } options - alphabet indexer options + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + (options: AlphabetIndexerOptions): AlphabetIndexerAttribute; +} + +/** + * Defines an AlphabetIndexer callback when onSelect. + * + * @typedef { function } OnAlphabetIndexerSelectCallback + * @param { number } index - selected index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnAlphabetIndexerSelectCallback = (index: number) => void; + +/** + * Defines an AlphabetIndexer callback when onPopupSelect. + * + * @typedef { function } OnAlphabetIndexerPopupSelectCallback + * @param { number } index - selected index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnAlphabetIndexerPopupSelectCallback = (index: number) => void; + +/** + * Defines an AlphabetIndexer callback when onRequestPopupData. + * + * @typedef { function } OnAlphabetIndexerRequestPopupDataCallback + * @param { number } index - selected index + * @returns { Array } string array corresponding to the index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnAlphabetIndexerRequestPopupDataCallback = (index: number) => Array; + +/** + * Defines the alphabet index bar attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the alphabet index bar attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the alphabet index bar attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class AlphabetIndexerAttribute extends CommonMethod { + /** + * Index bar selection callback. + * + * @param { function } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 8 + * @useinstead onSelect + */ + onSelected(callback: (index: number) => void): AlphabetIndexerAttribute; + + /** + * Definitions color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Definitions color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Definitions color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color(value: ResourceColor): AlphabetIndexerAttribute; + + /** + * Select the text color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Select the text color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Select the text color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedColor(value: ResourceColor): AlphabetIndexerAttribute; + + /** + * Font color of the pop-up prompt text. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Font color of the pop-up prompt text. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Font color of the pop-up prompt text. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popupColor(value: ResourceColor): AlphabetIndexerAttribute; + + /** + * Select the text background color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Select the text background color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Select the text background color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedBackgroundColor(value: ResourceColor): AlphabetIndexerAttribute; + + /** + * Background color of the pop-up window index. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background color of the pop-up window index. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Background color of the pop-up window index. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popupBackground(value: ResourceColor): AlphabetIndexerAttribute; + + /** + * Set the selected font color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of the selected font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set the selected font color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of the selected font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the selected font color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of the selected font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popupSelectedColor(value: ResourceColor): AlphabetIndexerAttribute; + + /** + * Set the unselected font color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of the unselected font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the unselected font color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of the unselected font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popupUnselectedColor(value: ResourceColor): AlphabetIndexerAttribute; + + /** + * Set the background color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of background. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the background color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of background. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popupItemBackgroundColor(value: ResourceColor): AlphabetIndexerAttribute; + + /** + * Whether to use pop-up index hints. + * + * @param { boolean } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Whether to use pop-up index hints. + * + * @param { boolean } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Whether to use pop-up index hints. + * + * @param { boolean } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + usingPopup(value: boolean): AlphabetIndexerAttribute; + + /** + * Select the text text style, + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Select the text text style, + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Select the text text style, + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedFont(value: Font): AlphabetIndexerAttribute; + + /** + * Select the text background color. + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Select the text background color. + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Select the text background color. + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popupFont(value: Font): AlphabetIndexerAttribute; + + /** + * Set the font style of non-alphabetic part of the prompt pop-up window. + * Family and style are not supported currently and will be fixed in future. + * + * @param { Font } value - indicates the style of the font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the font style of non-alphabetic part of the prompt pop-up window. + * Family and style are not supported currently and will be fixed in future. + * + * @param { Font } value - indicates the style of the font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popupItemFont(value: Font): AlphabetIndexerAttribute; + + /** + * Size of the letter area on the letter index bar. The letter area is a square. Set the length of the square side. + * + * @param { string | number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Size of the letter area on the letter index bar. The letter area is a square. Set the length of the square side. + * + * @param { string | number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Size of the letter area on the letter index bar. The letter area is a square. Set the length of the square side. + * + * @param { string | number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + itemSize(value: string | number): AlphabetIndexerAttribute; + + /** + * Definitions fonts. + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Definitions fonts. + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Definitions fonts. + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font(value: Font): AlphabetIndexerAttribute; + + /** + * Alphabet index bar alignment style. The left and right alignment styles are supported, + * which affects the pop-up position of the pop-up window. + * + * @param { IndexerAlign } value - indicates the alignment style of Alphabet index. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Alphabet index bar alignment style. The left and right alignment styles are supported, + * which affects the pop-up position of the pop-up window. + * + * @param { IndexerAlign } value - indicates the alignment style of Alphabet index. + * @param { Length } [offset] - indicates the horizontal space between pop-up window and indexer bar. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Alphabet index bar alignment style. The left and right alignment styles are supported, + * which affects the pop-up position of the pop-up window. + * + * @param { IndexerAlign } value - indicates the alignment style of Alphabet index. + * @param { Length } [offset] - indicates the horizontal space between pop-up window and indexer bar. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + alignStyle(value: IndexerAlign, offset?: Length): AlphabetIndexerAttribute; + + /** + * Index bar selection callback. + * + * @param { function } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Index bar selection callback. + * + * @param { function } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Index bar selection callback. + * + * @param { function } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Index bar selection callback. + * + * @param { OnAlphabetIndexerSelectCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSelect(callback: OnAlphabetIndexerSelectCallback): AlphabetIndexerAttribute; + + /** + * Index bar selection callback and return the strings which display on pop-up. + * + * @param { function } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Index bar selection callback and return the strings which display on pop-up. + * + * @param { function } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Index bar selection callback and return the strings which display on pop-up. + * + * @param { function } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Index bar selection callback and return the strings which display on pop-up. + * + * @param { OnAlphabetIndexerRequestPopupDataCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onRequestPopupData(callback: OnAlphabetIndexerRequestPopupDataCallback): AlphabetIndexerAttribute; + + /** + * Pop-up selection callback. + * + * @param { function } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Pop-up selection callback. + * + * @param { function } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pop-up selection callback. + * + * @param { function } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Pop-up selection callback. + * + * @param { OnAlphabetIndexerPopupSelectCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPopupSelect(callback: OnAlphabetIndexerPopupSelectCallback): AlphabetIndexerAttribute; + + /** + * Sets the selected index. + * + * @param { number } index + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the selected index. + * + * @param { number } index + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the selected index. + * + * @param { number } index + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selected(index: number): AlphabetIndexerAttribute; + + /** + * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. + * + * @param { Position } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. + * + * @param { Position } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. + * + * @param { Position } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popupPosition(value: Position): AlphabetIndexerAttribute; + + /** + * Automatically collapses the characters when the indexer bar not high enough to display all characters. + * + * @param { boolean } value - A boolean value determines whether auto collapses is enabled for indexer bar. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Automatically collapses the characters when the indexer bar not high enough to display all characters. + * + * @param { boolean } value - A boolean value determines whether auto collapses is enabled for indexer bar. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + autoCollapse(value: boolean): AlphabetIndexerAttribute; + + /** + * Set the radius of the item of the pop-up window. + * + * @param { number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + popupItemBorderRadius(value: number): AlphabetIndexerAttribute; + + /** + * Set the radius of the item of the indexer. + * + * @param { number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + itemBorderRadius(value: number): AlphabetIndexerAttribute; + + /** + * Set the background blurStyle of title of the pop-up window. + * + * @param { BlurStyle } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + popupBackgroundBlurStyle(value: BlurStyle): AlphabetIndexerAttribute; + + /** + * Set the background color of title of the pop-up window. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + popupTitleBackground(value: ResourceColor): AlphabetIndexerAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } value - Default value is true, set false to disable haptic feedback. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableHapticFeedback(value: boolean): AlphabetIndexerAttribute; +} + +/** + * Defines AlphabetIndexer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines AlphabetIndexer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines AlphabetIndexer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const AlphabetIndexer: AlphabetIndexerInterface; + +/** + * Defines AlphabetIndexer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines AlphabetIndexer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines AlphabetIndexer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const AlphabetIndexerInstance: AlphabetIndexerAttribute; diff --git a/tests/arkts-sdk/ets/animator.d.ts b/tests/arkts-sdk/ets/animator.d.ts new file mode 100644 index 00000000..0772ad84 --- /dev/null +++ b/tests/arkts-sdk/ets/animator.d.ts @@ -0,0 +1,309 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Customize spring properties. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare class SpringProp { + /** + * Constructor parameters + * + * @param { number } mass + * @param { number } stiffness + * @param { number } damping + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare class SpringMotion { + /** + * Constructor parameters + * + * @param { number } start + * @param { number } end + * @param { number } velocity + * @param { SpringProp } prop + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare class FrictionMotion { + /** + * Constructor parameters + * + * @param { number } friction + * @param { number } position + * @param { number } velocity + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare class ScrollMotion { + /** + * Constructor parameters + * + * @param { number } position + * @param { number } velocity + * @param { number } min + * @param { number } max + * @param { SpringProp } prop + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + constructor(position: number, velocity: number, min: number, max: number, prop: SpringProp); +} + +/** + * Defines Animator. + * + * @interface AnimatorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +interface AnimatorInterface { + /** + * Constructor parameters + * + * @param { string } value + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + (value: string): AnimatorAttribute; +} + +/** + * Defines AnimatorAttribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare class AnimatorAttribute extends CommonMethod { + /** + * Controls the playback status. The default value is the initial state. + * + * @param { AnimationStatus } value + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + state(value: AnimationStatus): AnimatorAttribute; + + /** + * Animation duration, in milliseconds. + * + * @param { number } value + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + duration(value: number): AnimatorAttribute; + + /** + * Animation curve, default to linear curve + * + * @param { Curve } value + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + curve(value: Curve): AnimatorAttribute; + + /** + * Delayed animation playback duration, in milliseconds. By default, the animation is not delayed. + * + * @param { number } value + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + delay(value: number): AnimatorAttribute; + + /** + * Sets the state before and after the animation starts. + * + * @param { FillMode } value + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + fillMode(value: FillMode): AnimatorAttribute; + + /** + * The default playback is once. If the value is -1, the playback is unlimited. + * + * @param { number } value + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + iterations(value: number): AnimatorAttribute; + + /** + * Sets the animation playback mode. By default, the animation starts to play again after the playback is complete. + * + * @param { PlayMode } value + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + playMode(value: PlayMode): AnimatorAttribute; + + /** + * Configure the physical animation algorithm. + * + * @param { SpringMotion | FrictionMotion | ScrollMotion } value + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + motion(value: SpringMotion | FrictionMotion | ScrollMotion): AnimatorAttribute; + + /** + * Status callback, which is triggered when the animation starts to play. + * + * @param { function } event + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + onStart(event: () => void): AnimatorAttribute; + + /** + * Status callback, triggered when the animation pauses. + * + * @param { function } event + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + onPause(event: () => void): AnimatorAttribute; + + /** + * Status callback, triggered when the animation is replayed. + * + * @param { function } event + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + onRepeat(event: () => void): AnimatorAttribute; + + /** + * Status callback, which is triggered when the animation is canceled. + * + * @param { function } event + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + onCancel(event: () => void): AnimatorAttribute; + + /** + * Status callback, which is triggered when the animation playback is complete. + * + * @param { function } event + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + onFinish(event: () => void): AnimatorAttribute; + + /** + * The callback input parameter is the interpolation during animation playback. + * + * @param { function } event + * @returns { AnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + onFrame(event: (value: number) => void): AnimatorAttribute; +} + +/** + * Defines Animator Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare const Animator: AnimatorInterface; + +/** + * Defines Animator Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +declare const AnimatorInstance: AnimatorAttribute; diff --git a/tests/arkts-sdk/ets/badge.d.ts b/tests/arkts-sdk/ets/badge.d.ts new file mode 100644 index 00000000..d6515394 --- /dev/null +++ b/tests/arkts-sdk/ets/badge.d.ts @@ -0,0 +1,916 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the badge position property. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the badge position property. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the badge position property. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the badge position property. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum BadgePosition { + /** + * The dot is displayed vertically centered on the right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The dot is displayed vertically centered on the right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The dot is displayed vertically centered on the right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The dot is displayed vertically centered on the right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + RightTop, + + /** + * Dots are displayed in the upper right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Dots are displayed in the upper right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Dots are displayed in the upper right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Dots are displayed in the upper right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Right, + + /** + * The dot is displayed in the left vertical center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The dot is displayed in the left vertical center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The dot is displayed in the left vertical center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The dot is displayed in the left vertical center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Left, +} + +/** + * BadgeStyle object + * + * @interface BadgeStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * BadgeStyle object + * + * @interface BadgeStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * BadgeStyle object + * + * @interface BadgeStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * BadgeStyle object + * + * @interface BadgeStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface BadgeStyle { + /** + * Text Color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text Color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text Color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text Color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + + /** + * Text size. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text size. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text size. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text size. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontSize?: number | string; + + /** + * Size of a badge. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Size of a badge. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Size of a badge. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Size of a badge. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + badgeSize?: number | string; + + /** + * Color of the badge. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Color of the badge. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Color of the badge. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Color of the badge. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + badgeColor?: ResourceColor; + + /** + * Define the border color of the badge. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the border color of the badge. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + borderColor?: ResourceColor; + + /** + * Define the border width of the badge. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the border width of the badge. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + borderWidth?: Length; + + /** + * Define the font weight of the badge. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the font weight of the badge. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontWeight?: number | FontWeight | string; +} + +/** + * Defines the base param of badge. + * + * @interface BadgeParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the base param of badge. + * + * @interface BadgeParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the base param of badge. + * + * @interface BadgeParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the base param of badge. + * + * @interface BadgeParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface BadgeParam { + /** + * Set the display position of the prompt point. + * + * @type { ?(BadgePosition) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the display position of the prompt point. + * + * @type { ?(BadgePosition) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the display position of the prompt point. + * + * @type { ?(BadgePosition | Position) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the display position of the prompt point. + * + * @type { ?(BadgePosition | Position) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + position?: BadgePosition | Position; + + /** + * Defines the style of the Badge component, including the text color, size, dot color, and size. + * + * @type { BadgeStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the style of the Badge component, including the text color, size, dot color, and size. + * + * @type { BadgeStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the style of the Badge component, including the text color, size, dot color, and size. + * + * @type { BadgeStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the style of the Badge component, including the text color, size, dot color, and size. + * + * @type { BadgeStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + style: BadgeStyle; +} + +/** + * Defines the badge param with count and maxCount. + * + * @interface BadgeParamWithNumber + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the badge param with count and maxCount. + * + * @interface BadgeParamWithNumber + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the badge param with count and maxCount. + * + * @interface BadgeParamWithNumber + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the badge param with count and maxCount. + * + * @interface BadgeParamWithNumber + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface BadgeParamWithNumber extends BadgeParam { + /** + * Set the number of reminder messages. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the number of reminder messages. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the number of reminder messages. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the number of reminder messages. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + count: number; + + /** + * Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + maxCount?: number; +} + +/** + * Defines the badge param with string value. + * + * @interface BadgeParamWithString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the badge param with string value. + * + * @interface BadgeParamWithString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the badge param with string value. + * + * @interface BadgeParamWithString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the badge param with string value. + * + * @interface BadgeParamWithString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface BadgeParamWithString extends BadgeParam { + /** + * Text string of the prompt content. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text string of the prompt content. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text string of the prompt content. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text string of the prompt content. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + value: string; +} + +/** + * Defines Badge Component. + * + * @interface BadgeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Badge Component. + * + * @interface BadgeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Badge Component. + * + * @interface BadgeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Badge Component. + * + * @interface BadgeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface BadgeInterface { + /** + * 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. + * + * @param { BadgeParamWithNumber } value + * @returns { BadgeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @param { BadgeParamWithNumber } value + * @returns { BadgeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * 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. + * + * @param { BadgeParamWithNumber } value + * @returns { BadgeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * 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. + * + * @param { BadgeParamWithNumber } value + * @returns { BadgeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (value: BadgeParamWithNumber): BadgeAttribute; + + /** + * 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. + * + * @param { BadgeParamWithString } value + * @returns { BadgeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @param { BadgeParamWithString } value + * @returns { BadgeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * 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. + * + * @param { BadgeParamWithString } value + * @returns { BadgeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * 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. + * + * @param { BadgeParamWithString } value + * @returns { BadgeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (value: BadgeParamWithString): BadgeAttribute; +} + +/** + * Defines Badge Component attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Badge Component attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Badge Component attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Badge Component attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class BadgeAttribute extends CommonMethod {} + +/** + * Defines Badge Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Badge Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Badge Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Badge Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Badge: BadgeInterface; + +/** + * Defines Badge Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Badge Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Badge Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Badge Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const BadgeInstance: BadgeAttribute; diff --git a/tests/arkts-sdk/ets/blank.d.ts b/tests/arkts-sdk/ets/blank.d.ts new file mode 100644 index 00000000..9f718272 --- /dev/null +++ b/tests/arkts-sdk/ets/blank.d.ts @@ -0,0 +1,235 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Create Blank. + * + * @interface BlankInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Create Blank. + * + * @interface BlankInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Create Blank. + * + * @interface BlankInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Create Blank. + * + * @interface BlankInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface BlankInterface { + /** + * The minimum size of the blank fill assembly on the container spindle. + * + * @param { number | string } min + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The minimum size of the blank fill assembly on the container spindle. + * + * @param { number | string } min + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The minimum size of the blank fill assembly on the container spindle. + * + * @param { number | string } min + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The minimum size of the blank fill assembly on the container spindle. + * + * @param { number | string } min + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (min?: number | string): BlankAttribute; +} + +/** + * Inheritance CommonMethod Set Styles + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Inheritance CommonMethod Set Styles + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Inheritance CommonMethod Set Styles + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Inheritance CommonMethod Set Styles + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class BlankAttribute extends CommonMethod { + /** + * color: set color. + * + * @param { ResourceColor } value + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * color: set color. + * + * @param { ResourceColor } value + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * color: set color. + * + * @param { ResourceColor } value + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * color: set color. + * + * @param { ResourceColor } value + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color(value: ResourceColor): BlankAttribute; +} + +/** + * Defines Blank Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Blank Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Blank Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Blank Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Blank: BlankInterface; + +/** + * Defines Blank Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Blank Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Blank Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Blank Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const BlankInstance: BlankAttribute; diff --git a/tests/arkts-sdk/ets/button.d.ts b/tests/arkts-sdk/ets/button.d.ts new file mode 100644 index 00000000..024103f1 --- /dev/null +++ b/tests/arkts-sdk/ets/button.d.ts @@ -0,0 +1,1319 @@ +/* + * Copyright (c) 2021-2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides a button component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides a button component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides a button component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides a button component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ButtonType { + /** + * Capsule button (rounded corners default to half the height). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Capsule button (rounded corners default to half the height). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Capsule button (rounded corners default to half the height). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Capsule button (rounded corners default to half the height). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Capsule, + + /** + * Round buttons. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Round buttons. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Round buttons. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Round buttons. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Circle, + + /** + * Common button (no rounded corners by default). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Common button (no rounded corners by default). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Common button (no rounded corners by default). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Common button (no rounded corners by default). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Normal, + + /** + * Rounded rectangle button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + ROUNDED_RECTANGLE = 3, +} + +/** + * Enum for button style type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Enum for button style type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum ButtonStyleMode { + /** + * Normal button (with normal background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Normal button (with normal background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NORMAL = 0, + + /** + * Emphasized button (with emphasized background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Emphasized button (with emphasized background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + EMPHASIZED = 1, + + /** + * Textual button (with none background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Textual button (with none background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + TEXTUAL = 2, +} + +/** + * Enum for button role. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum ButtonRole { + /** + * Normal button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NORMAL = 0, + + /** + * Error button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + ERROR = 1, +} + +/** + * Defines the callback type used in ButtonConfiguration. + * + * @typedef {function} ButtonTriggerClickCallback + * @param { number } xPos - The value of xPos is x coordinate. + * @param { number } yPos - The value of yPos is y coordinate. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ButtonTriggerClickCallback = (xPos: number, yPos: number) => void; + +/** + * ButtonConfiguration used by button content modifier. + * + * @interface ButtonConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + +declare interface ButtonConfiguration extends CommonConfiguration { + /** + * Button with inner text label. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + label: string; + + /** + * Indicates whether the button is pressed. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pressed: boolean; + + /** + * Trigger button click x coordinate and y coordinate. + * + * @type { ButtonTriggerClickCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + triggerClick: ButtonTriggerClickCallback; +} + +/** + * Enum for Control Size. + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Enum for Control Size. + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum ControlSize { + /** + * The component size is small. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * The component size is small. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SMALL = 'small', + + /** + * The component size is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * The component size is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NORMAL = 'normal', +} + +/** + * Defines the button options. + * + * @interface ButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the button options. + * + * @interface ButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the button options. + * + * @interface ButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the button options. + * + * @interface ButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ButtonOptions { + /** + * Describes the button style. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Describes the button style. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Describes the button style. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Describes the button style. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + 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. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stateEffect?: boolean; + + /** + * Describes the button style. + * + * @type { ?ButtonStyleMode } + * @default ButtonStyleMode.EMPHASIZED + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Describes the button style. + * + * @type { ?ButtonStyleMode } + * @default ButtonStyleMode.EMPHASIZED + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + buttonStyle?: ButtonStyleMode; + + /** + * Describes the button size. + * + * @type { ?ControlSize } + * @default ControlSize.NORMAL + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Describes the button size. + * + * @type { ?ControlSize } + * @default ControlSize.NORMAL + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + controlSize?: ControlSize; + + /** + * Describes the button role. + * + * @type { ?ButtonRole } + * @default ButtonRole.NORMAL + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + role?: ButtonRole; +} + +/** + * Defines the Button Component. + * + * @interface ButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Button Component. + * + * @interface ButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Button Component. + * + * @interface ButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Button Component. + * + * @interface ButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ButtonInterface { + /** + * Button object + * + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Button object + * + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Button object + * + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Button object + * + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (): ButtonAttribute; + + /** + * Create Button with Text child. + * + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Create Button with Text child. + * + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create Button with Text child. + * + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create Button with Text child. + * + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (options: ButtonOptions): ButtonAttribute; + + /** + * Create Button with inner text label. + * + * @param { ResourceStr } label + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Create Button with inner text label. + * + * @param { ResourceStr } label + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create Button with inner text label. + * + * @param { ResourceStr } label + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create Button with inner text label. + * + * @param { ResourceStr } label + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (label: ResourceStr, options?: ButtonOptions): ButtonAttribute; +} + +/** + * LabelStyle object. + * + * @interface LabelStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * LabelStyle object. + * + * @interface LabelStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface LabelStyle { + /** + * overflow mode. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * overflow mode. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + overflow?: TextOverflow; + + /** + * Label max lines. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Label max lines. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxLines?: number; + + /** + * Min font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Min font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + minFontSize?: number | ResourceStr; + + /** + * Max font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Max font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxFontSize?: number | ResourceStr; + + /** + * Adapt text height option. + * + * @type { ?TextHeightAdaptivePolicy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Adapt text height option. + * + * @type { ?TextHeightAdaptivePolicy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + heightAdaptivePolicy?: TextHeightAdaptivePolicy; + + /** + * Font style. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Font style. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font?: Font; +} + +/** + * Defines the button attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the button attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the button attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the button attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ButtonAttribute extends CommonMethod { + /** + * Describes the button style. + * + * @param { ButtonType } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Describes the button style. + * + * @param { ButtonType } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Describes the button style. + * + * @param { ButtonType } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Describes the button style. + * + * @param { ButtonType } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + type(value: ButtonType): ButtonAttribute; + + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @param { boolean } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @param { boolean } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @param { boolean } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @param { boolean } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stateEffect(value: boolean): ButtonAttribute; + + /** + * Describes the button style. + * + * @param { ButtonStyleMode } value - button style mode + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Describes the button style. + * + * @param { ButtonStyleMode } value - button style mode + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + buttonStyle(value: ButtonStyleMode): ButtonAttribute; + + /** + * Set the Button size. + * + * @param { ControlSize } value - control size + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Set the Button size. + * + * @param { ControlSize } value - control size + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + controlSize(value: ControlSize): ButtonAttribute; + + /** + * Set the Button role. + * + * @param { ButtonRole } value - button role + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + role(value: ButtonRole): ButtonAttribute; + + /** + * Text color. + * + * @param { ResourceColor } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text color. + * + * @param { ResourceColor } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text color. + * + * @param { ResourceColor } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text color. + * + * @param { ResourceColor } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): ButtonAttribute; + + /** + * Text size. + * + * @param { Length } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text size. + * + * @param { Length } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text size. + * + * @param { Length } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text size. + * + * @param { Length } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontSize(value: Length): ButtonAttribute; + + /** + * Font weight. + * + * @param { number | FontWeight | string } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Font weight. + * + * @param { number | FontWeight | string } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Font weight. + * + * @param { number | FontWeight | string } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Font weight. + * + * @param { number | FontWeight | string } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): ButtonAttribute; + + /** + * Font style. + * + * @param { FontStyle } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Font style. + * + * @param { FontStyle } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Font style. + * + * @param { FontStyle } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Font style. + * + * @param { FontStyle } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): ButtonAttribute; + + /** + * Font family. + * + * @param { string | Resource } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Font family. + * + * @param { string | Resource } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Font family. + * + * @param { string | Resource } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Font family. + * + * @param { string | Resource } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontFamily(value: string | Resource): ButtonAttribute; + + /** + * Set the content modifier of button. + * + * @param { ContentModifier } modifier - The content modifier of button. + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): ButtonAttribute; + + /** + * Set button label style. + * + * @param { LabelStyle } value - The label style configuration on button. + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set button label style. + * + * @param { LabelStyle } value - The label style configuration on button. + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + labelStyle(value: LabelStyle): ButtonAttribute; +} + +/** + * Defines Button Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Button Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Button Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Button Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Button: ButtonInterface; + +/** + * Defines Button Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Button Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Button Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Button Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ButtonInstance: ButtonAttribute; diff --git a/tests/arkts-sdk/ets/calendar.d.ts b/tests/arkts-sdk/ets/calendar.d.ts new file mode 100644 index 00000000..ecac6571 --- /dev/null +++ b/tests/arkts-sdk/ets/calendar.d.ts @@ -0,0 +1,1907 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @interface CalendarDay + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @interface CalendarDay + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +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. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * 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. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + index: number; + + /** + * Lunar moon. + * The week sequence is one, two, three, four, five, six. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Lunar moon. + * The week sequence is one, two, three, four, five, six. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + lunarMonth: string; + + /** + * Lunar day. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Lunar day. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + lunarDay: string; + + /** + * Day. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Day. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + dayMark: string; + + /** + * Indicates the off-duty flag information. The options are work and off.By default, the off-duty flag information is not required. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Indicates the off-duty flag information. The options are work and off.By default, the off-duty flag information is not required. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + dayMarkValue: string; + + /** + * Gregorian calendar year. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Gregorian calendar year. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + year: number; + + /** + * Gregorian calendar month. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Gregorian calendar month. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + month: number; + + /** + * Gregorian calendar day. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Gregorian calendar day. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + day: number; + + /** + * Indicates whether the default value is Lunar calendar. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Indicates whether the default value is Lunar calendar. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + isFirstOfLunar: boolean; + + /** + * Indicates whether to display has Schedule. + * The week sequence is one, two, three, four, five, six. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Indicates whether to display has Schedule. + * The week sequence is one, two, three, four, five, six. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + hasSchedule: boolean; + + /** + * Display Lunar Date.The week sequence is one, two, three, four, five, six. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Display Lunar Date.The week sequence is one, two, three, four, five, six. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + markLunarDay: boolean; +} + +/** + * Date object. + * + * @interface MonthData + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Date object. + * + * @interface MonthData + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +interface MonthData { + /** + * Gregorian calendar year. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Gregorian calendar year. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + year: number; + + /** + * Gregorian calendar month. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Gregorian calendar month. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + month: number; + + /** + * CalendarDay. + * + * @type { CalendarDay[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * CalendarDay. + * + * @type { CalendarDay[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + data: CalendarDay[]; +} + +/** + * CurrentDayStyle object. + * + * @interface CurrentDayStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * CurrentDayStyle object. + * + * @interface CurrentDayStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +interface CurrentDayStyle { + /** + * Text color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Text color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + dayColor?: ResourceColor; + + /** + * lunar Text color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * lunar Text color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + lunarColor?: ResourceColor; + + /** + * lunar Work and rest text color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * lunar Work and rest text color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + markLunarColor?: ResourceColor; + + /** + * Text fontSize. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Text fontSize. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + dayFontSize?: number; + + /** + * lunar text fontSize. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * lunar text fontSize. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + lunarDayFontSize?: number; + + /** + * Single date height. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Single date height. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + dayHeight?: number; + + /** + * Single date width. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Single date width. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + dayWidth?: number; + + /** + * Gregorian calendar height. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Gregorian calendar height. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + gregorianCalendarHeight?: number; + + /** + * Data y axis Off set. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Data y axis Off set. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + dayYAxisOffset?: number; + + /** + * Lunar data y axis Off set. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Lunar data y axis Off set. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + lunarDayYAxisOffset?: number; + + /** + * Under score X Axis Off set. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Under score X Axis Off set. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + underscoreXAxisOffset?: number; + + /** + * Under score Y Axis Off set + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Under score Y Axis Off set + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + underscoreYAxisOffset?: number; + + /** + * Schedule marker X axis Off set + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Schedule marker X axis Off set + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + scheduleMarkerXAxisOffset?: number; + + /** + * schedule Marker Y Axis Off set + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * schedule Marker Y Axis Off set + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + scheduleMarkerYAxisOffset?: number; + + /** + * Number of columns. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Number of columns. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + colSpace?: number; + + /** + * Daily five row space. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Daily five row space. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + dailyFiveRowSpace?: number; + + /** + * Daily six row space. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Daily six row space. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + dailySixRowSpace?: number; + + /** + * Single lunar height. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Single lunar height. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + lunarHeight?: number; + + /** + * Under score width. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Under score width. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + underscoreWidth?: number; + + /** + * Under score length. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Under score length. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + underscoreLength?: number; + + /** + * Schedule marker radius. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Schedule marker radius. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + scheduleMarkerRadius?: number; + + /** + * Boundary row offset. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Boundary row offset. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + boundaryRowOffset?: number; + + /** + * Boundary col offset. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Boundary col offset. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + boundaryColOffset?: number; +} + +/** + * Non current day style. + * + * @interface NonCurrentDayStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Non current day style. + * + * @interface NonCurrentDayStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +interface NonCurrentDayStyle { + /** + * Non-current month day color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Non-current month day color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + nonCurrentMonthDayColor?: ResourceColor; + + /** + * Lunar style of non-current month. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Lunar style of non-current month. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + nonCurrentMonthLunarColor?: ResourceColor; + + /** + * Non-Current Month Workday Marker Color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Non-Current Month Workday Marker Color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + nonCurrentMonthWorkDayMarkColor?: ResourceColor; + + /** + * Non-Current Month Off Day Marker Color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Non-Current Month Off Day Marker Color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + nonCurrentMonthOffDayMarkColor?: ResourceColor; +} + +/** + * Non current day style. + * + * @interface TodayStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Non current day style. + * + * @interface TodayStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +interface TodayStyle { + /** + * Style of focus color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of focus color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + focusedDayColor?: ResourceColor; + + /** + * Focus on Lunar Colors. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Focus on Lunar Colors. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + focusedLunarColor?: ResourceColor; + + /** + * Background color of the focus area. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Background color of the focus area. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + focusedAreaBackgroundColor?: ResourceColor; + + /** + * Focus area radius. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Focus area radius. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + focusedAreaRadius?: number; +} + +/** + * Week Style. + * + * @interface WeekStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Week Style. + * + * @interface WeekStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +interface WeekStyle { + /** + * Style of week color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of week color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + weekColor?: ResourceColor; + + /** + * Style of week day color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of week day color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + weekendDayColor?: ResourceColor; + + /** + * Style of lunar color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of lunar color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + weekendLunarColor?: ResourceColor; + + /** + * Style of week font size. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of week font size. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + weekFontSize?: number; + + /** + * Style of week height. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of week height. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + weekHeight?: number; + + /** + * Style of week width. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of week width. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + weekWidth?: number; + + /** + * Style of week space. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of week space. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + weekAndDayRowSpace?: number; +} + +/** + * Work state style. + * + * @interface WorkStateStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Work state style. + * + * @interface WorkStateStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +interface WorkStateStyle { + /** + * Style of day color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of day color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + workDayMarkColor?: ResourceColor; + + /** + * Style of day color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of day color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + offDayMarkColor?: ResourceColor; + + /** + * Style of day size. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of day size. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + workDayMarkSize?: number; + + /** + * Style of day size. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of day size. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + offDayMarkSize?: number; + + /** + * Style of width. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of width. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + workStateWidth?: number; + + /** + * Style of distance. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of distance. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + workStateHorizontalMovingDistance?: number; + + /** + * Style of distance. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Style of distance. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + workStateVerticalMovingDistance?: number; +} + +/** + * Defines the struct of CalendarSelectedDate. + * + * @interface CalendarSelectedDate + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Defines the struct of CalendarSelectedDate. + * + * @interface CalendarSelectedDate + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +declare interface CalendarSelectedDate { + /** + * Application year + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Application year + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + year: number; + + /** + * Application month + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Application month + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + month: number; + + /** + * Application day + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Application day + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + day: number; +} + +/** + * Defines the struct of CalendarRequestedData. + * + * @interface CalendarRequestedData + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Defines the struct of CalendarRequestedData. + * + * @interface CalendarRequestedData + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +declare interface CalendarRequestedData { + /** + * Previous year + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Previous year + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + year: number; + + /** + * Previous month + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Previous month + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + month: number; + + /** + * Current Year + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Current Year + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + currentYear: number; + + /** + * Current Month + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Current Month + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + currentMonth: number; + + /** + * State of month + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * State of month + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + monthState: number; +} + +/** + * Calendar controller. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Calendar controller. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +declare class CalendarController { + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + constructor(); + + /** + * Back to day. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Back to day. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + backToToday(); + + /** + * To the specified element. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * To the specified element. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + goTo(value: { year: number; month: number; day: number }); +} + +/** + * Calendar Interface + * + * @interface CalendarInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Calendar Interface + * + * @interface CalendarInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +interface CalendarInterface { + /** + * Set value. + * + * @param { object } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Set value. + * + * @param { object } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + (value: { + date: { year: number; month: number; day: number }; + currentData: MonthData; + preData: MonthData; + nextData: MonthData; + controller?: CalendarController; + }): CalendarAttribute; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +declare class CalendarAttribute { + /** + * Specifies whether the component displays the lunar calendar information. + * + * @param { boolean } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Specifies whether the component displays the lunar calendar information. + * + * @param { boolean } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + showLunar(value: boolean): CalendarAttribute; + + /** + * Setting whether to display holiday information + * + * @param { boolean } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Setting whether to display holiday information + * + * @param { boolean } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + showHoliday(value: boolean): CalendarAttribute; + + /** + * Indicates whether the page can be scrolled. + * + * @param { boolean } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Indicates whether the page can be scrolled. + * + * @param { boolean } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + needSlide(value: boolean): CalendarAttribute; + + /** + * Set the start day of the week for the calendar. + * + * @param { number } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Set the start day of the week for the calendar. + * + * @param { number } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + startOfWeek(value: number): CalendarAttribute; + + /** + * Set weekend. The default value is Sunday and Saturday. + * + * @param { number } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Set weekend. The default value is Sunday and Saturday. + * + * @param { number } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + offDays(value: number): CalendarAttribute; + + /** + * Sets the sliding direction. + * + * @param { Axis } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Sets the sliding direction. + * + * @param { Axis } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + direction(value: Axis): CalendarAttribute; + + /** + * Sets the date style in the current month. + * + * @param { CurrentDayStyle } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Sets the date style in the current month. + * + * @param { CurrentDayStyle } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + currentDayStyle(value: CurrentDayStyle): CalendarAttribute; + + /** + * Sets the non-monthly date style. + * + * @param { NonCurrentDayStyle } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Sets the non-monthly date style. + * + * @param { NonCurrentDayStyle } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + nonCurrentDayStyle(value: NonCurrentDayStyle): CalendarAttribute; + + /** + * Set the date style for today. + * + * @param { TodayStyle } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Set the date style for today. + * + * @param { TodayStyle } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + todayStyle(value: TodayStyle): CalendarAttribute; + + /** + * Sets the date style for the weekend. + * + * @param { WeekStyle } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Sets the date style for the weekend. + * + * @param { WeekStyle } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + weekStyle(value: WeekStyle): CalendarAttribute; + + /** + * Sets the style of the working state. + * + * @param { WorkStateStyle } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Sets the style of the working state. + * + * @param { WorkStateStyle } value + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + workStateStyle(value: WorkStateStyle): CalendarAttribute; + + /** + * Click a date to return the information about the date you clicked. + * + * @param { function } event + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Click a date to return the information about the date you clicked. + * + * @param { function } event + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + onSelectChange(event: (event: CalendarSelectedDate) => void): CalendarAttribute; + + /** + * When you swipe to switch months, the information about the previous month and the next month is requested. + * + * @param { function } event + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * When you swipe to switch months, the information about the previous month and the next month is requested. + * + * @param { function } event + * @returns { CalendarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ + onRequestData( + event: (event: CalendarRequestedData) => void, + ): CalendarAttribute; +} + +/** + * Defines Calendar Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Defines Calendar Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +declare const Calendar: CalendarInterface; + +/** + * Defines Calendar Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * Defines Calendar Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 10 + */ +declare const CalendarInstance: CalendarAttribute; diff --git a/tests/arkts-sdk/ets/calendar_picker.d.ts b/tests/arkts-sdk/ets/calendar_picker.d.ts new file mode 100644 index 00000000..21add8f9 --- /dev/null +++ b/tests/arkts-sdk/ets/calendar_picker.d.ts @@ -0,0 +1,584 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * The type of alignment between entry and calendar. + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The type of alignment between entry and calendar. + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum CalendarAlign { + /** + * The value of calendar align type start. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of calendar align type start. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + START = 0, + /** + * The value of calendar align type center. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of calendar align type center. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CENTER = 1, + /** + * The value of calendar align type end. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of calendar align type end. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + END = 2 +} + +/** + * Defines the options of CalendarPicker. + * @interface CalendarOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of CalendarPicker. + * @interface CalendarOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface CalendarOptions { + /** + * Specifies the radius of the background of the day in calendar. + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specifies the radius of the background of the day in calendar. + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hintRadius?: number | Resource; + + /** + * Specifies the date selector check date. + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specifies the date selector check date. + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selected?: Date; +} + +/** + * Defines the CalendarPicker Component. + * @interface CalendarPickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the CalendarPicker Component. + * @interface CalendarPickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface CalendarPickerInterface { + /** + * Defines the CalendarPicker constructor. + * @param { CalendarOptions } options - the option of th calendarPicker. + * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the CalendarPicker constructor. + * @param { CalendarOptions } options - the option of th calendarPicker. + * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (options?: CalendarOptions): CalendarPickerAttribute; +} + +/** + * Defines the CalendarPicker attribute functions. + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the CalendarPicker attribute functions. + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class CalendarPickerAttribute extends CommonMethod { + /** + * Set the alignment between entry and calendar dialog. + * @param { CalendarAlign } alignType - The type of alignment between entry and calendar dialog. + * @param { Offset } offset - The offset between entry and calendar dialog. + * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the alignment between entry and calendar dialog. + * @param { CalendarAlign } alignType - The type of alignment between entry and calendar dialog. + * @param { Offset } offset - The offset between entry and calendar dialog. + * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + edgeAlign(alignType: CalendarAlign, offset?: Offset): CalendarPickerAttribute; + + /** + * Sets the text style of entry + * @param { PickerTextStyle } value - indicates the text style of entry. + * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of entry + * @param { PickerTextStyle } value - indicates the text style of entry. + * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle(value: PickerTextStyle): CalendarPickerAttribute; + + /** + * Callback for selected date changed. + * @param { function } callback - Callback for selected date changed. + * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback for selected date changed. + * @param { function } callback - Callback for selected date changed. + * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Callback for selected date changed. + * @param { Callback } callback - callback for selected date changed. + * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onChange(callback: Callback): CalendarPickerAttribute; +} + +/** + * Defines the DatePickerDialogOptions for Calendar Picker Dialog. + * @interface CalendarDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the DatePickerDialogOptions for Calendar Picker Dialog. + * @interface CalendarDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface CalendarDialogOptions extends CalendarOptions { + /** + * Called when the OK button in the dialog is clicked. + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the OK button in the dialog is clicked. + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the OK button in the dialog is clicked. + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onAccept?: Callback; + + /** + * Called when the Cancel button in the dialog is clicked. + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the Cancel button in the dialog is clicked. + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the Cancel button in the dialog is clicked. + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onCancel?: VoidCallback; + + /** + * This event is triggered when a date is selected in dialog. + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This event is triggered when a date is selected in dialog. + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * This event is triggered when a date is selected in dialog. + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onChange?: Callback; + + /** + * Defines the calendarPickerDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the calendarPickerDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Defines the calendarPickerDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the calendarPickerDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Style of accept button. + * + * @type { ?PickerDialogButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + acceptButtonStyle?: PickerDialogButtonStyle; + + /** + * Style of cancel button. + * + * @type { ?PickerDialogButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cancelButtonStyle?: PickerDialogButtonStyle; + + /** + * Callback function when the dialog appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Callback function when the dialog appears. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDidAppear?: VoidCallback; + + /** + * Callback function when the dialog disappears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Callback function when the dialog disappears. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDidDisappear?: VoidCallback; + + /** + * Callback function before the dialog openAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Callback function before the dialog openAnimation starts. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onWillAppear?: VoidCallback; + + /** + * Callback function before the dialog closeAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Callback function before the dialog closeAnimation starts. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onWillDisappear?: VoidCallback; + + /** + * Defines the dialog's shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the dialog's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; +} + +/** + * Defines CalendarPickerDialog which uses show method to show CalendarPicker dialog. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines CalendarPickerDialog which uses show method to show CalendarPicker dialog. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class CalendarPickerDialog { + /** + * Invoking method display. + * @param { CalendarDialogOptions } options - the option of th calendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoking method display. + * @param { CalendarDialogOptions } options - the option of th calendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + static show(options?: CalendarDialogOptions): void; +} + +/** + * Defines CalendarPicker Component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines CalendarPicker Component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const CalendarPicker: CalendarPickerInterface; + +/** + * Defines CalendarPicker Component instance. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines CalendarPicker Component instance. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const CalendarPickerInstance: CalendarPickerAttribute; diff --git a/tests/arkts-sdk/ets/canvas.d.ts b/tests/arkts-sdk/ets/canvas.d.ts new file mode 100644 index 00000000..39ab378d --- /dev/null +++ b/tests/arkts-sdk/ets/canvas.d.ts @@ -0,0 +1,6204 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Import the drawing canvas type object for Canvas. + * + * @typedef { import('../api/@ohos.graphics.drawing').default.Canvas } DrawingCanvas + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type DrawingCanvas = import('../api/@ohos.graphics.drawing').default.Canvas; + +/** + * Filling style algorithm, which determines whether a point is within or outside the path. The following + * two configurations are supported: + * "evenodd": odd and even round rule + * "nonzero": (Default) Non-zero Wrap Rules + * + * @typedef { "evenodd" | "nonzero" } CanvasFillRule + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Filling style algorithm, which determines whether a point is within or outside the path. The following + * two configurations are supported: + * "evenodd": odd and even round rule + * "nonzero": (Default) Non-zero Wrap Rules + * + * @typedef { "evenodd" | "nonzero" } CanvasFillRule + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Filling style algorithm, which determines whether a point is within or outside the path. The following + * two configurations are supported: + * "evenodd": odd and even round rule + * "nonzero": (Default) Non-zero Wrap Rules + * + * @typedef { "evenodd" | "nonzero" } CanvasFillRule + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Filling style algorithm, which determines whether a point is within or outside the path. The following + * two configurations are supported: + * "evenodd": odd and even round rule + * "nonzero": (Default) Non-zero Wrap Rules + * + * @typedef { "evenodd" | "nonzero" } CanvasFillRule + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type CanvasFillRule = "evenodd" | "nonzero"; + +/** + * Specifies the attribute of drawing the end of each line segment. The following configurations are supported: + * "butt": (Default) Segment Ends in Square + * "round": Segment ends in a circle + * "square": The end of the segment ends in a square, but a rectangular area is added that is the same width + * as the segment and is half the thickness of the segment. + * + * @typedef { "butt" | "round" | "square" } CanvasLineCap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Specifies the attribute of drawing the end of each line segment. The following configurations are supported: + * "butt": (Default) Segment Ends in Square + * "round": Segment ends in a circle + * "square": The end of the segment ends in a square, but a rectangular area is added that is the same width + * as the segment and is half the thickness of the segment. + * + * @typedef { "butt" | "round" | "square" } CanvasLineCap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Specifies the attribute of drawing the end of each line segment. The following configurations are supported: + * "butt": (Default) Segment Ends in Square + * "round": Segment ends in a circle + * "square": The end of the segment ends in a square, but a rectangular area is added that is the same width + * as the segment and is half the thickness of the segment. + * + * @typedef { "butt" | "round" | "square" } CanvasLineCap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Specifies the attribute of drawing the end of each line segment. The following configurations are supported: + * "butt": (Default) Segment Ends in Square + * "round": Segment ends in a circle + * "square": The end of the segment ends in a square, but a rectangular area is added that is the same width + * as the segment and is half the thickness of the segment. + * + * @typedef { "butt" | "round" | "square" } CanvasLineCap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type CanvasLineCap = "butt" | "round" | "square"; + +/** + * Sets the attribute of how two connected parts (line segments, arcs, and curves) whose length is not 0 + * are connected together. The following three configurations are supported: + * "bevel": Fill the ends of the connected sections with an additional triangle-base area, + * each with its own independent rectangular corner. + * "miter": (Default) An additional diamond region is formed by extending the outer edges of the connected portions + * so that they intersect at a point. + * "round": Draw the shape of the corner by filling in an additional sector with the center at the end of the + * connected section. The radius of the fillet is the width of the segment. + * + * @typedef { "bevel" | "miter" | "round" } CanvasLineJoin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Sets the attribute of how two connected parts (line segments, arcs, and curves) whose length is not 0 + * are connected together. The following three configurations are supported: + * "bevel": Fill the ends of the connected sections with an additional triangle-base area, + * each with its own independent rectangular corner. + * "miter": (Default) An additional diamond region is formed by extending the outer edges of the connected portions + * so that they intersect at a point. + * "round": Draw the shape of the corner by filling in an additional sector with the center at the end of the + * connected section. The radius of the fillet is the width of the segment. + * + * @typedef { "bevel" | "miter" | "round" } CanvasLineJoin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Sets the attribute of how two connected parts (line segments, arcs, and curves) whose length is not 0 + * are connected together. The following three configurations are supported: + * "bevel": Fill the ends of the connected sections with an additional triangle-base area, + * each with its own independent rectangular corner. + * "miter": (Default) An additional diamond region is formed by extending the outer edges of the connected portions + * so that they intersect at a point. + * "round": Draw the shape of the corner by filling in an additional sector with the center at the end of the + * connected section. The radius of the fillet is the width of the segment. + * + * @typedef { "bevel" | "miter" | "round" } CanvasLineJoin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Sets the attribute of how two connected parts (line segments, arcs, and curves) whose length is not 0 + * are connected together. The following three configurations are supported: + * "bevel": Fill the ends of the connected sections with an additional triangle-base area, + * each with its own independent rectangular corner. + * "miter": (Default) An additional diamond region is formed by extending the outer edges of the connected portions + * so that they intersect at a point. + * "round": Draw the shape of the corner by filling in an additional sector with the center at the end of the + * connected section. The radius of the fillet is the width of the segment. + * + * @typedef { "bevel" | "miter" | "round" } CanvasLineJoin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type CanvasLineJoin = "bevel" | "miter" | "round"; + +/** + * Indicates the attribute of the current text direction. The options are as follows: + * "inherit": (Default) Inherit current Canvas component settings + * "ltr": The text direction is left to right. + * "rtl": The text direction is from right to left. + * + * @typedef { "inherit" | "ltr" | "rtl" } CanvasDirection + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Indicates the attribute of the current text direction. The options are as follows: + * "inherit": (Default) Inherit current Canvas component settings + * "ltr": The text direction is left to right. + * "rtl": The text direction is from right to left. + * + * @typedef { "inherit" | "ltr" | "rtl" } CanvasDirection + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Indicates the attribute of the current text direction. The options are as follows: + * "inherit": (Default) Inherit current Canvas component settings + * "ltr": The text direction is left to right. + * "rtl": The text direction is from right to left. + * + * @typedef { "inherit" | "ltr" | "rtl" } CanvasDirection + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Indicates the attribute of the current text direction. The options are as follows: + * "inherit": (Default) Inherit current Canvas component settings + * "ltr": The text direction is left to right. + * "rtl": The text direction is from right to left. + * + * @typedef { "inherit" | "ltr" | "rtl" } CanvasDirection + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type CanvasDirection = "inherit" | "ltr" | "rtl"; + +/** + * Describes the alignment mode for drawing text. The options are as follows: + * "center": The text is centered. + * "end": Where text aligns lines end (Left alignment refers to the local from left to right, + * and right alignment refers to the local from right to left) + * "left": The text is left-aligned. + * "right": The text is right-aligned. + * "start": (Default) Where the text snap line begins (Left alignment refers to the local from left to right, + * and right alignment refers to the local from right to left) + * + * @typedef { "center" | "end" | "left" | "right" | "start" } CanvasTextAlign + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Describes the alignment mode for drawing text. The options are as follows: + * "center": The text is centered. + * "end": Where text aligns lines end (Left alignment refers to the local from left to right, + * and right alignment refers to the local from right to left) + * "left": The text is left-aligned. + * "right": The text is right-aligned. + * "start": (Default) Where the text snap line begins (Left alignment refers to the local from left to right, + * and right alignment refers to the local from right to left) + * + * @typedef { "center" | "end" | "left" | "right" | "start" } CanvasTextAlign + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Describes the alignment mode for drawing text. The options are as follows: + * "center": The text is centered. + * "end": Where text aligns lines end (Left alignment refers to the local from left to right, + * and right alignment refers to the local from right to left) + * "left": The text is left-aligned. + * "right": The text is right-aligned. + * "start": (Default) Where the text snap line begins (Left alignment refers to the local from left to right, + * and right alignment refers to the local from right to left) + * + * @typedef { "center" | "end" | "left" | "right" | "start" } CanvasTextAlign + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Describes the alignment mode for drawing text. The options are as follows: + * "center": The text is centered. + * "end": Where text aligns lines end (Left alignment refers to the local from left to right, + * and right alignment refers to the local from right to left) + * "left": The text is left-aligned. + * "right": The text is right-aligned. + * "start": (Default) Where the text snap line begins (Left alignment refers to the local from left to right, + * and right alignment refers to the local from right to left) + * + * @typedef { "center" | "end" | "left" | "right" | "start" } CanvasTextAlign + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type CanvasTextAlign = "center" | "end" | "left" | "right" | "start"; + +/** + * Text baseline, which supports the following configurations: + * "alphabetic": (Default) The text baseline is the standard letter baseline. + * "bottom": The text baseline is at the bottom of the text block. The difference between the ideographic baseline + * and the ideographic baseline is that the ideographic baseline does not need to consider downlink letters. + * "hanging": The text baseline is a hanging baseline. + * "ideographic": The text baseline is the ideographic baseline; If the character itself exceeds the alphabetic + * baseline, the ideographic baseline is at the bottom of the character itself. + * "middle": The text baseline is in the middle of the text block. + * "top": The text baseline is at the top of the text block. + * + * @typedef { "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" } CanvasTextBaseline + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Text baseline, which supports the following configurations: + * "alphabetic": (Default) The text baseline is the standard letter baseline. + * "bottom": The text baseline is at the bottom of the text block. The difference between the ideographic baseline + * and the ideographic baseline is that the ideographic baseline does not need to consider downlink letters. + * "hanging": The text baseline is a hanging baseline. + * "ideographic": The text baseline is the ideographic baseline; If the character itself exceeds the alphabetic + * baseline, the ideographic baseline is at the bottom of the character itself. + * "middle": The text baseline is in the middle of the text block. + * "top": The text baseline is at the top of the text block. + * + * @typedef { "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" } CanvasTextBaseline + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Text baseline, which supports the following configurations: + * "alphabetic": (Default) The text baseline is the standard letter baseline. + * "bottom": The text baseline is at the bottom of the text block. The difference between the ideographic baseline + * and the ideographic baseline is that the ideographic baseline does not need to consider downlink letters. + * "hanging": The text baseline is a hanging baseline. + * "ideographic": The text baseline is the ideographic baseline; If the character itself exceeds the alphabetic + * baseline, the ideographic baseline is at the bottom of the character itself. + * "middle": The text baseline is in the middle of the text block. + * "top": The text baseline is at the top of the text block. + * + * @typedef { "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" } CanvasTextBaseline + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Text baseline, which supports the following configurations: + * "alphabetic": (Default) The text baseline is the standard letter baseline. + * "bottom": The text baseline is at the bottom of the text block. The difference between the ideographic baseline + * and the ideographic baseline is that the ideographic baseline does not need to consider downlink letters. + * "hanging": The text baseline is a hanging baseline. + * "ideographic": The text baseline is the ideographic baseline; If the character itself exceeds the alphabetic + * baseline, the ideographic baseline is at the bottom of the character itself. + * "middle": The text baseline is in the middle of the text block. + * "top": The text baseline is at the top of the text block. + * + * @typedef { "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" } CanvasTextBaseline + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type CanvasTextBaseline = "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top"; + +/** + * Sets the image smoothness attribute. The options are as follows: + * "high": height + * "low": (default)low + * "medium": medium + * + * @typedef { "high" | "low" | "medium" } ImageSmoothingQuality + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Sets the image smoothness attribute. The options are as follows: + * "high": height + * "low": (default)low + * "medium": medium + * + * @typedef { "high" | "low" | "medium" } ImageSmoothingQuality + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Sets the image smoothness attribute. The options are as follows: + * "high": height + * "low": (default)low + * "medium": medium + * + * @typedef { "high" | "low" | "medium" } ImageSmoothingQuality + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Sets the image smoothness attribute. The options are as follows: + * "high": height + * "low": (default)low + * "medium": medium + * + * @typedef { "high" | "low" | "medium" } ImageSmoothingQuality + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type ImageSmoothingQuality = "high" | "low" | "medium"; + +/** + * Import the frame node type object for Canvas. + * + * @typedef { import('../api/arkui/FrameNode').FrameNode } FrameNode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type FrameNode = import('../api/arkui/FrameNode').FrameNode; + +/** + * Opaque objects that describe gradients, created by createLinearGradient() or createRadialGradient() + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Opaque objects that describe gradients, created by createLinearGradient() or createRadialGradient() + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Opaque objects that describe gradients, created by createLinearGradient() or createRadialGradient() + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Opaque objects that describe gradients, created by createLinearGradient() or createRadialGradient() + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CanvasGradient { + /** + * Add a breakpoint defined by offset and color to the gradient + * + * @param { number } offset - Value between 0 and 1, out of range throws INDEX_SIZE_ERR error + * @param { string } color - CSS color value . If the color value cannot be resolved to a valid CSS color value + * a SYNTAX_ERR error is thrown. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Add a breakpoint defined by offset and color to the gradient + * + * @param { number } offset - Value between 0 and 1, out of range throws INDEX_SIZE_ERR error + * @param { string } color - CSS color value . If the color value cannot be resolved to a valid CSS color value + * a SYNTAX_ERR error is thrown. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Add a breakpoint defined by offset and color to the gradient + * + * @param { number } offset - Value between 0 and 1, out of range throws INDEX_SIZE_ERR error + * @param { string } color - Set the gradient color. + * a SYNTAX_ERR error is thrown. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Add a breakpoint defined by offset and color to the gradient + * + * @param { number } offset - Value between 0 and 1, out of range throws INDEX_SIZE_ERR error + * @param { string } color - Set the gradient color. + * a SYNTAX_ERR error is thrown. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + addColorStop(offset: number, color: string): void; +} + +/** + * Path object, which provides basic methods for drawing paths. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Path object, which provides basic methods for drawing paths. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Path object, which provides basic methods for drawing paths. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Path object, which provides basic methods for drawing paths. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CanvasPath { + /** + * Draw an arc path + * + * @param { number } x - The x-axis coordinate of the center (center of the circle) of the arc. + * @param { number } y - The y-axis coordinate of the center (center of the circle) of the arc. + * @param { number } radius - Radius of the arc. + * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. + * @param { number } endAngle - The end point of the arc, in radians. + * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, + * the arc is drawn clockwise. The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draw an arc path + * + * @param { number } x - The x-axis coordinate of the center (center of the circle) of the arc. + * @param { number } y - The y-axis coordinate of the center (center of the circle) of the arc. + * @param { number } radius - Radius of the arc. + * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. + * @param { number } endAngle - The end point of the arc, in radians. + * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, + * the arc is drawn clockwise. The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draw an arc path + * + * @param { number } x - The x-axis coordinate of the center (center of the circle) of the arc. + * @param { number } y - The y-axis coordinate of the center (center of the circle) of the arc. + * @param { number } radius - Radius of the arc. + * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. + * @param { number } endAngle - The end point of the arc, in radians. + * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, + * the arc is drawn clockwise. The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draw an arc path + * + * @param { number } x - The x-axis coordinate of the center (center of the circle) of the arc. + * @param { number } y - The y-axis coordinate of the center (center of the circle) of the arc. + * @param { number } radius - Radius of the arc. + * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. + * @param { number } endAngle - The end point of the arc, in radians. + * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, + * the arc is drawn clockwise. The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; + + /** + * Draw arc paths based on control points and radius + * + * @param { number } x1 - The x-axis coordinate of the first control point. + * @param { number } y1 - The y-axis coordinate of the first control point. + * @param { number } x2 - The x-axis coordinate of the second control point. + * @param { number } y2 - The y-axis coordinate of the second control point. + * @param { number } radius - Radius of the arc. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draw arc paths based on control points and radius + * + * @param { number } x1 - The x-axis coordinate of the first control point. + * @param { number } y1 - The y-axis coordinate of the first control point. + * @param { number } x2 - The x-axis coordinate of the second control point. + * @param { number } y2 - The y-axis coordinate of the second control point. + * @param { number } radius - Radius of the arc. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draw arc paths based on control points and radius + * + * @param { number } x1 - The x-axis coordinate of the first control point. + * @param { number } y1 - The y-axis coordinate of the first control point. + * @param { number } x2 - The x-axis coordinate of the second control point. + * @param { number } y2 - The y-axis coordinate of the second control point. + * @param { number } radius - Radius of the arc. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draw arc paths based on control points and radius + * + * @param { number } x1 - The x-axis coordinate of the first control point. + * @param { number } y1 - The y-axis coordinate of the first control point. + * @param { number } x2 - The x-axis coordinate of the second control point. + * @param { number } y2 - The y-axis coordinate of the second control point. + * @param { number } radius - Radius of the arc. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + + /** + * Drawing Cubic Bessel Curve Paths + * + * @param { number } cp1x - The x-axis coordinate of the first control point. + * @param { number } cp1y - The y-axis coordinate of the first control point. + * @param { number } cp2x - The x-axis coordinate of the second control point. + * @param { number } cp2y - The y-axis coordinate of the second control point. + * @param { number } x - x-axis coordinate of the end point. + * @param { number } y - y-axis coordinate of the end point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Drawing Cubic Bessel Curve Paths + * + * @param { number } cp1x - The x-axis coordinate of the first control point. + * @param { number } cp1y - The y-axis coordinate of the first control point. + * @param { number } cp2x - The x-axis coordinate of the second control point. + * @param { number } cp2y - The y-axis coordinate of the second control point. + * @param { number } x - x-axis coordinate of the end point. + * @param { number } y - y-axis coordinate of the end point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Drawing Cubic Bessel Curve Paths + * + * @param { number } cp1x - The x-axis coordinate of the first control point. + * @param { number } cp1y - The y-axis coordinate of the first control point. + * @param { number } cp2x - The x-axis coordinate of the second control point. + * @param { number } cp2y - The y-axis coordinate of the second control point. + * @param { number } x - x-axis coordinate of the end point. + * @param { number } y - y-axis coordinate of the end point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Drawing Cubic Bessel Curve Paths + * + * @param { number } cp1x - The x-axis coordinate of the first control point. + * @param { number } cp1y - The y-axis coordinate of the first control point. + * @param { number } cp2x - The x-axis coordinate of the second control point. + * @param { number } cp2y - The y-axis coordinate of the second control point. + * @param { number } x - x-axis coordinate of the end point. + * @param { number } y - y-axis coordinate of the end point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + + /** + * Returns the pen point to the start point of the current sub-path + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Returns the pen point to the start point of the current sub-path + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Returns the pen point to the start point of the current sub-path + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Returns the pen point to the start point of the current sub-path + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + closePath(): void; + + /** + * Draw an Elliptic Path + * + * @param { number } x - x-axis coordinate of the center of the ellipse. + * @param { number } y - y-axis coordinate of the center of the ellipse. + * @param { number } radiusX - Radius of the major axis of the ellipse. + * @param { number } radiusY - Radius of the minor axis of the ellipse. + * @param { number } rotation - The rotation angle of the ellipse, in radians (not angular degrees). + * @param { number } startAngle - The angle of the starting point to be drawn, measured from the x-axis in radians + * (not angular degrees). + * @param { number } endAngle - The angle, in radians, at which the ellipse is to be drawn (not angular degrees). + * @param { boolean } counterclockwise - If the value is true, the ellipse is drawn counterclockwise. Otherwise, + * the ellipse is drawn clockwise. The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draw an Elliptic Path + * + * @param { number } x - x-axis coordinate of the center of the ellipse. + * @param { number } y - y-axis coordinate of the center of the ellipse. + * @param { number } radiusX - Radius of the major axis of the ellipse. + * @param { number } radiusY - Radius of the minor axis of the ellipse. + * @param { number } rotation - The rotation angle of the ellipse, in radians (not angular degrees). + * @param { number } startAngle - The angle of the starting point to be drawn, measured from the x-axis in radians + * (not angular degrees). + * @param { number } endAngle - The angle, in radians, at which the ellipse is to be drawn (not angular degrees). + * @param { boolean } counterclockwise - If the value is true, the ellipse is drawn counterclockwise. Otherwise, + * the ellipse is drawn clockwise. The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draw an Elliptic Path + * + * @param { number } x - x-axis coordinate of the center of the ellipse. + * @param { number } y - y-axis coordinate of the center of the ellipse. + * @param { number } radiusX - Radius of the major axis of the ellipse. + * @param { number } radiusY - Radius of the minor axis of the ellipse. + * @param { number } rotation - The rotation angle of the ellipse, in radians (not angular degrees). + * @param { number } startAngle - The angle of the starting point to be drawn, measured from the x-axis in radians + * (not angular degrees). + * @param { number } endAngle - The angle, in radians, at which the ellipse is to be drawn (not angular degrees). + * @param { boolean } counterclockwise - If the value is true, the ellipse is drawn counterclockwise. Otherwise, + * the ellipse is drawn clockwise. The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draw an Elliptic Path + * + * @param { number } x - x-axis coordinate of the center of the ellipse. + * @param { number } y - y-axis coordinate of the center of the ellipse. + * @param { number } radiusX - Radius of the major axis of the ellipse. + * @param { number } radiusY - Radius of the minor axis of the ellipse. + * @param { number } rotation - The rotation angle of the ellipse, in radians (not angular degrees). + * @param { number } startAngle - The angle of the starting point to be drawn, measured from the x-axis in radians + * (not angular degrees). + * @param { number } endAngle - The angle, in radians, at which the ellipse is to be drawn (not angular degrees). + * @param { boolean } counterclockwise - If the value is true, the ellipse is drawn counterclockwise. Otherwise, + * the ellipse is drawn clockwise. The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + ellipse( + x: number, + y: number, + radiusX: number, + radiusY: number, + rotation: number, + startAngle: number, + endAngle: number, + counterclockwise?: boolean, + ): void; + + /** + * Connect sub-path using straight lines + * + * @param { number } x - The x-axis coordinate of the end point of the line. + * @param { number } y - The y-axis coordinate of the end point of the line. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Connect sub-path using straight lines + * + * @param { number } x - The x-axis coordinate of the end point of the line. + * @param { number } y - The y-axis coordinate of the end point of the line. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Connect sub-path using straight lines + * + * @param { number } x - The x-axis coordinate of the end point of the line. + * @param { number } y - The y-axis coordinate of the end point of the line. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Connect sub-path using straight lines + * + * @param { number } x - The x-axis coordinate of the end point of the line. + * @param { number } y - The y-axis coordinate of the end point of the line. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lineTo(x: number, y: number): void; + + /** + * Moves the start point of a new sub-path to the (x, y) coordinate. + * + * @param { number } x - The x-axis coordinate of the point. + * @param { number } y - The y-axis coordinate of the point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Moves the start point of a new sub-path to the (x, y) coordinate. + * + * @param { number } x - The x-axis coordinate of the point. + * @param { number } y - The y-axis coordinate of the point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Moves the start point of a new sub-path to the (x, y) coordinate. + * + * @param { number } x - The x-axis coordinate of the point. + * @param { number } y - The y-axis coordinate of the point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Moves the start point of a new sub-path to the (x, y) coordinate. + * + * @param { number } x - The x-axis coordinate of the point. + * @param { number } y - The y-axis coordinate of the point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + moveTo(x: number, y: number): void; + + /** + * Draw quadratic Bezier curve paths + * + * @param { number } cpx - The x-axis coordinate of the control point. + * @param { number } cpy - The y-axis coordinate of the control point. + * @param { number } x - x-axis coordinate of the end point. + * @param { number } y - y-axis coordinate of the end point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draw quadratic Bezier curve paths + * + * @param { number } cpx - The x-axis coordinate of the control point. + * @param { number } cpy - The y-axis coordinate of the control point. + * @param { number } x - x-axis coordinate of the end point. + * @param { number } y - y-axis coordinate of the end point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draw quadratic Bezier curve paths + * + * @param { number } cpx - The x-axis coordinate of the control point. + * @param { number } cpy - The y-axis coordinate of the control point. + * @param { number } x - x-axis coordinate of the end point. + * @param { number } y - y-axis coordinate of the end point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draw quadratic Bezier curve paths + * + * @param { number } cpx - The x-axis coordinate of the control point. + * @param { number } cpy - The y-axis coordinate of the control point. + * @param { number } x - x-axis coordinate of the end point. + * @param { number } y - y-axis coordinate of the end point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + + /** + * Draw Rectangular Paths + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draw Rectangular Paths + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draw Rectangular Paths + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draw Rectangular Paths + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + rect(x: number, y: number, w: number, h: number): void; +} + +/** + * 2D path object for path drawing + * + * @extends CanvasPath + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * 2D path object for path drawing + * + * @extends CanvasPath + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * 2D path object for path drawing + * + * @extends CanvasPath + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * 2D path object for path drawing + * + * @extends CanvasPath + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class Path2D extends CanvasPath { + /** + * Adds a path according to the specified path variable. + * + * @param { Path2D } path - Indicates the path object to be added. + * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Adds a path according to the specified path variable. + * + * @param { Path2D } path - Indicates the path object to be added. + * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a path according to the specified path variable. + * + * @param { Path2D } path - Indicates the path object to be added. + * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a path according to the specified path variable. + * + * @param { Path2D } path - Indicates the path object to be added. + * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + addPath(path: Path2D, transform?: Matrix2D): void; + + /** + * Create an empty path object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Create an empty path object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create an empty path object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create an empty path object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Create an empty path object. + * + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(unit: LengthMetricsUnit); + + /** + * Create a copy of a path object + * + * @param { Path2D } path - Path object to be copied + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Create a copy of a path object + * + * @param { Path2D } path - Path object to be copied + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create a copy of a path object + * + * @param { Path2D } path - Path object to be copied + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create a copy of a path object + * + * @param { Path2D } path - Path object to be copied + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(path: Path2D); + + /** + * Create a copy of a path object + * + * @param { Path2D } path - Path object to be copied + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(path: Path2D, unit: LengthMetricsUnit); + + /** + * Create a new path according to the description. + * + * @param { string } d - Indicates the path string that compiles with the SVG path description specifications. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Create a new path according to the description. + * + * @param { string } d - Indicates the path string that compiles with the SVG path description specifications. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create a new path according to the description. + * + * @param { string } d - Indicates the path string that compiles with the SVG path description specifications. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create a new path according to the description. + * + * @param { string } d - Indicates the path string that compiles with the SVG path description specifications. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(d: string); + + /** + * Create a new path according to the description. + * + * @param { string } description - Indicates the path string that compiles with the SVG path description specifications. + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(description: string, unit: LengthMetricsUnit); +} + +/** + * Describes an opaque object of a template, which is created using the createPattern() method. + * + * @interface CanvasPattern + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Describes an opaque object of a template, which is created using the createPattern() method. + * + * @interface CanvasPattern + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Describes an opaque object of a template, which is created using the createPattern() method. + * + * @interface CanvasPattern + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Describes an opaque object of a template, which is created using the createPattern() method. + * + * @interface CanvasPattern + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface CanvasPattern { + /** + * Adds the matrix transformation effect to the current template. + * + * @param { Matrix2D } transform - transformation matrix. The default value is null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Adds the matrix transformation effect to the current template. + * + * @param { Matrix2D } transform - transformation matrix. The default value is null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the matrix transformation effect to the current template. + * + * @param { Matrix2D } transform - transformation matrix. The default value is null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the matrix transformation effect to the current template. + * + * @param { Matrix2D } transform - transformation matrix. The default value is null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + setTransform(transform?: Matrix2D): void; +} + +/** + * Size information of the text + * + * @interface TextMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Size information of the text + * + * @interface TextMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Size information of the text + * + * @interface TextMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Size information of the text + * + * @interface TextMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface TextMetrics { + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the top of + * the rectangular boundary of the rendered text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the top of + * the rectangular boundary of the rendered text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the top of + * the rectangular boundary of the rendered text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the top of + * the rectangular boundary of the rendered text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly actualBoundingBoxAscent: number; + + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the bottom of + * the rectangular boundary of the rendered text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the bottom of + * the rectangular boundary of the rendered text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the bottom of + * the rectangular boundary of the rendered text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the bottom of + * the rectangular boundary of the rendered text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly actualBoundingBoxDescent: number; + + /** + * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to + * the left of the text rectangle boundary. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to + * the left of the text rectangle boundary. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to + * the left of the text rectangle boundary. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to + * the left of the text rectangle boundary. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly actualBoundingBoxLeft: number; + + /** + * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to + * the right of the text rectangle boundary. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to + * the right of the text rectangle boundary. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to + * the right of the text rectangle boundary. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to + * the right of the text rectangle boundary. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly actualBoundingBoxRight: number; + + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the alphabetic baseline of + * the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the alphabetic baseline of + * the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the alphabetic baseline of + * the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the alphabetic baseline of + * the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly alphabeticBaseline: number; + + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the top of the + * em square in the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the top of the + * em square in the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the top of the + * em square in the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the top of the + * em square in the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly emHeightAscent: number; + + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the + * em box in the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the + * em box in the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the + * em box in the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the + * em box in the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly emHeightDescent: number; + + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the top of the + * highest rectangle boundary of all fonts rendering text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the top of the + * highest rectangle boundary of all fonts rendering text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the top of the + * highest rectangle boundary of all fonts rendering text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the top of the + * highest rectangle boundary of all fonts rendering text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly fontBoundingBoxAscent: number; + + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the + * rectangular boundary of all fonts rendering text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the + * rectangular boundary of all fonts rendering text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the + * rectangular boundary of all fonts rendering text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the + * rectangular boundary of all fonts rendering text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly fontBoundingBoxDescent: number; + + /** + * Double, distance from the horizontal line indicated by the textBaseline property to + * the hanging baseline of the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to + * the hanging baseline of the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to + * the hanging baseline of the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to + * the hanging baseline of the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly hangingBaseline: number; + + /** + * Double, distance from the horizontal line indicated by the textBaseline property to + * the ideographic baseline of the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to + * the ideographic baseline of the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to + * the ideographic baseline of the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Double, distance from the horizontal line indicated by the textBaseline property to + * the ideographic baseline of the wireframe. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly ideographicBaseline: number; + + /** + * Indicates the width of a character string. The value is of the double type. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Indicates the width of a character string. The value is of the double type. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates the width of a character string. The value is of the double type. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates the width of a character string. The value is of the double type. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly width: number; + + /** + * Indicates the height of a character string. The value is of the double type. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Indicates the height of a character string. The value is of the double type. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates the height of a character string. The value is of the double type. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates the height of a character string. The value is of the double type. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly height: number; +} + +/** + * Bitmap image object that can be drawn onto the current Canvas + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Bitmap image object that can be drawn onto the current Canvas + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Bitmap image object that can be drawn onto the current Canvas + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Bitmap image object that can be drawn onto the current Canvas + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ImageBitmap { + /** + * Indicates the height of the CSS pixel unit of ImageData. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Indicates the height of the CSS pixel unit of ImageData. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates the height of the CSS pixel unit of ImageData. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates the height of the CSS pixel unit of ImageData. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly height: number; + + /** + * Indicates the width of the CSS pixel unit of ImageData. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Indicates the width of the CSS pixel unit of ImageData. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates the width of the CSS pixel unit of ImageData. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates the width of the CSS pixel unit of ImageData. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly width: number; + + /** + * Releases all graphics resources associated with an ImageBitmap. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Releases all graphics resources associated with an ImageBitmap. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Releases all graphics resources associated with an ImageBitmap. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Releases all graphics resources associated with an ImageBitmap. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + close(): void; + + /** + * Create an ImageBitmap object based on the transferred image path. + * + * @param { string } src - Path of the image object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Create an ImageBitmap object based on the transferred image path. + * + * @param { string } src - Path of the image object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create an ImageBitmap object based on the transferred image path. + * + * @param { string } src - Path of the image object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create an ImageBitmap object based on the transferred image path. + * + * @param { string } src - Path of the image object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(src: string); + + /** + * Create an ImageBitmap object based on the transferred image path. + * + * @param { string } src - Path of the image object. + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(src: string, unit: LengthMetricsUnit); + + /** + * Transfer a PixelMap object to construct an ImageBitmap object. + * + * @param { PixelMap } data - PixelMap object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Transfer a PixelMap object to construct an ImageBitmap object. + * + * @param { PixelMap } data - PixelMap object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Transfer a PixelMap object to construct an ImageBitmap object. + * + * @param { PixelMap } data - PixelMap object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(data: PixelMap); + + /** + * Transfer a PixelMap object to construct an ImageBitmap object. + * + * @param { PixelMap } data - PixelMap object + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(data: PixelMap, unit: LengthMetricsUnit); +} + +/** + * Image data object + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Image data object + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Image data object + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Image data object + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ImageData { + /** + * Array containing image pixel data + * + * @type { Uint8ClampedArray } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Array containing image pixel data + * + * @type { Uint8ClampedArray } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Array containing image pixel data + * + * @type { Uint8ClampedArray } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Array containing image pixel data + * + * @type { Uint8ClampedArray } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly data: Uint8ClampedArray; + + /** + * Width of the image. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Width of the image. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Width of the image. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Width of the image. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly height: number; + + /** + * Height of the image. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Height of the image. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Height of the image. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Height of the image. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly width: number; + + /** + * Create an ImageData object based on the input parameters. + * + * @param { number } width - Width of the image. + * @param { number } height - Height of the image. + * @param { Uint8ClampedArray } data - Data of the image. If this parameter is not specified, the default value is a black rectangular image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Create an ImageData object based on the input parameters. + * + * @param { number } width - Width of the image. + * @param { number } height - Height of the image. + * @param { Uint8ClampedArray } data - Data of the image. If this parameter is not specified, the default value is a black rectangular image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create an ImageData object based on the input parameters. + * + * @param { number } width - Width of the image. + * @param { number } height - Height of the image. + * @param { Uint8ClampedArray } data - Data of the image. If this parameter is not specified, the default value is a black rectangular image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create an ImageData object based on the input parameters. + * + * @param { number } width - Width of the image. + * @param { number } height - Height of the image. + * @param { Uint8ClampedArray } data - Data of the image. If this parameter is not specified, the default value is a black rectangular image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(width: number, height: number, data?: Uint8ClampedArray); + + /** + * Create an ImageData object based on the input parameters. + * + * @param { number } width - Width of the image. + * @param { number } height - Height of the image. + * @param { Uint8ClampedArray } data - Data of the image. If this parameter is not specified, the default value is a black rectangular image. + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(width: number, height: number, data?: Uint8ClampedArray, unit?: LengthMetricsUnit); +} + +/** + * This object allows you to set properties when creating a rendering context + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * This object allows you to set properties when creating a rendering context + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * This object allows you to set properties when creating a rendering context + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * This object allows you to set properties when creating a rendering context + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class RenderingContextSettings { + /** + * Indicates whether anti-aliasing is enabled for canvas. The default value is false. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Indicates whether anti-aliasing is enabled for canvas. The default value is false. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates whether anti-aliasing is enabled for canvas. The default value is false. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates whether anti-aliasing is enabled for canvas. The default value is false. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + antialias?: boolean; + + /** + * Create an RenderingContextSettings object based on the antialias and alpha. + * + * @param { boolean } antialias - Indicates whether anti-aliasing is enabled for canvas + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Create an RenderingContextSettings object based on the antialias and alpha. + * + * @param { boolean } antialias - Indicates whether anti-aliasing is enabled for canvas + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create an RenderingContextSettings object based on the antialias and alpha. + * + * @param { boolean } antialias - Indicates whether anti-aliasing is enabled for canvas + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create an RenderingContextSettings object based on the antialias and alpha. + * + * @param { boolean } antialias - Indicates whether anti-aliasing is enabled for canvas + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(antialias?: boolean); +} + +/** + * Canvas renderer for drawing shapes, text, images and other objects + * + * @extends CanvasPath + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Canvas renderer for drawing shapes, text, images and other objects + * + * @extends CanvasPath + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Canvas renderer for drawing shapes, text, images and other objects + * + * @extends CanvasPath + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Canvas renderer for drawing shapes, text, images and other objects + * + * @extends CanvasPath + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CanvasRenderer extends CanvasPath { + /** + * Transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). + * If the value is out of range, the assignment is invalid. + * + * @type { number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). + * If the value is out of range, the assignment is invalid. + * + * @type { number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). + * If the value is out of range, the assignment is invalid. + * + * @type { number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). + * If the value is out of range, the assignment is invalid. + * + * @type { number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + globalAlpha: number; + + /** + * Type of composition operation applied when drawing a new shape. The following types are supported: + * source-over: (Default) Draws a new drawing on top of an existing canvas context. + * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. + * Everything else is transparent. + * source-out: Draws a new drawing where it does not overlap with the existing canvas content. + * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. + * destination-over: Draws a new graphic behind the existing canvas content. + * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. + * Everything else is transparent. + * destination-out: Existing content remains where the new drawing does not overlap. + * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, + * which is drawn behind the canvas content. + * lighter: The color of two overlapping shapes is determined by adding the color values. + * copy: Only new graphics are displayed. + * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. + * + * @type { string } + * @default source-over + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Type of composition operation applied when drawing a new shape. The following types are supported: + * source-over: (Default) Draws a new drawing on top of an existing canvas context. + * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. + * Everything else is transparent. + * source-out: Draws a new drawing where it does not overlap with the existing canvas content. + * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. + * destination-over: Draws a new graphic behind the existing canvas content. + * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. + * Everything else is transparent. + * destination-out: Existing content remains where the new drawing does not overlap. + * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, + * which is drawn behind the canvas content. + * lighter: The color of two overlapping shapes is determined by adding the color values. + * copy: Only new graphics are displayed. + * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. + * + * @type { string } + * @default source-over + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Type of composition operation applied when drawing a new shape. The following types are supported: + * source-over: (Default) Draws a new drawing on top of an existing canvas context. + * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. + * Everything else is transparent. + * source-out: Draws a new drawing where it does not overlap with the existing canvas content. + * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. + * destination-over: Draws a new graphic behind the existing canvas content. + * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. + * Everything else is transparent. + * destination-out: Existing content remains where the new drawing does not overlap. + * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, + * which is drawn behind the canvas content. + * lighter: The color of two overlapping shapes is determined by adding the color values. + * copy: Only new graphics are displayed. + * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. + * + * @type { string } + * @default source-over + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Type of composition operation applied when drawing a new shape. The following types are supported: + * source-over: (Default) Draws a new drawing on top of an existing canvas context. + * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. + * Everything else is transparent. + * source-out: Draws a new drawing where it does not overlap with the existing canvas content. + * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. + * destination-over: Draws a new graphic behind the existing canvas content. + * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. + * Everything else is transparent. + * destination-out: Existing content remains where the new drawing does not overlap. + * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, + * which is drawn behind the canvas content. + * lighter: The color of two overlapping shapes is determined by adding the color values. + * copy: Only new graphics are displayed. + * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. + * + * @type { string } + * @default source-over + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + globalCompositeOperation: string; + + /** + * Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + drawImage(image: ImageBitmap | PixelMap, dx: number, dy: number): void; + + /** + * Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. + * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. + * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. + * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. + * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + drawImage(image: ImageBitmap | PixelMap, dx: number, dy: number, dw: number, dh: number): void; + + /** + *Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } sx - x coordinate of the upper left corner of the rectangle (cropping) selection box of the image. + * @param { number } sy - y coordinate of the upper left corner of the rectangle (cropping) selection box of the image. + * @param { number } sw - Width of the rectangle (cropping) selection box of the image. + * @param { number } sh - Height of the rectangle (cropping) selection box of the image. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. + * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + *Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } sx - x coordinate of the upper left corner of the rectangle (cropping) selection box of the image. + * @param { number } sy - y coordinate of the upper left corner of the rectangle (cropping) selection box of the image. + * @param { number } sw - Width of the rectangle (cropping) selection box of the image. + * @param { number } sh - Height of the rectangle (cropping) selection box of the image. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. + * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + *Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } sx - x coordinate of the upper left corner of the rectangle (cropping) selection box of the image. + * @param { number } sy - y coordinate of the upper left corner of the rectangle (cropping) selection box of the image. + * @param { number } sw - Width of the rectangle (cropping) selection box of the image. + * @param { number } sh - Height of the rectangle (cropping) selection box of the image. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. + * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + *Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } sx - x coordinate of the upper left corner of the rectangle (cropping) selection box of the image. + * @param { number } sy - y coordinate of the upper left corner of the rectangle (cropping) selection box of the image. + * @param { number } sw - Width of the rectangle (cropping) selection box of the image. + * @param { number } sh - Height of the rectangle (cropping) selection box of the image. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. + * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + drawImage( + image: ImageBitmap | PixelMap, + sx: number, + sy: number, + sw: number, + sh: number, + dx: number, + dy: number, + dw: number, + dh: number, + ): void; + + /** + * Clear the sub-path list and start a new path. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Clear the sub-path list and start a new path. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Clear the sub-path list and start a new path. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Clear the sub-path list and start a new path. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + beginPath(): void; + + /** + * Sets the currently created path as the current clipping path + * + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the currently created path as the current clipping path + * + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the currently created path as the current clipping path + * + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the currently created path as the current clipping path + * + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + clip(fillRule?: CanvasFillRule): void; + + /** + * Tailoring according to the specified path + * + * @param { Path2D } path - Path to be cut. + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Tailoring according to the specified path + * + * @param { Path2D } path - Path to be cut. + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Tailoring according to the specified path + * + * @param { Path2D } path - Path to be cut. + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Tailoring according to the specified path + * + * @param { Path2D } path - Path to be cut. + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + clip(path: Path2D, fillRule?: CanvasFillRule): void; + + /** + * Fills existing paths according to the current fill style. + * + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Fills existing paths according to the current fill style. + * + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Fills existing paths according to the current fill style. + * + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Fills existing paths according to the current fill style. + * + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fill(fillRule?: CanvasFillRule): void; + + /** + * Fills the specified path according to the current fill style + * + * @param { Path2D } path - Path to be filled. + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Fills the specified path according to the current fill style + * + * @param { Path2D } path - Path to be filled. + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Fills the specified path according to the current fill style + * + * @param { Path2D } path - Path to be filled. + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Fills the specified path according to the current fill style + * + * @param { Path2D } path - Path to be filled. + * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fill(path: Path2D, fillRule?: CanvasFillRule): void; + + /** + * Draws an existing path according to the current stroke style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draws an existing path according to the current stroke style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draws an existing path according to the current stroke style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draws an existing path according to the current stroke style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stroke(): void; + + /** + * Draws the specified path according to the current stroke style + * + * @param { Path2D } path - Specified stroke path object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draws the specified path according to the current stroke style + * + * @param { Path2D } path - Specified stroke path object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draws the specified path according to the current stroke style + * + * @param { Path2D } path - Specified stroke path object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draws the specified path according to the current stroke style + * + * @param { Path2D } path - Specified stroke path object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stroke(path: Path2D): void; + + /** + * Attributes that describe the fill color and style. The options are as follows: + * color: Color String + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * + * @type { string | CanvasGradient | CanvasPattern } + * @default #000000 (black) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Attributes that describe the fill color and style. The options are as follows: + * color: Color String + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * + * @type { string | CanvasGradient | CanvasPattern } + * @default #000000 (black) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Attributes that describe the fill color and style. The options are as follows: + * + * @type { string | number | CanvasGradient | CanvasPattern } + * string: Color String. + * number: Indicates the color with number. + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * @default #000000 (black) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Attributes that describe the fill color and style. The options are as follows: + * + * @type { string | number | CanvasGradient | CanvasPattern } + * string: Color String. + * number: Indicates the color with number. + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * @default #000000 (black) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fillStyle: string | number | CanvasGradient | CanvasPattern; + + /** + * Attributes of the stroke color and style. The options are as follows: + * color: Color String + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * + * @type { string | CanvasGradient | CanvasPattern } + * @default #000000 (black) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Attributes of the stroke color and style. The options are as follows: + * color: Color String + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * + * @type { string | CanvasGradient | CanvasPattern } + * @default #000000 (black) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Attributes of the stroke color and style. The options are as follows: + * + * @type { string | number | CanvasGradient | CanvasPattern } + * string: Color String. + * number: Indicates the color with number. + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * @default #000000 (black) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Attributes of the stroke color and style. The options are as follows: + * + * @type { string | number | CanvasGradient | CanvasPattern } + * string: Color String. + * number: Indicates the color with number. + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * @default #000000 (black) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeStyle: string | number | CanvasGradient | CanvasPattern; + + /** + * Creates a linear gradient object that is specified along the parameter coordinates + * + * @param { number } x0 - The x-axis coordinate of the start point. + * @param { number } y0 - The y-axis coordinate of the start point. + * @param { number } x1 - x-axis coordinate of the end point. + * @param { number } y1 - y-axis coordinate of the end point. + * @returns { CanvasGradient } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Creates a linear gradient object that is specified along the parameter coordinates + * + * @param { number } x0 - The x-axis coordinate of the start point. + * @param { number } y0 - The y-axis coordinate of the start point. + * @param { number } x1 - x-axis coordinate of the end point. + * @param { number } y1 - y-axis coordinate of the end point. + * @returns { CanvasGradient } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Creates a linear gradient object that is specified along the parameter coordinates + * + * @param { number } x0 - The x-axis coordinate of the start point. + * @param { number } y0 - The y-axis coordinate of the start point. + * @param { number } x1 - x-axis coordinate of the end point. + * @param { number } y1 - y-axis coordinate of the end point. + * @returns { CanvasGradient } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a linear gradient object that is specified along the parameter coordinates + * + * @param { number } x0 - The x-axis coordinate of the start point. + * @param { number } y0 - The y-axis coordinate of the start point. + * @param { number } x1 - x-axis coordinate of the end point. + * @param { number } y1 - y-axis coordinate of the end point. + * @returns { CanvasGradient } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + + /** + * Creates a template object using the specified image + * + * @param { ImageBitmap } image - Objects as duplicate image sources + * @param { string | null } repetition - Specifies how to repeat images. The following four modes are supported: + * "repeat": Repeated images in both X and Y directions + * "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction + * "repeat-y": The image is repeated in the Y axis direction, and the image is not repeated in the X axis direction. + * "no-repeat": Non-repeating images in both X and Y directions + * @returns { CanvasPattern | null } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Creates a template object using the specified image + * + * @param { ImageBitmap } image - Objects as duplicate image sources + * @param { string | null } repetition - Specifies how to repeat images. The following four modes are supported: + * "repeat": Repeated images in both X and Y directions + * "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction + * "repeat-y": The image is repeated in the Y axis direction, and the image is not repeated in the X axis direction. + * "no-repeat": Non-repeating images in both X and Y directions + * @returns { CanvasPattern | null } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Creates a template object using the specified image + * + * @param { ImageBitmap } image - Objects as duplicate image sources + * @param { string | null } repetition - Specifies how to repeat images. The following four modes are supported: + * "repeat": Repeated images in both X and Y directions + * "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction + * "repeat-y": The image is repeated in the Y axis direction, and the image is not repeated in the X axis direction. + * "no-repeat": Non-repeating images in both X and Y directions + * "clamp": Replicate the edge color if the shader draws outside of its original bounds. + * "mirror": Repeat the shader's image horizontally and vertically, alternating mirror images so that adjacent images always seam. + * @returns { CanvasPattern | null } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a template object using the specified image + * + * @param { ImageBitmap } image - Objects as duplicate image sources + * @param { string | null } repetition - Specifies how to repeat images. The following four modes are supported: + * "repeat": Repeated images in both X and Y directions + * "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction + * "repeat-y": The image is repeated in the Y axis direction, and the image is not repeated in the X axis direction. + * "no-repeat": Non-repeating images in both X and Y directions + * "clamp": Replicate the edge color if the shader draws outside of its original bounds. + * "mirror": Repeat the shader's image horizontally and vertically, alternating mirror images so that adjacent images always seam. + * @returns { CanvasPattern | null } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + createPattern(image: ImageBitmap, repetition: string | null): CanvasPattern | null; + + /** + * Creates a radioactive gradient object based on parameters that determine the coordinates of two circles + * + * @param { number } x0 - The x-axis coordinate of the start circle. + * @param { number } y0 - The y-axis coordinate of the start circle. + * @param { number } r0 - Radius of the starting circle. + * @param { number } x1 - The x-axis coordinate of the end circle. + * @param { number } y1 - The y-axis coordinate of the end circle. + * @param { number } r1 - Radius of the end circle. + * @returns { CanvasGradient } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Creates a radioactive gradient object based on parameters that determine the coordinates of two circles + * + * @param { number } x0 - The x-axis coordinate of the start circle. + * @param { number } y0 - The y-axis coordinate of the start circle. + * @param { number } r0 - Radius of the starting circle. + * @param { number } x1 - The x-axis coordinate of the end circle. + * @param { number } y1 - The y-axis coordinate of the end circle. + * @param { number } r1 - Radius of the end circle. + * @returns { CanvasGradient } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Creates a radioactive gradient object based on parameters that determine the coordinates of two circles + * + * @param { number } x0 - The x-axis coordinate of the start circle. + * @param { number } y0 - The y-axis coordinate of the start circle. + * @param { number } r0 - Radius of the starting circle. + * @param { number } x1 - The x-axis coordinate of the end circle. + * @param { number } y1 - The y-axis coordinate of the end circle. + * @param { number } r1 - Radius of the end circle. + * @returns { CanvasGradient } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a radioactive gradient object based on parameters that determine the coordinates of two circles + * + * @param { number } x0 - The x-axis coordinate of the start circle. + * @param { number } y0 - The y-axis coordinate of the start circle. + * @param { number } r0 - Radius of the starting circle. + * @param { number } x1 - The x-axis coordinate of the end circle. + * @param { number } y1 - The y-axis coordinate of the end circle. + * @param { number } r1 - Radius of the end circle. + * @returns { CanvasGradient } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + + /** + * Creates a gradient around a point with given coordinates. + * + * @param { number } startAngle - The angle at which to begin the gradient, in radians. + * Angle measurements start horizontally the right of the center and move around clockwise. + * @param { number } x - The x-axis coordinate of the center of the gradient. + * @param { number } y - The y-axis coordinate of the center of the gradient. + * @returns { CanvasGradient } A CanvasGradient object that draws a conic gradient around the given coordinates. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Creates a gradient around a point with given coordinates. + * + * @param { number } startAngle - The angle at which to begin the gradient, in radians. + * Angle measurements start horizontally the right of the center and move around clockwise. + * @param { number } x - The x-axis coordinate of the center of the gradient. + * @param { number } y - The y-axis coordinate of the center of the gradient. + * @returns { CanvasGradient } A CanvasGradient object that draws a conic gradient around the given coordinates. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + createConicGradient( + startAngle: number, + x: number, + y: number + ): CanvasGradient; + + /** + * Provides filter effects such as blur and grayscale. You can set the following filter effects: + * blur(): Adds a Gaussian blur effect to the drawing + * brightness(): Provides a linear multiplication for the drawing and adjusts the brightness level. + * contrast(): Adjusts the contrast of the image. When the value is 0%, the image is completely black. + * When the value is 100%, there is no change in the image. + * grayscale(): Converts the image to a gray image. When the value is 100%, the image is completely gray. + * When the value is 0%, there is no change in the image. + * hue-rotate(): Perform color rotation on an image. When the value is 0 degrees, there is no change in the image. + * invert(): Inverted image (representing the effect of a photographic negative). When the value is 100%, + * the image is completely inverted. When the value is 0%, there is no change in the image. + * opacity(): Transparency of the image. At 0%, the image is completely transparent. + * When the value is 100%, there is no change in the image. + * saturate(): Perform saturation processing on the image. At 0%, the image is completely un-saturated. + * When the value is 100%, there is no change in the image. + * sepia(): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. + * When the value is 0%, there is no change in the image. + * none: Turn off filter effects + * + * @type { string } + * @default none + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Provides filter effects such as blur and grayscale. You can set the following filter effects: + * blur(): Adds a Gaussian blur effect to the drawing + * brightness(): Provides a linear multiplication for the drawing and adjusts the brightness level. + * contrast(): Adjusts the contrast of the image. When the value is 0%, the image is completely black. + * When the value is 100%, there is no change in the image. + * grayscale(): Converts the image to a gray image. When the value is 100%, the image is completely gray. + * When the value is 0%, there is no change in the image. + * hue-rotate(): Perform color rotation on an image. When the value is 0 degrees, there is no change in the image. + * invert(): Inverted image (representing the effect of a photographic negative). When the value is 100%, + * the image is completely inverted. When the value is 0%, there is no change in the image. + * opacity(): Transparency of the image. At 0%, the image is completely transparent. + * When the value is 100%, there is no change in the image. + * saturate(): Perform saturation processing on the image. At 0%, the image is completely un-saturated. + * When the value is 100%, there is no change in the image. + * sepia(): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. + * When the value is 0%, there is no change in the image. + * none: Turn off filter effects + * + * @type { string } + * @default none + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Provides filter effects such as blur and grayscale. You can set the following filter effects: + * blur(): Adds a Gaussian blur effect to the drawing + * brightness(): Provides a linear multiplication for the drawing and adjusts the brightness level. + * contrast(): Adjusts the contrast of the image. When the value is 0%, the image is completely black. + * When the value is 100%, there is no change in the image. + * grayscale(): Converts the image to a gray image. When the value is 100%, the image is completely gray. + * When the value is 0%, there is no change in the image. + * hue-rotate(): Perform color rotation on an image. When the value is 0 degrees, there is no change in the image. + * invert(): Inverted image (representing the effect of a photographic negative). When the value is 100%, + * the image is completely inverted. When the value is 0%, there is no change in the image. + * opacity(): Transparency of the image. At 0%, the image is completely transparent. + * When the value is 100%, there is no change in the image. + * saturate(): Perform saturation processing on the image. At 0%, the image is completely un-saturated. + * When the value is 100%, there is no change in the image. + * sepia(): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. + * When the value is 0%, there is no change in the image. + * none: Turn off filter effects + * + * @type { string } + * @default none + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Provides filter effects such as blur and grayscale. You can set the following filter effects: + * blur(): Adds a Gaussian blur effect to the drawing + * brightness(): Provides a linear multiplication for the drawing and adjusts the brightness level. + * contrast(): Adjusts the contrast of the image. When the value is 0%, the image is completely black. + * When the value is 100%, there is no change in the image. + * grayscale(): Converts the image to a gray image. When the value is 100%, the image is completely gray. + * When the value is 0%, there is no change in the image. + * hue-rotate(): Perform color rotation on an image. When the value is 0 degrees, there is no change in the image. + * invert(): Inverted image (representing the effect of a photographic negative). When the value is 100%, + * the image is completely inverted. When the value is 0%, there is no change in the image. + * opacity(): Transparency of the image. At 0%, the image is completely transparent. + * When the value is 100%, there is no change in the image. + * saturate(): Perform saturation processing on the image. At 0%, the image is completely un-saturated. + * When the value is 100%, there is no change in the image. + * sepia(): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. + * When the value is 0%, there is no change in the image. + * none: Turn off filter effects + * + * @type { string } + * @default none + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + filter: string; + + /** + * Creates a new, empty ImageData object of the specified size + * + * @param { number } sw - Width of the ImageData object. + * @param { number } sh - Height of the ImageData object. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Creates a new, empty ImageData object of the specified size + * + * @param { number } sw - Width of the ImageData object. + * @param { number } sh - Height of the ImageData object. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Creates a new, empty ImageData object of the specified size + * + * @param { number } sw - Width of the ImageData object. + * @param { number } sh - Height of the ImageData object. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a new, empty ImageData object of the specified size + * + * @param { number } sw - Width of the ImageData object. + * @param { number } sh - Height of the ImageData object. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + createImageData(sw: number, sh: number): ImageData; + + /** + * From an existing ImageData object, copy an object with the same width and height as the image. + * The image content is not copied. + * + * @param { ImageData } imagedata - ImageData object to be copied. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * From an existing ImageData object, copy an object with the same width and height as the image. + * The image content is not copied. + * + * @param { ImageData } imagedata - ImageData object to be copied. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * From an existing ImageData object, copy an object with the same width and height as the image. + * The image content is not copied. + * + * @param { ImageData } imagedata - ImageData object to be copied. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * From an existing ImageData object, copy an object with the same width and height as the image. + * The image content is not copied. + * + * @param { ImageData } imagedata - ImageData object to be copied. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + createImageData(imagedata: ImageData): ImageData; + + /** + * Obtains the pixel data of a specified area on the current canvas. + * + * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the image data to be extracted. + * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the image data to be extracted. + * @param { number } sw - The width of the rectangular area of the image data to be extracted. + * @param { number } sh - The height of the rectangular area of the image data to be extracted. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Obtains the pixel data of a specified area on the current canvas. + * + * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the image data to be extracted. + * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the image data to be extracted. + * @param { number } sw - The width of the rectangular area of the image data to be extracted. + * @param { number } sh - The height of the rectangular area of the image data to be extracted. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Obtains the pixel data of a specified area on the current canvas. + * + * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the image data to be extracted. + * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the image data to be extracted. + * @param { number } sw - The width of the rectangular area of the image data to be extracted. + * @param { number } sh - The height of the rectangular area of the image data to be extracted. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Obtains the pixel data of a specified area on the current canvas. + * + * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the image data to be extracted. + * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the image data to be extracted. + * @param { number } sw - The width of the rectangular area of the image data to be extracted. + * @param { number } sh - The height of the rectangular area of the image data to be extracted. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + + /** + * Obtains the PixelMap of a specified area on the current canvas. + * + * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. + * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. + * @param { number } sw - The width of the rectangular area of the PixelMap to be extracted. + * @param { number } sh - The height of the rectangular area of the PixelMap to be extracted. + * @returns { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Obtains the PixelMap of a specified area on the current canvas. + * + * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. + * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. + * @param { number } sw - The width of the rectangular area of the PixelMap to be extracted. + * @param { number } sh - The height of the rectangular area of the PixelMap to be extracted. + * @returns { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Obtains the PixelMap of a specified area on the current canvas. + * + * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. + * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. + * @param { number } sw - The width of the rectangular area of the PixelMap to be extracted. + * @param { number } sh - The height of the rectangular area of the PixelMap to be extracted. + * @returns { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getPixelMap(sx: number, sy: number, sw: number, sh: number): PixelMap; + + /** + * Draws the specified ImageData object onto the canvas + * + * @param { ImageData } imagedata - ImageData object to be drawn. + * @param { number } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). + * @param { number } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draws the specified ImageData object onto the canvas + * + * @param { ImageData } imagedata - ImageData object to be drawn. + * @param { number } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). + * @param { number } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draws the specified ImageData object onto the canvas + * + * @param { ImageData } imagedata - ImageData object to be drawn. + * @param { number | string } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). + * @param { number | string } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draws the specified ImageData object onto the canvas + * + * @param { ImageData } imagedata - ImageData object to be drawn. + * @param { number | string } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). + * @param { number | string } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + putImageData(imagedata: ImageData, dx: number | string, dy: number | string): void; + + /** + * Draws the specified ImageData object onto the canvas + * + * @param { ImageData } imagedata - ImageData object to be drawn. + * @param { number } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). + * @param { number } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). + * @param { number } dirtyX - Position of the upper left corner of the rectangular area in the source image data. + * The default is the upper left corner (x coordinate) of the entire image data. + * @param { number } dirtyY - Position of the upper left corner of the rectangular area in the source image data. + * The default is the upper left corner (y coordinate) of the entire image data. + * @param { number } dirtyWidth - Width of the rectangular area in the source image data. + * The default is the width of the image data. + * @param { number } dirtyHeight - Height of the rectangular area in the source image data. + * The default is the height of the image data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Draws the specified ImageData object onto the canvas + * + * @param { ImageData } imagedata - ImageData object to be drawn. + * @param { number } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). + * @param { number } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). + * @param { number } dirtyX - Position of the upper left corner of the rectangular area in the source image data. + * The default is the upper left corner (x coordinate) of the entire image data. + * @param { number } dirtyY - Position of the upper left corner of the rectangular area in the source image data. + * The default is the upper left corner (y coordinate) of the entire image data. + * @param { number } dirtyWidth - Width of the rectangular area in the source image data. + * The default is the width of the image data. + * @param { number } dirtyHeight - Height of the rectangular area in the source image data. + * The default is the height of the image data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draws the specified ImageData object onto the canvas + * + * @param { ImageData } imagedata - ImageData object to be drawn. + * @param { number | string } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). + * @param { number | string } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). + * @param { number | string } dirtyX - Position of the upper left corner of the rectangular area in the source image data. + * The default is the upper left corner (x coordinate) of the entire image data. + * @param { number | string } dirtyY - Position of the upper left corner of the rectangular area in the source image data. + * The default is the upper left corner (y coordinate) of the entire image data. + * @param { number | string } dirtyWidth - Width of the rectangular area in the source image data. + * The default is the width of the image data. + * @param { number | string } dirtyHeight - Height of the rectangular area in the source image data. + * The default is the height of the image data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draws the specified ImageData object onto the canvas + * + * @param { ImageData } imagedata - ImageData object to be drawn. + * @param { number | string } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). + * @param { number | string } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). + * @param { number | string } dirtyX - Position of the upper left corner of the rectangular area in the source image data. + * The default is the upper left corner (x coordinate) of the entire image data. + * @param { number | string } dirtyY - Position of the upper left corner of the rectangular area in the source image data. + * The default is the upper left corner (y coordinate) of the entire image data. + * @param { number | string } dirtyWidth - Width of the rectangular area in the source image data. + * The default is the width of the image data. + * @param { number | string } dirtyHeight - Height of the rectangular area in the source image data. + * The default is the height of the image data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + putImageData( + imagedata: ImageData, + dx: number | string, + dy: number | string, + dirtyX: number | string, + dirtyY: number | string, + dirtyWidth: number | string, + dirtyHeight: number | string + ): void; + + /** + * Specifies whether to smooth the image. The value true indicates that the image is smooth. + * The value false indicates that the image is not smooth. + * + * @type { boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Specifies whether to smooth the image. The value true indicates that the image is smooth. + * The value false indicates that the image is not smooth. + * + * @type { boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies whether to smooth the image. The value true indicates that the image is smooth. + * The value false indicates that the image is not smooth. + * + * @type { boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies whether to smooth the image. The value true indicates that the image is smooth. + * The value false indicates that the image is not smooth. + * + * @type { boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + imageSmoothingEnabled: boolean; + + /** + * Smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. + * + * @type { ImageSmoothingQuality } + * @default low + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. + * + * @type { ImageSmoothingQuality } + * @default low + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. + * + * @type { ImageSmoothingQuality } + * @default low + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. + * + * @type { ImageSmoothingQuality } + * @default low + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + imageSmoothingQuality: ImageSmoothingQuality; + + /** + * Line segment endpoint attribute. For details, see {@link CanvasLineCap}. + * + * @type { CanvasLineCap } + * @default butt + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Line segment endpoint attribute. For details, see {@link CanvasLineCap}. + * + * @type { CanvasLineCap } + * @default butt + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Line segment endpoint attribute. For details, see {@link CanvasLineCap}. + * + * @type { CanvasLineCap } + * @default butt + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Line segment endpoint attribute. For details, see {@link CanvasLineCap}. + * + * @type { CanvasLineCap } + * @default butt + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lineCap: CanvasLineCap; + + /** + * Dotted line offset attribute. + * + * @type { number } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Dotted line offset attribute. + * + * @type { number } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Dotted line offset attribute. + * + * @type { number } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Dotted line offset attribute. + * + * @type { number } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lineDashOffset: number; + + /** + * Line segment connection point attribute. For details, see {@link CanvasLineJoin}. + * + * @type { CanvasLineJoin } + * @default miter + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Line segment connection point attribute. For details, see {@link CanvasLineJoin}. + * + * @type { CanvasLineJoin } + * @default miter + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Line segment connection point attribute. For details, see {@link CanvasLineJoin}. + * + * @type { CanvasLineJoin } + * @default miter + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Line segment connection point attribute. For details, see {@link CanvasLineJoin}. + * + * @type { CanvasLineJoin } + * @default miter + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lineJoin: CanvasLineJoin; + + /** + * Line thickness attribute. The value cannot be 0 or a negative number. + * + * @type { number } + * @default 1(px) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Line thickness attribute. The value cannot be 0 or a negative number. + * + * @type { number } + * @default 1(px) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Line thickness attribute. The value cannot be 0 or a negative number. + * + * @type { number } + * @default 1(px) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Line thickness attribute. The value cannot be 0 or a negative number. + * + * @type { number } + * @default 1(px) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lineWidth: number; + + /** + * The value of this parameter cannot be 0 or a negative number. + * + * @type { number } + * @default 10(px) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The value of this parameter cannot be 0 or a negative number. + * + * @type { number } + * @default 10(px) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The value of this parameter cannot be 0 or a negative number. + * + * @type { number } + * @default 10(px) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The value of this parameter cannot be 0 or a negative number. + * + * @type { number } + * @default 10(px) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + miterLimit: number; + + /** + * Gets the current segment style. + * + * @returns { number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Gets the current segment style. + * + * @returns { number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Gets the current segment style. + * + * @returns { number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Gets the current segment style. + * + * @returns { number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + getLineDash(): number[]; + + /** + * Sets the dashed line mode for line drawing. + * + * @param { number[] } segments - A set of numbers that describe the length of alternating drawn lines segments and + * spacing (coordinate space units). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the dashed line mode for line drawing. + * + * @param { number[] } segments - A set of numbers that describe the length of alternating drawn lines segments and + * spacing (coordinate space units). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the dashed line mode for line drawing. + * + * @param { number[] } segments - A set of numbers that describe the length of alternating drawn lines segments and + * spacing (coordinate space units). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the dashed line mode for line drawing. + * + * @param { number[] } segments - A set of numbers that describe the length of alternating drawn lines segments and + * spacing (coordinate space units). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + setLineDash(segments: number[]): void; + + /** + * Clears the drawing content of a rectangular area. + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Clears the drawing content of a rectangular area. + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Clears the drawing content of a rectangular area. + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Clears the drawing content of a rectangular area. + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + clearRect(x: number, y: number, w: number, h: number): void; + + /** + * Fills a specified rectangular area + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Fills a specified rectangular area + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Fills a specified rectangular area + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Fills a specified rectangular area + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fillRect(x: number, y: number, w: number, h: number): void; + + /** + * Stroke Specify Rectangular Area + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Stroke Specify Rectangular Area + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Stroke Specify Rectangular Area + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Stroke Specify Rectangular Area + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeRect(x: number, y: number, w: number, h: number): void; + + /** + * Shadow blur radius. The value cannot be a negative number. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Shadow blur radius. The value cannot be a negative number. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Shadow blur radius. The value cannot be a negative number. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Shadow blur radius. The value cannot be a negative number. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + shadowBlur: number; + + /** + * Shadow color. + * + * @type { string } + * @default transparent black + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Shadow color. + * + * @type { string } + * @default transparent black + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Shadow color. + * + * @type { string } + * @default transparent black + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Shadow color. + * + * @type { string } + * @default transparent black + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + shadowColor: string; + + /** + * Horizontal offset distance of the shadow. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Horizontal offset distance of the shadow. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Horizontal offset distance of the shadow. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Horizontal offset distance of the shadow. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + shadowOffsetX: number; + + /** + * Vertical offset distance of the shadow. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Vertical offset distance of the shadow. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Vertical offset distance of the shadow. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Vertical offset distance of the shadow. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + shadowOffsetY: number; + + /** + * Top of the stack pop-up state in the drawing state stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Top of the stack pop-up state in the drawing state stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Top of the stack pop-up state in the drawing state stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top of the stack pop-up state in the drawing state stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + restore(): void; + + /** + * Saves the current drawing state to the drawing state stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Saves the current drawing state to the drawing state stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Saves the current drawing state to the drawing state stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Saves the current drawing state to the drawing state stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + save(): void; + + /** + * Fills the specified text at the specified location + * + * @param { string } text - Text string to be drawn. + * @param { number } x - The x-axis coordinate of the start point of the text. + * @param { number } y - The y-axis coordinate of the start point of the text. + * @param { number } maxWidth - Maximum width of the drawing. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Fills the specified text at the specified location + * + * @param { string } text - Text string to be drawn. + * @param { number } x - The x-axis coordinate of the start point of the text. + * @param { number } y - The y-axis coordinate of the start point of the text. + * @param { number } maxWidth - Maximum width of the drawing. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Fills the specified text at the specified location + * + * @param { string } text - Text string to be drawn. + * @param { number } x - The x-axis coordinate of the start point of the text. + * @param { number } y - The y-axis coordinate of the start point of the text. + * @param { number } maxWidth - Maximum width of the drawing. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Fills the specified text at the specified location + * + * @param { string } text - Text string to be drawn. + * @param { number } x - The x-axis coordinate of the start point of the text. + * @param { number } y - The y-axis coordinate of the start point of the text. + * @param { number } maxWidth - Maximum width of the drawing. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fillText(text: string, x: number, y: number, maxWidth?: number): void; + + /** + * Measure the size of a specified text. For details about the return value, see {@link TextMetrics}. + * + * @param { string } text - Text string to be measured. + * @returns { TextMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Measure the size of a specified text. For details about the return value, see {@link TextMetrics}. + * + * @param { string } text - Text string to be measured. + * @returns { TextMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Measure the size of a specified text. For details about the return value, see {@link TextMetrics}. + * + * @param { string } text - Text string to be measured. + * @returns { TextMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Measure the size of a specified text. For details about the return value, see {@link TextMetrics}. + * + * @param { string } text - Text string to be measured. + * @returns { TextMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + measureText(text: string): TextMetrics; + + /** + * Stroke specified text at specified position + * + * @param { string } text - Text string to be stroked. + * @param { number } x - The x-axis coordinate of the start point of the text. + * @param { number } y - The y-axis-axis coordinate of the start point of the text. + * @param { number } maxWidth - Maximum width of the stroke. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Stroke specified text at specified position + * + * @param { string } text - Text string to be stroked. + * @param { number } x - The x-axis coordinate of the start point of the text. + * @param { number } y - The y-axis-axis coordinate of the start point of the text. + * @param { number } maxWidth - Maximum width of the stroke. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Stroke specified text at specified position + * + * @param { string } text - Text string to be stroked. + * @param { number } x - The x-axis coordinate of the start point of the text. + * @param { number } y - The y-axis-axis coordinate of the start point of the text. + * @param { number } maxWidth - Maximum width of the stroke. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Stroke specified text at specified position + * + * @param { string } text - Text string to be stroked. + * @param { number } x - The x-axis coordinate of the start point of the text. + * @param { number } y - The y-axis-axis coordinate of the start point of the text. + * @param { number } maxWidth - Maximum width of the stroke. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + + /** + * Text drawing direction. For details, see {@link CanvasDirection}. + * + * @type { CanvasDirection } + * @default inherit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text drawing direction. For details, see {@link CanvasDirection}. + * + * @type { CanvasDirection } + * @default inherit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text drawing direction. For details, see {@link CanvasDirection}. + * + * @type { CanvasDirection } + * @default inherit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text drawing direction. For details, see {@link CanvasDirection}. + * + * @type { CanvasDirection } + * @default inherit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + direction: CanvasDirection; + + /** + * Font style. + * + * @type { string } + * @default normal normal 14px sans-serif + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Font style. + * + * @type { string } + * @default normal normal 14px sans-serif + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Font style. + * + * @type { string } + * @default normal normal 14px sans-serif + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Font style. + * + * @type { string } + * @default normal normal 14px sans-serif + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + font: string; + + /** + * Text alignment mode. For details, see {@link CanvasTextAlign}. + * + * @type { CanvasTextAlign } + * @default start + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text alignment mode. For details, see {@link CanvasTextAlign}. + * + * @type { CanvasTextAlign } + * @default start + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text alignment mode. For details, see {@link CanvasTextAlign}. + * + * @type { CanvasTextAlign } + * @default start + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text alignment mode. For details, see {@link CanvasTextAlign}. + * + * @type { CanvasTextAlign } + * @default start + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + textAlign: CanvasTextAlign; + + /** + * Text baseline. For details, see {@link CanvasTextBaseline}. + * + * @type { CanvasTextBaseline } + * @default alphabetic + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text baseline. For details, see {@link CanvasTextBaseline}. + * + * @type { CanvasTextBaseline } + * @default alphabetic + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text baseline. For details, see {@link CanvasTextBaseline}. + * + * @type { CanvasTextBaseline } + * @default alphabetic + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text baseline. For details, see {@link CanvasTextBaseline}. + * + * @type { CanvasTextBaseline } + * @default alphabetic + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + textBaseline: CanvasTextBaseline; + + /** + * Obtains the currently applied transformation matrix. + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Obtains the currently applied transformation matrix. + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Obtains the currently applied transformation matrix. + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Obtains the currently applied transformation matrix. + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + getTransform(): Matrix2D; + + /** + * Resets the current transformation matrix using the identity matrix + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Resets the current transformation matrix using the identity matrix + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Resets the current transformation matrix using the identity matrix + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Resets the current transformation matrix using the identity matrix + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + resetTransform(): void; + + /** + * Adds the effect of a rotation + * + * @param { number } angle - The radian of clockwise rotation, which can be converted to an angle value using the formula: + * degree * Math.PI / 180 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Adds the effect of a rotation + * + * @param { number } angle - The radian of clockwise rotation, which can be converted to an angle value using the formula: + * degree * Math.PI / 180 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the effect of a rotation + * + * @param { number } angle - The radian of clockwise rotation, which can be converted to an angle value using the formula: + * degree * Math.PI / 180 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the effect of a rotation + * + * @param { number } angle - The radian of clockwise rotation, which can be converted to an angle value using the formula: + * degree * Math.PI / 180 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + rotate(angle: number): void; + + /** + * Increases the scaling effect of the X and Y axes. + * + * @param { number } x - Horizontal scaling factor + * @param { number } y - Vertical scaling factor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Increases the scaling effect of the X and Y axes. + * + * @param { number } x - Horizontal scaling factor + * @param { number } y - Vertical scaling factor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Increases the scaling effect of the X and Y axes. + * + * @param { number } x - Horizontal scaling factor + * @param { number } y - Vertical scaling factor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Increases the scaling effect of the X and Y axes. + * + * @param { number } x - Horizontal scaling factor + * @param { number } y - Vertical scaling factor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scale(x: number, y: number): void; + + /** + * Adds 2D transformation effects, including rotation, translation, and scaling. + * The current transformation matrix will not be overwritten. Multiple transformations will be superimposed. + * + * @param { number } a - Horizontal Zoom + * @param { number } b - Vertical Tilt + * @param { number } c - Horizontal Tilt + * @param { number } d - Vertical Zoom + * @param { number } e - Horizontal movement + * @param { number } f - Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Adds 2D transformation effects, including rotation, translation, and scaling. + * The current transformation matrix will not be overwritten. Multiple transformations will be superimposed. + * + * @param { number } a - Horizontal Zoom + * @param { number } b - Vertical Tilt + * @param { number } c - Horizontal Tilt + * @param { number } d - Vertical Zoom + * @param { number } e - Horizontal movement + * @param { number } f - Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds 2D transformation effects, including rotation, translation, and scaling. + * The current transformation matrix will not be overwritten. Multiple transformations will be superimposed. + * + * @param { number } a - Horizontal Zoom + * @param { number } b - Vertical Tilt + * @param { number } c - Horizontal Tilt + * @param { number } d - Vertical Zoom + * @param { number } e - Horizontal movement + * @param { number } f - Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds 2D transformation effects, including rotation, translation, and scaling. + * The current transformation matrix will not be overwritten. Multiple transformations will be superimposed. + * + * @param { number } a - Horizontal Zoom + * @param { number } b - Vertical Tilt + * @param { number } c - Horizontal Tilt + * @param { number } d - Vertical Zoom + * @param { number } e - Horizontal movement + * @param { number } f - Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; + + /** + * The 2D transformation effect is added. The current transformation matrix is not overwritten and + * the transformations are superimposed for multiple times. + * + * @param { Matrix2D } transform - 2D transformation matrix. For details, see {@link Matrix2D}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The 2D transformation effect is added. The current transformation matrix is not overwritten and + * the transformations are superimposed for multiple times. + * + * @param { Matrix2D } transform - 2D transformation matrix. For details, see {@link Matrix2D}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The 2D transformation effect is added. The current transformation matrix is not overwritten and + * the transformations are superimposed for multiple times. + * + * @param { Matrix2D } transform - 2D transformation matrix. For details, see {@link Matrix2D}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The 2D transformation effect is added. The current transformation matrix is not overwritten and + * the transformations are superimposed for multiple times. + * + * @param { Matrix2D } transform - 2D transformation matrix. For details, see {@link Matrix2D}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + setTransform(transform?: Matrix2D): void; + + /** + * Adds the 2D transformation effect, including rotation, translation, and scaling, + * and overwrites the current transformation matrix. + * + * @param { number } a - Horizontal Zoom + * @param { number } b - Vertical Tilt + * @param { number } c - Horizontal Tilt + * @param { number } d - Vertical Zoom + * @param { number } e - Horizontal movement + * @param { number } f - Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Adds the 2D transformation effect, including rotation, translation, and scaling, + * and overwrites the current transformation matrix. + * + * @param { number } a - Horizontal Zoom + * @param { number } b - Vertical Tilt + * @param { number } c - Horizontal Tilt + * @param { number } d - Vertical Zoom + * @param { number } e - Horizontal movement + * @param { number } f - Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the 2D transformation effect, including rotation, translation, and scaling, + * and overwrites the current transformation matrix. + * + * @param { number } a - Horizontal Zoom + * @param { number } b - Vertical Tilt + * @param { number } c - Horizontal Tilt + * @param { number } d - Vertical Zoom + * @param { number } e - Horizontal movement + * @param { number } f - Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the 2D transformation effect, including rotation, translation, and scaling, + * and overwrites the current transformation matrix. + * + * @param { number } a - Horizontal Zoom + * @param { number } b - Vertical Tilt + * @param { number } c - Horizontal Tilt + * @param { number } d - Vertical Zoom + * @param { number } e - Horizontal movement + * @param { number } f - Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + transform(a: number, b: number, c: number, d: number, e: number, f: number): void; + + /** + * Increases the translation effect of the X and Y axes + * + * @param { number } x - Horizontal movement distance + * @param { number } y - Vertical travel distance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Increases the translation effect of the X and Y axes + * + * @param { number } x - Horizontal movement distance + * @param { number } y - Vertical travel distance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Increases the translation effect of the X and Y axes + * + * @param { number } x - Horizontal movement distance + * @param { number } y - Vertical travel distance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Increases the translation effect of the X and Y axes + * + * @param { number } x - Horizontal movement distance + * @param { number } y - Vertical travel distance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + translate(x: number, y: number): void; + + /** + * Set a PixelMap to the current context. The drawing content is synchronized to the PixelMap. + * + * @param { PixelMap } value - PixelMap object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set a PixelMap to the current context. The drawing content is synchronized to the PixelMap. + * + * @param { PixelMap } value - PixelMap object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set a PixelMap to the current context. The drawing content is synchronized to the PixelMap. + * + * @param { PixelMap } value - PixelMap object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setPixelMap(value?: PixelMap): void; + + /** + * transfer ImageBitmap to content. + * + * @param { ImageBitmap } bitmap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * transfer ImageBitmap to content. + * + * @param { ImageBitmap } bitmap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * transfer ImageBitmap to content. + * + * @param { ImageBitmap } bitmap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * transfer ImageBitmap to content. + * + * @param { ImageBitmap } bitmap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + transferFromImageBitmap(bitmap: ImageBitmap): void; + + /** + * Allocate a layer for subsequent drawing. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + saveLayer(): void; + + /** + * Remove changes to transform and clip since saveLayer was last called and draw the layer on canvas. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + restoreLayer(): void; + + /** + * Clear the backing buffer, drawing state stack, any defined paths, and styles. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reset(): void; +} + +/** + * Draw context object for the Canvas component. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Draw context object for the Canvas component. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Draw context object for the Canvas component. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Draw context object for the Canvas component. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CanvasRenderingContext2D extends CanvasRenderer { + /** + * The default value is 0, which is bound to the height of the specified canvas. The value is read-only. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The default value is 0, which is bound to the height of the specified canvas. The value is read-only. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The default value is 0, which is bound to the height of the specified canvas. The value is read-only. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The default value is 0, which is bound to the height of the specified canvas. The value is read-only. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly height: number; + + /** + * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly width: number; + + /** + * Frame node of the canvas. The default value is null. + * + * @type { FrameNode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + readonly canvas: FrameNode; + + /** + * Generate a character string in the data url format. + * + * @param { string } type - Image format. The default value is image/png. + * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. + * If the value is out of the range, the default value 0.92 is used. + * @returns { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Generate a character string in the data url format. + * + * @param { string } type - Image format. The default value is image/png. + * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. + * If the value is out of the range, the default value 0.92 is used. + * @returns { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Generate a character string in the data url format. + * + * @param { string } type - Image format. The default value is image/png. + * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. + * If the value is out of the range, the default value 0.92 is used. + * @returns { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Generate a character string in the data url format. + * + * @param { string } type - Image format. The default value is image/png. + * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. + * If the value is out of the range, the default value 0.92 is used. + * @returns { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + toDataURL(type?: string, quality?: any): string; + + /** + * Start image analyzer. + * + * @param { ImageAnalyzerConfig } config - Image analyzer config. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 110001 - Image analysis feature is not supported. + * @throws { BusinessError } 110002 - Image analysis is currently being executed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + startImageAnalyzer(config: ImageAnalyzerConfig): Promise; + + /** + * Stop image analyzer. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + stopImageAnalyzer(): void; + + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(settings?: RenderingContextSettings); + + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(settings?: RenderingContextSettings, unit?: LengthMetricsUnit); + + /** + * Register the listener that watches if the canvasrenderingcontext2d attached to the Canvas frameNode. + * + * @param { 'onAttach' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + on(type: 'onAttach', callback: Callback): void; + + /** + * Unregister the listener that watches if the canvasrenderingcontext2d attached to the Canvas frameNode. + * + * @param { 'onAttach' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + off(type: 'onAttach', callback?: Callback): void; + + /** + * Register the listener that watches if the canvasrenderingcontext2d detached from the Canvas frameNode. + * + * @param { 'onDetach' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + on(type: 'onDetach', callback: Callback): void; + + /** + * Unregister the listener that watches if the canvasrenderingcontext2d detached from the Canvas frameNode. + * + * @param { 'onDetach' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + off(type: 'onDetach', callback?: Callback): void; +} + +/** + * Draw context object for the OffscreenCanvas component. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Draw context object for the OffscreenCanvas component. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Draw context object for the OffscreenCanvas component. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Draw context object for the OffscreenCanvas component. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class OffscreenCanvasRenderingContext2D extends CanvasRenderer { + /** + * Generate a character string in the data url format. + * + * @param { string } type - Image format. The default value is image/png. + * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. + * If the value is out of the range, the default value 0.92 is used. + * @returns { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Generate a character string in the data url format. + * + * @param { string } type - Image format. The default value is image/png. + * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. + * If the value is out of the range, the default value 0.92 is used. + * @returns { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Generate a character string in the data url format. + * + * @param { string } type - Image format. The default value is image/png. + * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. + * If the value is out of the range, the default value 0.92 is used. + * @returns { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Generate a character string in the data url format. + * + * @param { string } type - Image format. The default value is image/png. + * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. + * If the value is out of the range, the default value 0.92 is used. + * @returns { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + toDataURL(type?: string, quality?: any): string; + + /** + * transfer the content to ImageBitmap + * + * @returns { ImageBitmap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * transfer the content to ImageBitmap + * + * @returns { ImageBitmap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * transfer the content to ImageBitmap + * + * @returns { ImageBitmap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * transfer the content to ImageBitmap + * + * @returns { ImageBitmap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + transferToImageBitmap(): ImageBitmap; + + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { number } width - the width of the OffscreenCanvas + * @param { number } height - the height of the OffscreenCanvas + * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { number } width - the width of the OffscreenCanvas + * @param { number } height - the height of the OffscreenCanvas + * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { number } width - the width of the OffscreenCanvas + * @param { number } height - the height of the OffscreenCanvas + * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { number } width - the width of the OffscreenCanvas + * @param { number } height - the height of the OffscreenCanvas + * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(width: number, height: number, settings?: RenderingContextSettings); + + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { number } width - the width of the OffscreenCanvas + * @param { number } height - the height of the OffscreenCanvas + * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(width: number, height: number, settings?: RenderingContextSettings, unit?: LengthMetricsUnit); +} + +/** + * Draw an object off the screen. The drawing content is not directly displayed on the screen. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Draw an object off the screen. The drawing content is not directly displayed on the screen. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Draw an object off the screen. The drawing content is not directly displayed on the screen. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Draw an object off the screen. The drawing content is not directly displayed on the screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class OffscreenCanvas { + /** + * Height of the off-screen canvas. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Height of the off-screen canvas. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Height of the off-screen canvas. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Height of the off-screen canvas. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height: number; + + /** + * Width of the off-screen canvas. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Width of the off-screen canvas. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Width of the off-screen canvas. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Width of the off-screen canvas. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width: number; + + /** + * Exports rendered content as an ImageBitmap object + * + * @returns { ImageBitmap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Exports rendered content as an ImageBitmap object + * + * @returns { ImageBitmap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Exports rendered content as an ImageBitmap object + * + * @returns { ImageBitmap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Exports rendered content as an ImageBitmap object + * + * @returns { ImageBitmap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + transferToImageBitmap(): ImageBitmap; + + /** + * Creates the context from the current OffscreenCanvas. + * + * @param { "2d" } contextType - The context type, only "2d" be supported now. + * "2d": Creates a {@link OffscreenCanvasRenderingContext2D} object representing a two-dimensional rendering context. + * @param { RenderingContextSettings } options - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @returns { OffscreenCanvasRenderingContext2D } The rendering context of offscreen canvas, see {@link OffscreenCanvasRenderingContext2D}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Creates the context from the current OffscreenCanvas. + * + * @param { "2d" } contextType - The context type, only "2d" be supported now. + * "2d": Creates a {@link OffscreenCanvasRenderingContext2D} object representing a two-dimensional rendering context. + * @param { RenderingContextSettings } options - Drawing attribute. For details, see {@link RenderingContextSettings}. + * @returns { OffscreenCanvasRenderingContext2D } The rendering context of offscreen canvas, see {@link OffscreenCanvasRenderingContext2D}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getContext(contextType: "2d", options?: RenderingContextSettings): OffscreenCanvasRenderingContext2D; + + /** + * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. + * + * @param { number } width - Width of the off-screen canvas. + * @param { number } height - Height of the off-screen canvas. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. + * + * @param { number } width - Width of the off-screen canvas. + * @param { number } height - Height of the off-screen canvas. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. + * + * @param { number } width - Width of the off-screen canvas. + * @param { number } height - Height of the off-screen canvas. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. + * + * @param { number } width - Width of the off-screen canvas. + * @param { number } height - Height of the off-screen canvas. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(width: number, height: number); + + /** + * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. + * + * @param { number } width - Width of the off-screen canvas. + * @param { number } height - Height of the off-screen canvas. + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(width: number, height: number, unit: LengthMetricsUnit); +} + +/** + * Size info. + * + * @interface Size + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface Size { + /** + * Defines the width property. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width: number; + + /** + * Defines the height property. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + height: number; +} + +/** + * Defines DrawingRenderingContext. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class DrawingRenderingContext { + + /** + * Get size of the DrawingRenderingContext. + * + * @returns { Size } The size of the DrawingRenderingContext. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + get size(): Size; + + /** + * Get canvas of the DrawingRenderingContext. + * + * @returns { DrawingCanvas } The canvas of the DrawingRenderingContext. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + get canvas(): DrawingCanvas; + + /** + * Invalidate the component, which will cause a re-render of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + invalidate(): void; + + /** + * Create DrawingRenderingContext with setting LengthMetricsUnit. + * + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(unit?: LengthMetricsUnit); +} + +/** + *TextTimer component, which provides the text timer capability. + * + * @interface CanvasInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + *TextTimer component, which provides the text timer capability. + * + * @interface CanvasInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + *TextTimer component, which provides the text timer capability. + * + * @interface CanvasInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + *TextTimer component, which provides the text timer capability. + * + * @interface CanvasInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface CanvasInterface { + /** + * Construct a canvas component. + * + * @param { CanvasRenderingContext2D } context - Canvas context object. For details, see {@link CanvasRenderingContext2D}. + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Construct a canvas component. + * + * @param { CanvasRenderingContext2D } context - Canvas context object. For details, see {@link CanvasRenderingContext2D}. + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Construct a canvas component. + * + * @param { CanvasRenderingContext2D } context - Canvas context object. For details, see {@link CanvasRenderingContext2D}. + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Construct a canvas component. + * + * @param { CanvasRenderingContext2D } context - Canvas context object. For details, see {@link CanvasRenderingContext2D}. + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Construct a canvas component. + * + * @param { CanvasRenderingContext2D | DrawingRenderingContext } context - Canvas context object. + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + (context?: CanvasRenderingContext2D | DrawingRenderingContext): CanvasAttribute; + + /** + * Construct a canvas component. + * + * @param { CanvasRenderingContext2D | DrawingRenderingContext } context - Canvas context object. + * @param { ImageAIOptions } imageAIOptions + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + (context: CanvasRenderingContext2D | DrawingRenderingContext, imageAIOptions: ImageAIOptions): CanvasAttribute; +} + +/** + * Provides attribute for Canvas. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides attribute for Canvas. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides attribute for Canvas. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides attribute for Canvas. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CanvasAttribute extends CommonMethod { + /** + * Event notification after the canvas component is constructed. You can draw the canvas at this time. + * + * @param { function } event + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Event notification after the canvas component is constructed. You can draw the canvas at this time. + * + * @param { function } event + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Event notification after the canvas component is constructed. You can draw the canvas at this time. + * + * @param { function } event + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Event notification after the canvas component is constructed. You can draw the canvas at this time. + * + * @param { function } event + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Event notification after the canvas component is constructed. You can draw the canvas at this time. + * + * @param { VoidCallback } event + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onReady(event: VoidCallback): CanvasAttribute; + + /** + * Enable image analyzer for Canvas. + * + * @param { boolean } enable - If enable image analyzer for Canvas. The default value is false. + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableAnalyzer(enable: boolean): CanvasAttribute; +} + +/** + * Defines Canvas Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Canvas Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Canvas Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Canvas Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Canvas: CanvasInterface; + +/** + * Defines Canvas Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Canvas Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Canvas Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Canvas Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const CanvasInstance: CanvasAttribute; diff --git a/tests/arkts-sdk/ets/checkbox.d.ts b/tests/arkts-sdk/ets/checkbox.d.ts new file mode 100644 index 00000000..e2c53442 --- /dev/null +++ b/tests/arkts-sdk/ets/checkbox.d.ts @@ -0,0 +1,583 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the options of Checkbox. + * + * @interface CheckboxOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the options of Checkbox. + * + * @interface CheckboxOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of Checkbox. + * + * @interface CheckboxOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of Checkbox. + * + * @interface CheckboxOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface CheckboxOptions { + /** + * Current name of Checkbox. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Current name of Checkbox. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Current name of Checkbox. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Current name of Checkbox. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + name?: string; + + /** + * Sets the group of Checkbox. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the group of Checkbox. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the group of Checkbox. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the group of Checkbox. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + group?: string; + + /** + * Custom builder function. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + indicatorBuilder?: CustomBuilder; +} + +/** + * CheckBoxConfiguration used by content modifier. + * + * @interface CheckBoxConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CheckBoxConfiguration extends CommonConfiguration { + /** + * Current name of checkbox. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + name: string; + + /** + * Indicates whether the checkbox is selected. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selected: boolean; + + /** + * Trigger checkbox select change. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + triggerChange: Callback; +} + +/** + * Provides an interface for the Checkbox component. + * + * @interface CheckboxInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides an interface for the Checkbox component. + * + * @interface CheckboxInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides an interface for the Checkbox component. + * + * @interface CheckboxInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for the Checkbox component. + * + * @interface CheckboxInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface CheckboxInterface { + /** + * Construct the Checkbox component. + * Called when the Checkbox component is used. + * + * @param { CheckboxOptions } options + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Construct the Checkbox component. + * Called when the Checkbox component is used. + * + * @param { CheckboxOptions } options + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Construct the Checkbox component. + * Called when the Checkbox component is used. + * + * @param { CheckboxOptions } options + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Construct the Checkbox component. + * Called when the Checkbox component is used. + * + * @param { CheckboxOptions } options + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (options?: CheckboxOptions): CheckboxAttribute; +} + +/** + * Defines a Checkbox callback when onChange. + * + * @typedef { function } OnCheckboxChangeCallback + * @param { boolean } value - selected status + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare type OnCheckboxChangeCallback = (value: boolean) => void; + +/** + * Defines the attribute functions of Checkbox. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the attribute functions of Checkbox. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the attribute functions of Checkbox. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the attribute functions of Checkbox. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CheckboxAttribute extends CommonMethod { + /** + * setting whether checkbox is selected. + * + * @param { boolean } value + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * setting whether checkbox is selected. + * + * @param { boolean } value + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * setting whether checkbox is selected. + * + * @param { boolean } value + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * setting whether checkbox is selected. + * + * @param { boolean } value + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + select(value: boolean): CheckboxAttribute; + + /** + * setting the display color of checkbox. + * + * @param { ResourceColor } value + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * setting the display color of checkbox. + * + * @param { ResourceColor } value + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * setting the display color of checkbox. + * + * @param { ResourceColor } value + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * setting the display color of checkbox. + * + * @param { ResourceColor } value + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedColor(value: ResourceColor): CheckboxAttribute; + + /** + * setting the shape of checkbox. + * + * @param { CheckBoxShape } value - The configuration of checkbox shape. + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * setting the shape of checkbox. + * + * @param { CheckBoxShape } value - The configuration of checkbox shape. + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + shape(value: CheckBoxShape): CheckboxAttribute; + + /** + * Set the display border color of unselected checkbox. + * + * @param { ResourceColor } value - The color of border when checkbox unselected. + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the display border color of unselected checkbox. + * + * @param { ResourceColor } value - The color of border when checkbox unselected. + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + unselectedColor(value: ResourceColor): CheckboxAttribute; + + /** + * Set the mark style of checkbox. + * + * @param { MarkStyle } value - The style configuration of checkbox mark. + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the mark style of checkbox. + * + * @param { MarkStyle } value - The style configuration of checkbox mark. + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + mark(value: MarkStyle): CheckboxAttribute; + + /** + * Called when the selection status changes. + * + * @param { function } callback + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the selection status changes. + * + * @param { function } callback + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the selection status changes. + * + * @param { function } callback + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the selection status changes. + * + * @param { function } callback + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the selection status changes. + * + * @param { OnCheckboxChangeCallback } callback + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + onChange(callback: OnCheckboxChangeCallback): CheckboxAttribute; + + /** + * Set the content modifier of checkbox. + * + * @param { ContentModifier } modifier - The content modifier of checkbox. + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): CheckboxAttribute; +} + +/** + * Defines Checkbox Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Checkbox Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Checkbox Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Checkbox Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Checkbox: CheckboxInterface; + +/** + * Defines Checkbox Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Checkbox Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Checkbox Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Checkbox Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const CheckboxInstance: CheckboxAttribute; diff --git a/tests/arkts-sdk/ets/checkboxgroup.d.ts b/tests/arkts-sdk/ets/checkboxgroup.d.ts new file mode 100644 index 00000000..ab431ffc --- /dev/null +++ b/tests/arkts-sdk/ets/checkboxgroup.d.ts @@ -0,0 +1,703 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * CheckboxGroup SelectStatus + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * CheckboxGroup SelectStatus + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CheckboxGroup SelectStatus + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CheckboxGroup SelectStatus + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum SelectStatus { + /** + * All checkboxes are selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * All checkboxes are selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * All checkboxes are selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * All checkboxes are selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + All, + /** + * Part of the checkbox is selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Part of the checkbox is selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Part of the checkbox is selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Part of the checkbox is selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Part, + /** + * None of the checkbox is selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * None of the checkbox is selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * None of the checkbox is selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * None of the checkbox is selected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, +} + +/** + * Defines the options of CheckboxGroup. + * + * @interface CheckboxGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the options of CheckboxGroup. + * + * @interface CheckboxGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of CheckboxGroup. + * + * @interface CheckboxGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of CheckboxGroup. + * + * @interface CheckboxGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface CheckboxGroupOptions { + /** + * Setting the group of CheckboxGroup. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Setting the group of CheckboxGroup. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Setting the group of CheckboxGroup. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Setting the group of CheckboxGroup. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + group?: string; +} + +/** + * Defines the options of CheckboxGroupResult. + * + * @interface CheckboxGroupResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the options of CheckboxGroupResult. + * + * @interface CheckboxGroupResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of CheckboxGroupResult. + * + * @interface CheckboxGroupResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of CheckboxGroupResult. + * + * @interface CheckboxGroupResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface CheckboxGroupResult { + /** + * Checkbox name. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Checkbox name. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Checkbox name. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Checkbox name. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + name: Array; + /** + * Set the group of status. + * + * @type { SelectStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the group of status. + * + * @type { SelectStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the group of status. + * + * @type { SelectStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the group of status. + * + * @type { SelectStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + status: SelectStatus; +} + +/** + * Provides an interface for the CheckboxGroup component. + * + * @interface CheckboxGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides an interface for the CheckboxGroup component. + * + * @interface CheckboxGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides an interface for the CheckboxGroup component. + * + * @interface CheckboxGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for the CheckboxGroup component. + * + * @interface CheckboxGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface CheckboxGroupInterface { + /** + * Called when the CheckboxGroup component is used. + * + * @param { CheckboxGroupOptions } options + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the CheckboxGroup component is used. + * + * @param { CheckboxGroupOptions } options + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the CheckboxGroup component is used. + * + * @param { CheckboxGroupOptions } options + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the CheckboxGroup component is used. + * + * @param { CheckboxGroupOptions } options + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (options?: CheckboxGroupOptions): CheckboxGroupAttribute; +} + +/** + * Defines a CheckboxGroup callback when onChange. + * + * @typedef { function } OnCheckboxGroupChangeCallback + * @param { CheckboxGroupResult } value - checkbox group result + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare type OnCheckboxGroupChangeCallback = (value: CheckboxGroupResult) => void; + +/** + * Defines the attribute functions of CheckboxGroup. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the attribute functions of CheckboxGroup. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the attribute functions of CheckboxGroup. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the attribute functions of CheckboxGroup. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CheckboxGroupAttribute extends CommonMethod { + /** + * setting whether all checkbox is selected. + * + * @param { boolean } value + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * setting whether all checkbox is selected. + * + * @param { boolean } value + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * setting whether all checkbox is selected. + * + * @param { boolean } value + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * setting whether all checkbox is selected. + * + * @param { boolean } value + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectAll(value: boolean): CheckboxGroupAttribute; + + /** + * setting the display color of checkbox. + * + * @param { ResourceColor } value + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * setting the display color of checkbox. + * + * @param { ResourceColor } value + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * setting the display color of checkbox. + * + * @param { ResourceColor } value + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * setting the display color of checkbox. + * + * @param { ResourceColor } value + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedColor(value: ResourceColor): CheckboxGroupAttribute; + + /** + * Set the display border color of unselected checkbox. + * + * @param { ResourceColor } value - The color of border when checkboxgroup unselected. + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the display border color of unselected checkbox. + * + * @param { ResourceColor } value - The color of border when checkboxgroup unselected. + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + unselectedColor(value: ResourceColor): CheckboxGroupAttribute; + + /** + * Set the mark style of checkbox. + * + * @param { MarkStyle } value - The style configuration of checkboxgroup mark. + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the mark style of checkbox. + * + * @param { MarkStyle } value - The style configuration of checkboxgroup mark. + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + mark(value: MarkStyle): CheckboxGroupAttribute; + + /** + * Called when the selection status changes. + * + * @param { function } callback + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the selection status changes. + * + * @param { function } callback + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the selection status changes. + * + * @param { function } callback + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the selection status changes. + * + * @param { function } callback + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the selection status changes. + * + * @param { OnCheckboxGroupChangeCallback } callback + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + onChange(callback: OnCheckboxGroupChangeCallback): CheckboxGroupAttribute; + + /** + * Setting the shape of checkbox group. + * + * @param { CheckBoxShape } value - The configuration of checkbox group shape. + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + checkboxShape(value: CheckBoxShape): CheckboxGroupAttribute; +} + +/** + * Defines CheckboxGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines CheckboxGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines CheckboxGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines CheckboxGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const CheckboxGroup: CheckboxGroupInterface; + +/** + * Defines CheckboxGroup Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines CheckboxGroup Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines CheckboxGroup Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines CheckboxGroup Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const CheckboxGroupInstance: CheckboxGroupAttribute; diff --git a/tests/arkts-sdk/ets/circle.d.ts b/tests/arkts-sdk/ets/circle.d.ts new file mode 100644 index 00000000..6c7a34bd --- /dev/null +++ b/tests/arkts-sdk/ets/circle.d.ts @@ -0,0 +1,343 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines circle options for Circle component. + * + * @interface CircleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines circle options for Circle component. + * + * @interface CircleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines circle options for Circle component. + * + * @interface CircleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines circle options for Circle component. + * + * @interface CircleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface CircleOptions { + /** + * Defines the width property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the width property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the width property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the width property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: string | number; + + /** + * Defines the height property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the height property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the height property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the height property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: string | number; +} + +/** + * Defines circle component. + * + * @interface CircleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines circle component. + * + * @interface CircleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines circle component. + * + * @interface CircleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines circle component. + * + * @interface CircleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface CircleInterface { + /** + * use new function to set the value. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * use new function to set the value. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * use new function to set the value. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * use new function to set the value. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + new (value?: CircleOptions): CircleAttribute; + + /** + * Set the value.. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value.. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the value.. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the value.. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (value?: CircleOptions): CircleAttribute; +} + +/** + * Circle drawing component attribute functions. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Circle drawing component attribute functions. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Circle drawing component attribute functions. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Circle drawing component attribute functions. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CircleAttribute extends CommonShapeMethod {} + +/** + * Defines Circle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Circle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Circle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Circle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Circle: CircleInterface; + +/** + * Defines Circle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Circle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Circle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Circle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const CircleInstance: CircleAttribute; diff --git a/tests/arkts-sdk/ets/column.d.ts b/tests/arkts-sdk/ets/column.d.ts new file mode 100644 index 00000000..647effd7 --- /dev/null +++ b/tests/arkts-sdk/ets/column.d.ts @@ -0,0 +1,364 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Column constructor options. + * + * @interface ColumnOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +interface ColumnOptions { + /** + * Vertical layout element spacing + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + space?: string | number; +} + +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ColumnInterface { + /** + * Set the value. + * useAlign:Use a custom alignment. + * space: Vertical layout element spacing. + * + * @param { object } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * useAlign:Use a custom alignment. + * space: Vertical layout element spacing. + * + * @param { object } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the value. + * useAlign:Use a custom alignment. + * space: Vertical layout element spacing. + * + * @param { object } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the value. + * useAlign:Use a custom alignment. + * space: Vertical layout element spacing. + * + * @param { object } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Set the options. + * + * @param { ColumnOptions } [options] - column options + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options?: ColumnOptions): ColumnAttribute; +} + +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ColumnAttribute extends CommonMethod { + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignItems(value: HorizontalAlign): ColumnAttribute; + + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + justifyContent(value: FlexAlign): ColumnAttribute; + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { ColumnAttribute } The attribute of the column. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): ColumnAttribute; + /** + * Called when the Main-Axis's direction is set reversed or not + * + * @param { Optional } isReversed - If the main axis is reversed. + * @returns { ColumnAttribute } The attribute of the column. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + reverse(isReversed: Optional): ColumnAttribute; +} + +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Column: ColumnInterface; + +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ColumnInstance: ColumnAttribute; diff --git a/tests/arkts-sdk/ets/column_split.d.ts b/tests/arkts-sdk/ets/column_split.d.ts new file mode 100644 index 00000000..f76e6cc0 --- /dev/null +++ b/tests/arkts-sdk/ets/column_split.d.ts @@ -0,0 +1,254 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the ColumnSplit component. + * + * @interface ColumnSplitInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the ColumnSplit component. + * + * @interface ColumnSplitInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the ColumnSplit component. + * + * @interface ColumnSplitInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface ColumnSplitInterface { + /** + * Layout the subassemblies vertically and insert a horizontal divider line between each subassemblies. + * + * @returns { ColumnSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Layout the subassemblies vertically and insert a horizontal divider line between each subassemblies. + * + * @returns { ColumnSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Layout the subassemblies vertically and insert a horizontal divider line between each subassemblies. + * + * @returns { ColumnSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (): ColumnSplitAttribute; +} + +/** + * Provides an interface for the style of a divider including start margin and end margin + * + * @interface ColumnSplitDividerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for the style of a divider including start margin and end margin + * + * @interface ColumnSplitDividerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface ColumnSplitDividerStyle { + /** + * Define the start margin of the divider + * + * @type { ?Dimension } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the start margin of the divider + * + * @type { ?Dimension } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + startMargin?: Dimension; + + /** + * Define the end margin of the divider + * + * @type { ?Dimension } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the end margin of the divider + * + * @type { ?Dimension } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + endMargin?: Dimension; +} + +/** + * Defines the ColumnSplit component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the ColumnSplit component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the ColumnSplit component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class ColumnSplitAttribute extends CommonMethod { + /** + * Indicates whether the split line can be dragged. The default value is false. + * + * @param { boolean } value + * @returns { ColumnSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether the split line can be dragged. The default value is false. + * + * @param { boolean } value + * @returns { ColumnSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates whether the split line can be dragged. The default value is false. + * + * @param { boolean } value + * @returns { ColumnSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + resizeable(value: boolean): ColumnSplitAttribute; + + /** + * Called when the ColumnSplit split line style is set. + * @param { ColumnSplitDividerStyle | null } value - indicates the style of the indicator. + * if value is set to null, the value of startMargin and endMargin is set to 0.0 by default. + * @returns { ColumnSplitAttribute } the attribute of the ColumnSplit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the ColumnSplit split line style is set. + * @param { ColumnSplitDividerStyle | null } value - indicates the style of the indicator. + * if value is set to null, the value of startMargin and endMargin is set to 0.0 by default. + * @returns { ColumnSplitAttribute } the attribute of the ColumnSplit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + divider(value: ColumnSplitDividerStyle | null): ColumnSplitAttribute; +} + +/** + * Defines ColumnSplit Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines ColumnSplit Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines ColumnSplit Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const ColumnSplitInstance: ColumnSplitAttribute; + +/** + * Defines ColumnSplit Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines ColumnSplit Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines ColumnSplit Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const ColumnSplit: ColumnSplitInterface; diff --git a/tests/arkts-sdk/ets/common.d.ts b/tests/arkts-sdk/ets/common.d.ts new file mode 100644 index 00000000..8c2f5f59 --- /dev/null +++ b/tests/arkts-sdk/ets/common.d.ts @@ -0,0 +1,24541 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the options of Component ClassDecorator. + * + * @interface ComponentOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the options of Component ClassDecorator. + * + * @interface ComponentOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface ComponentOptions { + /** + * freeze UI state. + * + * @type { boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * freeze UI state. + * + * @type { boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + freezeWhenInactive : boolean, +} + +/** + * Define the ratio of characters entered by the the percentage of InputCounterOptions. + * + * @interface InputCounterOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Define the ratio of characters entered by the the percentage of InputCounterOptions. + * + * @interface InputCounterOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface InputCounterOptions { + /** + * It is the numerator bit of the percentage and used as a threshold. If the number of characters input + * reaches the maximum number of characters multiplied by this threshold, the counter is displayed. + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * It is the numerator bit of the percentage and used as a threshold. If the number of characters input + * reaches the maximum number of characters multiplied by this threshold, the counter is displayed. + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + thresholdPercentage?: number; + + /** + * If the current input character count reaches the maximum character count and users want to exceed the + * normal input, the border will turn red. If this parameter is true, the red border displayed. + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * If the current input character count reaches the maximum character count and users want to exceed the + * normal input, the border will turn red. If this parameter is true, the red border displayed. + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + highlightBorder?: boolean; +} + +/** + * Defines the options of decoration. + * + * @interface TextDecorationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextDecorationOptions { + /** + * The decoration type. + * + * @type { TextDecorationType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: TextDecorationType; + + /** + * Sets the color of decoration. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * The style value of decoration. + * + * @type { ?TextDecorationStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: TextDecorationStyle; +} + +/** + * Defining Component ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Component ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Component ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Component ClassDecorator + * + * Component is a ClassDecorator and it supports ComponentOptions as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Component: ClassDecorator & ((options: ComponentOptions) => ClassDecorator); + +/** + * Defining ComponentV2 ClassDecorator + * + * ComponentV2 is a ClassDecorator and it supports ComponentOptions as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const ComponentV2: ClassDecorator & ((options: ComponentOptions) => ClassDecorator); + +/** + * Defines the options of Entry ClassDecorator. + * + * @interface EntryOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ +/** + * Defines the options of Entry ClassDecorator. + * + * @interface EntryOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ +declare interface EntryOptions { + /** + * Named route name. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * Named route name. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + routeName? : string, + + /** + * LocalStorage to be passed. + * + * @type { ?LocalStorage } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * LocalStorage to be passed. + * + * @type { ?LocalStorage } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + storage? : LocalStorage, + + /** + * Determines whether to use the LocalStorage instance object returned by the LocalStorage.getShared() interface. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + useSharedStorage? : boolean, +} + +/** + * Defines Entry ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Entry ClassDecorator. + * + * Entry is a ClassDecorator and it supports LocalStorage as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Entry ClassDecorator. + * + * Entry is a ClassDecorator and it supports LocalStorage or EntryOptions as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Entry ClassDecorator. + * + * Entry is a ClassDecorator and it supports LocalStorage or EntryOptions as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Entry: ClassDecorator & ((options?: LocalStorage | EntryOptions) => ClassDecorator); + +/** + * Defining Observed ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Observed ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Observed ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Observed ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Observed: ClassDecorator; + +/** + * Defining ObservedV2 ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const ObservedV2: ClassDecorator; + +/** + * Defining Preview ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Preview ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Preview ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Preview ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Preview: ClassDecorator & ((value: PreviewParams) => ClassDecorator); + +/** + * Defining Require PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Require: PropertyDecorator; + +/** + * Defining BuilderParam PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining BuilderParam PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining BuilderParam PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining BuilderParam PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const BuilderParam: PropertyDecorator; + +/** + * Defining Local PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Local: PropertyDecorator; + +/** + * Defining Param PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Param: PropertyDecorator; + +/** + * Defining Once PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Once: PropertyDecorator; + +/** + * Defining Event PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Event: PropertyDecorator; + +/** + * Defining State PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining State PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining State PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining State PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const State: PropertyDecorator; + +/** + * Defining Track PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defining Track PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const Track: PropertyDecorator; + +/** + * Defining Trace PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const Trace: PropertyDecorator; + +/** + * Defining Prop PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Prop PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Prop PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Prop PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Prop: PropertyDecorator; + +/** + * Defining Link PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Link PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Link PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Link PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Link: PropertyDecorator; + +/** + * Defining ObjectLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining ObjectLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining ObjectLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining ObjectLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ObjectLink: PropertyDecorator; + +/** + * Defines the options of Provide PropertyDecorator. + * + * @interface ProvideOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ProvideOptions { + /** + * Override the @Provide of any parent or parent of parent @Component.@Provide({allowOverride: "name"}) is + * also allowed to be used even when there is no ancestor @Component whose @Provide would be overridden. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + allowOverride?: string, +} + +/** + * Defining Provide PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Provide PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Provide PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Provide PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Provide: PropertyDecorator & ((value: string | ProvideOptions) => PropertyDecorator); + +/** + * Defining Provider PropertyDecorator, aliasName is the only matching key and if aliasName is the default, the default attribute name is regarded as aliasName. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Provider: (aliasName?: string) => PropertyDecorator; + +/** + * Defining Consume PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Consume PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Consume PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Consume PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Consume: PropertyDecorator & ((value: string) => PropertyDecorator); + +/** +* Defining Consumer PropertyDecorator, aliasName is the only matching key and if aliasName is the default, the default attribute name is regarded as aliasName. +* And @Consumer will find the nearest @Provider. +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 12 +*/ +declare const Consumer: (aliasName?: string) => PropertyDecorator; + +/** +* Defining Computed MethodDecorator. +* +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 12 +*/ +declare const Computed: MethodDecorator; + +/** + * Defining StorageProp PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining StorageProp PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining StorageProp PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const StorageProp: (value: string) => PropertyDecorator; + +/** + * Defining StorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining StorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining StorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const StorageLink: (value: string) => PropertyDecorator; + +/** + * Defining Watch PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Watch PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Watch PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Watch PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Watch: (value: string) => PropertyDecorator; + +/** + * Defining Builder MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Builder MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Builder MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Builder MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Builder: MethodDecorator; + +/** + * Defining LocalBuilder MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const LocalBuilder: MethodDecorator; + +/** + * Defining Styles MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defining Styles MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Styles MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Styles MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Styles: MethodDecorator; + +/** + * Defining Extend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Extend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Extend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Extend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Extend: MethodDecorator & ((value: any) => MethodDecorator); + +/** + * Define AnimatableExtend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define AnimatableExtend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + declare const AnimatableExtend: MethodDecorator & ((value: Object) => MethodDecorator); + +/** + * Define Monitor MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Monitor: MonitorDecorator; + +/** + * Define Monitor Decorator type + * + * @typedef { function } MonitorDecorator + * @param { string } value - Monitored path input by the user + * @param { string[] } args - Monitored path(s) input by the user + * @returns { MethodDecorator } Monitor decorator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type MonitorDecorator = (value: string, ...args: string[]) => MethodDecorator; + +/** + * Define IMonitor interface + * + * @interface IMonitor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface IMonitor { + /** + * Array of changed paths(keys) + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dirty: Array; + + /** + * Return the pair of the value before the most recent change and current value for given path. + * If path does not exist, return undefined; If path is not specified, return the value pair corresponding to the first path in dirty. + * + * @param { string } [path] + * @returns { IMonitorValue | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value(path?: string): IMonitorValue | undefined; +} + +/** + * Define IMonitorValue interface + * + * @interface IMonitorValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface IMonitorValue { + /** + * Get the previous value. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + before: T; + + /** + * Get current value. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + now: T; + + /** + * Monitored path input by the user. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + path: string; +} + +/** + * Define AnimatableArithmetic interface + * + * @interface AnimatableArithmetic + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define AnimatableArithmetic interface + * + * @interface AnimatableArithmetic + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + declare interface AnimatableArithmetic { + /** + * Define plus method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define plus method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + plus(rhs: AnimatableArithmetic): AnimatableArithmetic; + + /** + * Define subtract method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define subtract method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + subtract(rhs: AnimatableArithmetic): AnimatableArithmetic; + + /** + * Define multiply method + * + * @param { number } scale - scale value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define multiply method + * + * @param { number } scale - scale value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + multiply(scale: number): AnimatableArithmetic; + + /** + * Define equals method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { boolean } is equals + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define equals method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { boolean } is equals + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + equals(rhs: AnimatableArithmetic): boolean; +} + +/** + * Defining Concurrent MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defining Concurrent MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining Concurrent MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Concurrent: MethodDecorator; + +/** + * Defining Sendable ClassDecorator + * The Sendable decorator can be used only for classes. A class with this decorator is marked as sendable, and the class object can be shared globally. + * Since 12, the Sendable decorator can be used for function and typeAlias also. + * A function with this decorator is marked as sendable, and the function can be an shareable property of sendable-class object. + * A typeAlias with this decorator is marked as sendable, and the typeAlias can be used to declare properties, variables, + * and arguments that need to be assigned with sendable-function. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Sendable: ClassDecorator; + +/** + * Defining CustomDialog ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining CustomDialog ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining CustomDialog ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const CustomDialog: ClassDecorator; + +/** + * Defining LocalStorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defining LocalStorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining LocalStorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const LocalStorageLink: (value: string) => PropertyDecorator; + +/** + * Defining LocalStorageProp PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining LocalStorageProp PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining LocalStorageProp PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const LocalStorageProp: (value: string) => PropertyDecorator; + +/** + * Obtains the Context object associated with a component on the page. + * + * @param { Object } component - indicate the component on the page. + * @returns { Context } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @since 9 + */ +/** + * Obtains the Context object associated with a component on the page. + * + * @param { Object } component - indicate the component on the page. + * @returns { Context } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @since 10 + */ +/** + * Obtains the Context object associated with a component on the page. + * + * @param { Object } component - indicate the component on the page. + * @returns { Context } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @atomicservice + * @since 11 + */ +declare function getContext(component?: Object): Context; + +/** + * Defining Reusable ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining Reusable ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Reusable: ClassDecorator; + +/** + * Get context. + * + * @typedef { import('../api/application/Context').default } Context + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @since 9 + */ +/** + * Get context. + * + * @typedef { import('../api/application/Context').default } Context + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @since 10 + */ +/** + * Get context. + * + * @typedef { import('../api/application/Context').default } Context + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type Context = import('../api/application/Context').default; + +/** + * Post Card Action. + * + * @param { Object } component - indicate the card entry component. + * @param { Object } action - indicate the router, message or call event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @form + * @since 9 + */ +/** + * Post Card Action. + * + * @param { Object } component - indicate the card entry component. + * @param { Object } action - indicate the router, message or call event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @form + * @since 10 + */ +/** + * Post Card Action. + * + * @param { Object } component - indicate the card entry component. + * @param { Object } action - indicate the router, message or call event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function postCardAction(component: Object, action: Object): void; + +/** + * Defines the data type of the interface restriction. + * + * @interface Configuration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Configuration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Configuration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Configuration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface Configuration { + /** + * Set colorMode. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set colorMode. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set colorMode. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set colorMode. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly colorMode: string; + + /** + * Set fontScale. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set fontScale. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set fontScale. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set fontScale. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly fontScale: number; +} + +/** + * Defines the data type of the interface restriction. + * + * @interface Rectangle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Rectangle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Rectangle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Rectangle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface Rectangle { + /** + * x:Horizontal coordinate + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * x:Horizontal coordinate + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * x:Horizontal coordinate + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * x:Horizontal coordinate + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: Length; + + /** + * y:Vertical axis coordinate. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * y:Vertical axis coordinate. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * y:Vertical axis coordinate. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * y:Vertical axis coordinate. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: Length; + + /** + * Sets the width of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the width of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the width of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the width of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: Length; + + /** + * Sets the height of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the height of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the height of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the height of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: Length; +} + +/** + * Interface for ExpectedFrameRateRange. + * + * @interface ExpectedFrameRateRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Interface for ExpectedFrameRateRange. + * + * @interface ExpectedFrameRateRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface ExpectedFrameRateRange { + /** + * The minimum animation drawing FPS. + * The minimum value should be less than or equal to the maximum value. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * The minimum animation drawing FPS. + * The minimum value should be less than or equal to the maximum value. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + min: number, + /** + * The maximum animation drawing FPS. + * The maximum value should be greater than or equal to the minimum value. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * The maximum animation drawing FPS. + * The maximum value should be greater than or equal to the minimum value. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + max: number, + /** + * The expected frame rate of dynamical callback rate range. + * The value should be between the minimum and maximum value. + * Otherwise, the actual callback rate will be dynamically + * adjusted to better align with other animation sources. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * The expected frame rate of dynamical callback rate range. + * The value should be between the minimum and maximum value. + * Otherwise, the actual callback rate will be dynamically + * adjusted to better align with other animation sources. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + expected: number, +} + +/** + * global $r function + * + * @param { string } value + * @param { any[] } params + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * global $r function + * + * @param { string } value + * @param { any[] } params + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * global $r function + * + * @param { string } value + * @param { any[] } params + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * global $r function + * + * @param { string } value + * @param { any[] } params + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function $r(value: string, ...params: any[]): Resource; + +/** + * global $rawfile function + * + * @param { string } value + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * global $rawfile function + * + * @param { string } value + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * global $rawfile function + * + * @param { string } value + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * global $rawfile function + * + * @param { string } value + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function $rawfile(value: string): Resource; + +/** + * Enum for FinishCallbackType. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Enum for FinishCallbackType. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum FinishCallbackType { + /** + * When the entire animation ends and will be removed immediately, the callback is triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * When the entire animation ends and will be removed immediately, the callback is triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + REMOVED = 0, + /** + * When the animation is logically down but may still be in its long tail, the callback is triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * When the animation is logically down but may still be in its long tail, the callback is triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + LOGICALLY = 1, +} + +/** + * Defines the touch test strategy object. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the touch test strategy object. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum TouchTestStrategy { + /** + * Do framework touch test. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Do framework touch test. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DEFAULT = 0, + + /** + * Specify the component to do touch test and follow the framework touch test + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Specify the component to do touch test and follow the framework touch test + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + FORWARD_COMPETITION = 1, + + /** + * Specify the component to do touch test and not follow the framework touch test + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Specify the component to do touch test and not follow the framework touch test + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + FORWARD = 2 +} + +/** + * Defines the animate function params. + * + * @interface AnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the animate function params. + * + * @interface AnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the animate function params. + * + * @interface AnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the animate function params. + * + * @interface AnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface AnimateParam { + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + duration?: number; + /** + * Animation playback speed. A larger value indicates faster animation playback, and a smaller value indicates slower + * animation playback. The value 0 means that there is no animation. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation playback speed. A larger value indicates faster animation playback, and a smaller value indicates slower + * animation playback. The value 0 means that there is no animation. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation playback speed. A larger value indicates faster animation playback, and a smaller value indicates slower + * animation playback. The value 0 means that there is no animation. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + tempo?: number; + /** + * Animation curve. + * + * @type { ?(Curve | string) } + * @default Curve.EaseInOut + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation curve. + * + * @type { ?(Curve | string | ICurve) } + * @default Curve.EaseInOut + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Animation curve. + * + * @type { ?(Curve | string | ICurve) } + * @default Curve.EaseInOut + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Animation curve. + * + * @type { ?(Curve | string | ICurve) } + * @default Curve.EaseInOut + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + curve?: Curve | string | ICurve; + + /** + * Animation plays with delay,when set to a negative number, the animation plays in advance. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + delay?: number; + + /** + * Animation iterations. When set to -1, the animation playing it repeatedly. The value range is greater than or equal to -1. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation iterations. When set to -1, the animation playing it repeatedly. The value range is greater than or equal to -1. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation iterations. When set to -1, the animation playing it repeatedly. The value range is greater than or equal to -1. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + iterations?: number; + + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * + * @type { ?PlayMode } + * @default PlayMode.Normal + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * + * @type { ?PlayMode } + * @default PlayMode.Normal + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * + * @type { ?PlayMode } + * @default PlayMode.Normal + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * + * @type { ?PlayMode } + * @default PlayMode.Normal + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + playMode?: PlayMode; + + /** + * Callback invoked when the animation playback is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Callback invoked when the animation playback is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Callback invoked when the animation playback is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Callback invoked when the animation playback is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onFinish?: () => void; + + /** + * Define the type of onFinish callback in animation. + * + * @type { ?FinishCallbackType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Define the type of onFinish callback in animation. + * + * @type { ?FinishCallbackType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + finishCallbackType?: FinishCallbackType; + + /** + * Indicates expectedFrameRateRange including minimum、maximum and expected frame rate. + * + * @type { ?ExpectedFrameRateRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Indicates expectedFrameRateRange including minimum、maximum and expected frame rate. + * + * @type { ?ExpectedFrameRateRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + expectedFrameRateRange?: ExpectedFrameRateRange; +} + +/** + * Interface for curve object. + * + * @interface ICurve + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Interface for curve object. + * + * @interface ICurve + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Interface for curve object. + * + * @interface ICurve + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ICurve { + /** + * Get curve value by fraction. + * + * @param { number } fraction - Indicates the current normalized time parameter. Value range: [0, 1]. + * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Get curve value by fraction. + * + * @param { number } fraction - Indicates the current normalized time parameter. Value range: [0, 1]. + * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Get curve value by fraction. + * + * @param { number } fraction - Indicates the current normalized time parameter. Value range: [0, 1]. + * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + interpolate(fraction: number): number; +} + +/** + * Defines the motion path options. + * + * @interface MotionPathOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the motion path options. + * + * @interface MotionPathOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the motion path options. + * + * @interface MotionPathOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MotionPathOptions { + /** + * The path info. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The path info. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The path info. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + path: string; + + /** + * The origin point info in range [0,1). + * + * @type { ?number } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The origin point info in range [0,1). + * + * @type { ?number } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The origin point info in range [0,1). + * + * @type { ?number } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + from?: number; + + /** + * he distance point info in range (0,1]. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * he distance point info in range (0,1]. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The distance point info in range (0,1]. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + to?: number; + + /** + * The rotate info. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The rotate info. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The rotate info. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + rotatable?: boolean; +} + +/** + * Defines the shard transition function params. + * + * @interface sharedTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the shard transition function params. + * + * @interface sharedTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the shard transition function params. + * + * @interface sharedTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface sharedTransitionOptions { + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + duration?: number; + + /** + * Animation duration, in ms. + * + * @type { ?(Curve | string | ICurve) } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation curve. + * + * @type { ?(Curve | string | ICurve) } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation curve. + * + * @type { ?(Curve | string | ICurve) } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + curve?: Curve | string | ICurve; + + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + delay?: number; + + /** + * The motion path info. + * + * @type { ?MotionPathOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The motion path info. + * + * @type { ?MotionPathOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The motion path info. + * + * @type { ?MotionPathOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + motionPath?: MotionPathOptions; + + /** + * Z index info. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Z index info. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Z index info. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + zIndex?: number; + + /** + * the animate type. + * + * @type { ?SharedTransitionEffectType } + * @default SharedTransitionEffectType.Exchange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * the animate type. + * + * @type { ?SharedTransitionEffectType } + * @default SharedTransitionEffectType.Exchange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * the animate type. + * + * @type { ?SharedTransitionEffectType } + * @default SharedTransitionEffectType.Exchange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type?: SharedTransitionEffectType; +} + +/** + * Defines the options of geometry transition. + * + * @interface GeometryTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the options of geometry transition. + * + * @interface GeometryTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GeometryTransitionOptions { + /** + * whether follow target for the component still in the hierarchy, default: false, stay current. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * whether follow target for the component still in the hierarchy, default: false, stay current. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + follow?: boolean; + /** + * Defines movement strategy of source and target in the hierarchy during geometry transition. + * + * @type { ?TransitionHierarchyStrategy } + * @default TransitionHierarchyStrategy.ADAPTIVE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @atomicservice + * @since 12 + */ + /** + * Defines movement strategy of source and target in the hierarchy during geometry transition. + * + * @type { ?TransitionHierarchyStrategy } + * @default TransitionHierarchyStrategy.ADAPTIVE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + hierarchyStrategy?: TransitionHierarchyStrategy +} + +/** + * Source and target are two matched elements during the geometry transition. + * The animation starts at the source and ends at the target. + * TransitionHierarchyStrategy enumeration defines how levels of source and target elements + * would be changed in the hierarchy during the geometry transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @atomicservice + * @since 12 + */ +/** + * Source and target are two matched elements during the geometry transition. + * The animation starts at the source and ends at the target. + * TransitionHierarchyStrategy enumeration defines how levels of source and target elements + * would be changed in the hierarchy during the geometry transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ +declare enum TransitionHierarchyStrategy { + /** + * None mode. + * Source and target staty in the original level in the hierarchy during geometry transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @atomicservice + * @since 12 + */ + /** + * None mode. + * Source and target staty in the original level in the hierarchy during geometry transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + NONE = 0, + + /** + * ADAPTIVE mode. + * Lower level one of source and target is elevated to higher level of both, + * indicating that two elements are in same high level. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @atomicservice + * @since 12 + */ + /** + * ADAPTIVE mode. + * Lower level one of source and target is elevated to higher level of both, + * indicating that two elements are in same high level. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + ADAPTIVE = 1, +} + +/** + * Defines the options of translate. + * + * @interface TranslateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of translate. + * + * @interface TranslateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of translate. + * + * @interface TranslateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of translate. + * + * @interface TranslateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface TranslateOptions { + /** + * The param of x direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of x direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of x direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of x direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: number | string; + + /** + * The param of y direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of y direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of y direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of y direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: number | string; + + /** + * The param of z direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of z direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of z direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of z direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + z?: number | string; +} + +/** + * Defines the options of scale. + * + * @interface ScaleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of scale. + * + * @interface ScaleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of scale. + * + * @interface ScaleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of scale. + * + * @interface ScaleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ScaleOptions { + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: number; + + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: number; + + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + z?: number; + + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + centerX?: number | string; + + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + centerY?: number | string; +} + +/** + * Defines the align rule options of relative container. + * + * @interface AlignRuleOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the align rule options of relative container. + * + * @interface AlignRuleOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the align rule options of relative container. + * + * @interface AlignRuleOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface AlignRuleOption { + /** + * The param of left align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of left align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of left align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + left?: { anchor: string, align: HorizontalAlign }; + + /** + * The param of right align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of right align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of right align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + right?: { anchor: string, align: HorizontalAlign }; + + /** + * The param of middle align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of middle align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of middle align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + middle?: { anchor: string, align: HorizontalAlign }; + + /** + * The param of top align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of top align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of top align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + top?: { anchor: string, align: VerticalAlign }; + + /** + * The param of bottom align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of bottom align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * The param of bottom align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + bottom?: { anchor: string, align: VerticalAlign }; + + /** + * The param of center align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of center align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + center?: { anchor: string, align: VerticalAlign }; + + /** + * Defines the bias ratio in horizontal and vertical direction. + * + * @type { ?Bias } + * @default {horizontal:0.5,vertical:0.5} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the bias ratio in horizontal and vertical direction. + * + * @type { ?Bias } + * @default {horizontal:0.5,vertical:0.5} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bias?: Bias; +} + +/** + * Defines the localized horizontal align param of relative container. + * + * @interface LocalizedHorizontalAlignParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LocalizedHorizontalAlignParam { + /** + * The anchor of localized align param. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + anchor: string; + + /** + * The align of localized align param. + * + * @type { HorizontalAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + align: HorizontalAlign; +} + +/** + * Defines the localized vertical align param of relative container. + * + * @interface LocalizedVerticalAlignParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LocalizedVerticalAlignParam { + /** + * The anchor of localized align param. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + anchor: string; + + /** + * The align of localized align param. + * + * @type { VerticalAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + align: VerticalAlign; +} + +/** + * Defines the Localized align rule options of relative container. + * + * @interface LocalizedAlignRuleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LocalizedAlignRuleOptions { + /** + * The param of start align. + * + * @type { ?LocalizedHorizontalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start?: LocalizedHorizontalAlignParam; + + /** + * The param of end align. + * + * @type { ?LocalizedHorizontalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + end?: LocalizedHorizontalAlignParam; + + /** + * The param of middle align. + * + * @type { ?LocalizedHorizontalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + middle?: LocalizedHorizontalAlignParam; + + /** + * The param of top align. + * + * @type { ?LocalizedVerticalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + top?: LocalizedVerticalAlignParam; + + /** + * The param of bottom align. + * + * @type { ?LocalizedVerticalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bottom?: LocalizedVerticalAlignParam; + + /** + * The param of center align. + * + * @type { ?LocalizedVerticalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + center?: LocalizedVerticalAlignParam; + + /** + * Defines the bias ratio in horizontal and vertical direction. + * + * @type { ?Bias } + * @default {horizontal:0.5,vertical:0.5} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bias?: Bias; +} + +/** + * Defines the style of the chain in relative container. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum ChainStyle { + /** + * Elements of the chain will be spread out. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SPREAD, + + /** + * Elements except chain's head and tail will be spread out. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SPREAD_INSIDE, + + /** + * Elements of the chain will be packed together. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PACKED, +} + +/** + * The param of rotate. + * + * @interface RotateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The param of rotate. + * + * @interface RotateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * The param of rotate. + * + * @interface RotateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * The param of rotate. + * + * @interface RotateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface RotateOptions { + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: number; + + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: number; + + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + z?: number; + + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + centerX?: number | string; + + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + centerY?: number | string; + + /** + * The param of center point of z. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center point of z. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + centerZ?: number; + + /** + * The param of camera distance, value range (-∞, ∞). + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of camera distance, value range (-∞, ∞). + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + perspective?: number; + + /** + * The param of angle. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of angle. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of angle. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of angle. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + angle: number | string; +} + +/** + * Defines the param of transition. + * + * @interface TransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead TransitionEffect + */ +declare interface TransitionOptions { + /** + * Defines the param of type. + * + * @type { ?TransitionType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + */ + type?: TransitionType; + /** + * Defines the param of opacity. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + */ + opacity?: number; + /** + * Defines the param of translate. + * + * @type { ?TranslateOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + */ + translate?: TranslateOptions; + /** + * Defines the param of scale. + * + * @type { ?ScaleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + */ + scale?: ScaleOptions; + /** + * Defines the param of rotate. + * + * @type { ?RotateOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + */ + rotate?: RotateOptions; +} + +/** + * Defines the Edge object. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Edge object. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TransitionEdge { + /** + * Top edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + TOP, + + /** + * Bottom edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Bottom edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BOTTOM, + + /** + * Start edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Start edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + START, + + /** + * End edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * End edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + END +} + +/** + * Defines all transition effects. + * + * @typedef { object } TransitionEffects + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines all transition effects. + * + * @typedef { object } TransitionEffects + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type TransitionEffects = { + identity: undefined; + opacity: number; + slideSwitch: undefined; + move: TransitionEdge; + translate: TranslateOptions; + rotate: RotateOptions; + scale: ScaleOptions; + asymmetric: { + appear: TransitionEffect; + disappear: TransitionEffect; + }; +}; + +/** + * Defined the draw modifier of node. Provides draw callbacks for the associated Node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class DrawModifier { + /** + * drawBehind Method. Executed before drawing associated Node. + * + * @param { DrawContext } drawContext - The drawContext used to draw. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + drawBehind?(drawContext: DrawContext): void; + + /** + * drawContent Method. Executed when associated Node is drawing, the default drawContent method will be replaced + * if this method is set. + * + * @param { DrawContext } drawContext - The drawContext used to draw. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + drawContent?(drawContext: DrawContext): void; + + /** + * drawFront Method. Executed after drawing associated Node. + * + * @param { DrawContext } drawContext - The drawContext used to draw. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + drawFront?(drawContext: DrawContext): void; + + /** + * Invalidate the component, which will cause a re-render of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + invalidate(): void; +} + +/** + * Defines the transition effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the transition effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class TransitionEffect< + Type extends keyof TransitionEffects = keyof TransitionEffects, + Effect extends TransitionEffects[Type] = TransitionEffects[Type] +> { + /** + * Disables the transition effect + * + * @type { TransitionEffect<"identity"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Disables the transition effect + * + * @type { TransitionEffect<"identity"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static readonly IDENTITY: TransitionEffect<"identity">; + + /** + * Specifies a transition effect with transparency of 0, which is equivalent to TransitionEffect.opacity(0). + * + * @type { TransitionEffect<"opacity"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies a transition effect with transparency of 0, which is equivalent to TransitionEffect.opacity(0). + * + * @type { TransitionEffect<"opacity"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static readonly OPACITY: TransitionEffect<"opacity">; + + /** + * Defines a slide transition effect + * + * @type { TransitionEffect< + * "asymmetric", + * {appear: TransitionEffect<"move", TransitionEdge>; + * disappear: TransitionEffect<"move", TransitionEdge>; + * }> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines a slide transition effect + * + * @type { TransitionEffect< + * "asymmetric", + * {appear: TransitionEffect<"move", TransitionEdge>; + * disappear: TransitionEffect<"move", TransitionEdge>; + * }> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static readonly SLIDE: TransitionEffect< + "asymmetric", + { + appear: TransitionEffect<"move", TransitionEdge>; + disappear: TransitionEffect<"move", TransitionEdge>; + } + >; + + /** + * Specify a transition effect where the element enters by shrinking first and then expanding as it slides in from the right, + * and exits by shrinking first and then expanding as it slides out to the left, with a minimum scale ratio of 0.8. + * It comes with default animation parameters, which can also be overridden. + * The default animation duration is set to 600ms, and the specified animation curve is cubicBezierCurve(0.24, 0.0, 0.50, 1.0). + * + * @type { TransitionEffect<"slideSwitch"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specify a transition effect where the element enters by shrinking first and then expanding as it slides in from the right, + * and exits by shrinking first and then expanding as it slides out to the left, with a minimum scale ratio of 0.8. + * It comes with default animation parameters, which can also be overridden. + * The default animation duration is set to 600ms, and the specified animation curve is cubicBezierCurve(0.24, 0.0, 0.50, 1.0). + * + * @type { TransitionEffect<"slideSwitch"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static readonly SLIDE_SWITCH: TransitionEffect<"slideSwitch">; + + /** + * Creates a translate transition effect + * + * @param { TranslateOptions } options - translate options + * @returns { TransitionEffect<"translate"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a translate transition effect + * + * @param { TranslateOptions } options - translate options + * @returns { TransitionEffect<"translate"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static translate(options: TranslateOptions): TransitionEffect<"translate">; + + /** + * Creates a rotation transition effect + * + * @param { RotateOptions } options - rotate options + * Set the rotation effect for component transitions when inserting and deleting. + * The value represents the starting rotation point for the inserting animation and the ending rotation point for the deleting animation. + * -x: Horizontal component of the rotational vector. + * -y: Vertical component of the rotational vector. + * -z: Vertical component of the rotational vector. + * -centerX, centerY specify the rotation center point, with default values of "50%", + * meaning that the default rotation center point is the center point of the component. + * -The center point of (0, 0) represents the upper-left corner of the component. + * -centerZ refers to the Z-axis anchor point. The default value of centerZ is 0. + * -perspective indicates the visual distance. The perspective property does not support transition animation. + * @returns { TransitionEffect<"rotate"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a rotation transition effect + * + * @param { RotateOptions } options - rotate options + * Set the rotation effect for component transitions when inserting and deleting. + * The value represents the starting rotation point for the inserting animation and the ending rotation point for the deleting animation. + * -x: Horizontal component of the rotational vector. + * -y: Vertical component of the rotational vector. + * -z: Vertical component of the rotational vector. + * -centerX, centerY specify the rotation center point, with default values of "50%", + * meaning that the default rotation center point is the center point of the component. + * -The center point of (0, 0) represents the upper-left corner of the component. + * -centerZ refers to the Z-axis anchor point. The default value of centerZ is 0. + * -perspective indicates the visual distance. The perspective property does not support transition animation. + * @returns { TransitionEffect<"rotate"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static rotate(options: RotateOptions): TransitionEffect<"rotate">; + + /** + * Creates a scale transition effect + * + * @param { ScaleOptions } options - scale options + * @returns { TransitionEffect<"scale"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a scale transition effect + * + * @param { ScaleOptions } options - scale options + * @returns { TransitionEffect<"scale"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static scale(options: ScaleOptions): TransitionEffect<"scale">; + + /** + * Creates an opacity transition effect with alpha value + * + * @param { number } alpha - opacity alpha value, value range [0, 1]. + * @returns { TransitionEffect<"opacity"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates an opacity transition effect with alpha value + * + * @param { number } alpha - opacity alpha value, value range [0, 1]. + * @returns { TransitionEffect<"opacity"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Creates an opacity transition effect with alpha value + * + * @param { number } alpha - opacity alpha value, value range [0, 1]. + * Illegal values less than 0 are treated as 0, and illegal values greater than 1 are treated as 1. + * @returns { TransitionEffect<"opacity"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + static opacity(alpha: number): TransitionEffect<"opacity">; + + /** + * Creates a move transition effect + * + * @param { TransitionEdge } edge - the edge that component will move to + * @returns { TransitionEffect<"move"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a move transition effect + * + * @param { TransitionEdge } edge - the edge that component will move to + * @returns { TransitionEffect<"move"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static move(edge: TransitionEdge): TransitionEffect<"move">; + + /** + * Creates an asymmetric transition effect + * + * @param { TransitionEffect } appear - the transition which will be attached when the component is appear + * @param { TransitionEffect } disappear - the transition which will be attached when the component is disappear + * @returns { TransitionEffect<"asymmetric"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates an asymmetric transition effect + * + * @param { TransitionEffect } appear - the transition which will be attached when the component is appear + * @param { TransitionEffect } disappear - the transition which will be attached when the component is disappear + * @returns { TransitionEffect<"asymmetric"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static asymmetric( + appear: TransitionEffect, + disappear: TransitionEffect + ): TransitionEffect<"asymmetric">; + + /** + * TransitionEffect constructor + * + * @param { Type } type - transition type + * @param { Effect } effect - transition options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * TransitionEffect constructor + * + * @param { Type } type - transition type + * @param { Effect } effect - transition options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(type: Type, effect: Effect); + + /** + * Set the animation of current transition effect + * + * @param { AnimateParam } value - animation parameters + * @returns { TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the animation of current transition effect + * + * @param { AnimateParam } value - animation parameters + * @returns { TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + animation(value: AnimateParam): TransitionEffect; + + /** + * Combines another transition effect + * + * @param { TransitionEffect } transitionEffect - transition effect which is be combined + * @returns { TransitionEffect } combined transition effect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Combines another transition effect + * + * @param { TransitionEffect } transitionEffect - transition effect which is be combined + * @returns { TransitionEffect } combined transition effect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + combine(transitionEffect: TransitionEffect): TransitionEffect; +} + +/** + * Define Preview property + * + * @interface PreviewParams + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Define Preview property + * + * @interface PreviewParams + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface PreviewParams { + /** + * Define Preview title + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview title + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + title?: string; + + /** + * Define Preview width + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview width + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: number; + + /** + * Define Preview height + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview height + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: number; + + /** + * Define Preview locale + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview locale + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + locale?: string; + + /** + * Define Preview colorMode + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview colorMode + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + colorMode?: string; + + /** + * Define Preview deviceType + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview deviceType + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + deviceType?: string; + + /** + * Define Preview dpi + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview dpi + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + dpi?: number; + + /** + * Define Preview orientation + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview orientation + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + orientation?: string; + + /** + * Define Preview roundScreen + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview roundScreen + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + roundScreen?: boolean; +} + +/** + * ItemDragInfo object description + * + * @interface ItemDragInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * ItemDragInfo object description + * + * @interface ItemDragInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * ItemDragInfo object description + * + * @interface ItemDragInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ItemDragInfo { + /** + * Obtains the X coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Obtains the X coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Obtains the X coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + x: number; + + /** + * Obtains the Y coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Obtains the Y coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Obtains the Y coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + y: number; +} + +/** + * Enum of using the effects template mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ +declare enum EffectType { + /** + * Define use the effects template defined by the parent effectComponent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ + DEFAULT = 0, + /** + * Define use the effects template defined by the window. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ + WINDOW_EFFECT = 1, +} + +/** + * Defines the drag status before drag action. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum PreDragStatus { + /** + * Define the status for user prepare to start long press gesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ACTION_DETECTING_STATUS = 0, + + /** + * Define the status for user can start drag action. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + READY_TO_TRIGGER_DRAG_ACTION = 1, + + /** + * Define the status for dragItem lift animation started. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PREVIEW_LIFT_STARTED = 2, + + /** + * Define the status for dragItem lift animation finished. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PREVIEW_LIFT_FINISHED = 3, + + /** + * Define the status for dragItem landing animation started. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PREVIEW_LANDING_STARTED = 4, + + /** + * Define the status for dragItem landing animation finished. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PREVIEW_LANDING_FINISHED = 5, + + /** + * Define the status for user cancel drag action. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ACTION_CANCELED_BEFORE_DRAG = 6, +} + +/** + * DragItemInfo object description + * + * @interface DragItemInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * DragItemInfo object description + * + * @interface DragItemInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +/** + * DragItemInfo object description + * + * @interface DragItemInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare interface DragItemInfo { + /** + * Uses the pixelMap object for drawing. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Uses the pixelMap object for drawing. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Uses the pixelMap object for drawing. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + pixelMap?: PixelMap; + + /** + * Uses the custom builder for drawing, if pixelMap is set, this value is ignored. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Uses the custom builder for drawing, if pixelMap is set, this value is ignored. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Uses the custom builder for drawing, if pixelMap is set, this value is ignored. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + builder?: CustomBuilder; + + /** + * Sets the extra info for drag event. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the extra info for drag event. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Sets the extra info for drag event. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + extraInfo?: string; +} + +/** + * Defining animation function. + * + * @param { AnimateParam } value + * @param { function } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining animation function. + * + * @param { AnimateParam } value + * @param { function } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining animation function. + * + * @param { AnimateParam } value + * @param { function } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining animation function. + * + * @param { AnimateParam } value + * @param { function } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function animateTo(value: AnimateParam, event: () => void): void; + +/** + * Define animation functions for immediate distribution. + * + * @param { AnimateParam } value - Set animation effect parameters. + * @param { function } event - Specify the closure function that displays dynamic effects, + * and the system will automatically insert transition animations for state changes caused by the closure function. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare function animateToImmediately(value: AnimateParam, event: () => void): void; + +/** + * Converts a value in vp units to a value in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a value in vp units to a value in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a value in vp units to a value in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a value in vp units to a value in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function vp2px(value: number): number; + +/** + * Converts a number in units of px to a number in units of vp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a number in units of px to a number in units of vp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a number in units of px to a number in units of vp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a number in units of px to a number in units of vp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function px2vp(value: number): number; + +/** + * Converts a number in fp units to a number in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a number in fp units to a number in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a number in fp units to a number in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a number in fp units to a number in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function fp2px(value: number): number; + +/** + * Converts a number in units of px to a number in units of fp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a number in units of px to a number in units of fp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a number in units of px to a number in units of fp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a number in units of px to a number in units of fp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function px2fp(value: number): number; + +/** + * Converts a number in units of lpx to a number in units of px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a number in units of lpx to a number in units of px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a number in units of lpx to a number in units of px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a number in units of lpx to a number in units of px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function lpx2px(value: number): number; + +/** + * Converts a number in units of px to a number in units of lpx. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a number in units of px to a number in units of lpx. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a number in units of px to a number in units of lpx. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a number in units of px to a number in units of lpx. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function px2lpx(value: number): number; + +/** + * Defines the namespace of focus controller. + * + * @namespace focusControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 9 + */ +/** + * Defines the namespace of focus controller. + * + * @namespace focusControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare namespace focusControl { + /** + * Request focus to the specific component by param: 'id/key'. + * + * @param { string } value + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Request focus to the specific component by param: 'id/key'. + * + * @param { string } value + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Request focus to the specific component by param: 'id/key'. + * + * @param { string } value + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + function requestFocus(value: string): boolean; +} + +/** + * Import the PointerStyle type object for setCursor. + * + * @typedef { import('../api/@ohos.multimodalInput.pointer').default.PointerStyle } PointerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Import the PointerStyle type object for setCursor. + * + * @typedef { import('../api/@ohos.multimodalInput.pointer').default.PointerStyle } PointerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare type PointerStyle = import('../api/@ohos.multimodalInput.pointer').default.PointerStyle; + +/** + * CursorControl + * + * @namespace cursorControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * CursorControl + * + * @namespace cursorControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare namespace cursorControl { + + /** + * Change the mouse cursor style by param: 'PointerStyle'. + * + * @param { PointerStyle } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Change the mouse cursor style by param: 'PointerStyle'. + * + * @param { PointerStyle } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + function setCursor(value: PointerStyle): void; + + /** + * Restore the default mouse cursor style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Restore the default mouse cursor style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + function restoreDefault(): void; +} + +/** + * Defines the event target. + * + * @interface EventTarget + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the event target. + * + * @interface EventTarget + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the event target. + * + * @interface EventTarget + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the event target. + * + * @interface EventTarget + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface EventTarget { + /** + * Area of current target. + * + * @type { Area } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Area of current target. + * + * @type { Area } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Area of current target. + * + * @type { Area } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Area of current target. + * + * @type { Area } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + area: Area; +} + +/** + * Defines the event source type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the event source type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the event source type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SourceType { + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Unknown, + + /** + * The mouse type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The mouse type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The mouse type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Mouse, + + /** + * The touch screen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The touch screen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The touch screen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TouchScreen, +} + +/** + * Defines the event tool type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the event tool type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the event tool type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SourceTool { + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Unknown, + + /** + * The finger type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The finger type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The finger type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Finger, + + /** + * The pen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The pen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The pen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Pen, + + /** + * The mouse type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + MOUSE, + + /** + * The touchpad type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TOUCHPAD, + + /** + * The joystick type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + JOYSTICK, +} + +/** + * Defines the Border Image Repeat Mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Border Image Repeat Mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Border Image Repeat Mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum RepeatMode { + /** + * Repeat mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Repeat mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Repeat mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Repeat, + + /** + * Stretch mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Stretch mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Stretch mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Stretch, + + /** + * Round mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Round mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Round mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Round, + + /** + * Space mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Space mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Space mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Space, +} + +/** + * enum Blur style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * enum Blur style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * enum Blur style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum BlurStyle { + /** + * Defines the thin card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the thin card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the thin card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Thin, + + /** + * Defines the regular card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the regular card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the regular card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Regular, + + /** + * Defines the thick card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the thick card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the thick card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Thick, + + /** + * Defines the thin background material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the thin background material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BACKGROUND_THIN, + + /** + * Defines the thin regular material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the thin regular material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BACKGROUND_REGULAR, + + /** + * Defines the thin thick material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the thin thick material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BACKGROUND_THICK, + + /** + * Defines the thin ultra thick material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the thin ultra thick material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BACKGROUND_ULTRA_THICK, + + /** + * Defines none material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines none material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + NONE, + + /** + * Defines the ultra thin component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the ultra thin component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COMPONENT_ULTRA_THIN = 8, + + /** + * Defines the thin component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the thin component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COMPONENT_THIN = 9, + + /** + * Defines the regular component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the regular component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COMPONENT_REGULAR = 10, + + /** + * Defines the thick component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the thick component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COMPONENT_THICK = 11, + + /** + * Defines the ultra thick component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the ultra thick component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COMPONENT_ULTRA_THICK = 12, +} + +/** + * Enumerates the policies for activating the blur style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare enum BlurStyleActivePolicy { + /** + * The component has the blur effect only when the window is focused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + FOLLOWS_WINDOW_ACTIVE_STATE = 0, + + /** + * The component always has the blur effect, regardless of whether the window is focused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + ALWAYS_ACTIVE = 1, + + /** + * The component does not have the blur effect, regardless of whether the window is focused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + ALWAYS_INACTIVE = 2, +} + +/** + * enum color mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * enum color mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ThemeColorMode { + /** + * Defines the mode which is follow up with system. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the mode which is follow up with system. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SYSTEM, + + /** + * Defines the light mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the light mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LIGHT, + + /** + * Defines the dark mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the dark mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DARK, +} + +/** + * Defines adaptive color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines adaptive color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum AdaptiveColor { + /** + * Defines the fixed value color adaptive mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the fixed value color adaptive mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DEFAULT, + + /** + * Defines the background average color adaptive mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the background average color adaptive mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + AVERAGE, +} + +/** + * Defines modal transition type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines modal transition type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ModalTransition { + /** + * Use default animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use default animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DEFAULT, + + /** + * Use none animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use none animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NONE, + + /** + * Use alpha animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use alpha animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ALPHA, +} + +/** + * Defines the options of backgroundBlurStyle + * + * @interface BackgroundBlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of backgroundBlurStyle + * + * @interface BackgroundBlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface BackgroundBlurStyleOptions extends BlurStyleOptions { + /** + * Defines the policy for activating the blur style. + * + * @type { ?BlurStyleActivePolicy } + * @default BlurStyleActivePolicy.ALWAYS_ACTIVE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + policy?: BlurStyleActivePolicy; + + /** + * Color of the background effect when the window is not focused. + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + inactiveColor?: ResourceColor; +} + +/** + * Defines the options of ForegroundBlurStyle + * + * @interface ForegroundBlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of ForegroundBlurStyle + * + * @interface ForegroundBlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ForegroundBlurStyleOptions extends BlurStyleOptions {} + + +/** + * Defines the options of blur + * + * @interface BlurOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the options of blur + * + * @interface BlurOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface BlurOptions { + /** + * Fuzzy gray scale parameter. + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Fuzzy gray scale parameter. + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + grayscale: [number, number]; +} + +/** + * Defines the options of blurStyle + * + * @interface BlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of blurStyle + * + * @interface BlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface BlurStyleOptions { + /** + * color mode + * + * @type { ?ThemeColorMode } + * @default ThemeColorMode.SYSTEM + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * color mode + * + * @type { ?ThemeColorMode } + * @default ThemeColorMode.SYSTEM + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + colorMode?: ThemeColorMode; + + /** + * adaptive color + * + * @type { ?AdaptiveColor } + * @default AdaptiveColor.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * adaptive color + * + * @type { ?AdaptiveColor } + * @default AdaptiveColor.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + adaptiveColor?: AdaptiveColor; + + /** + * Define the scale of blur effect. + * The range of value is [0, 1]. The larger the value, the more obvious the blurring effect. + * A value of 0 indicates no blur effect and a value of 1 indicates a complete blur effect. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + scale?: number; + + /** + * Defines the options of blur + * + * @type { ?BlurOptions } + * @default { grayScale: [0,0] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the options of blur + * + * @type { ?BlurOptions } + * @default { grayScale: [0,0] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + blurOptions?: BlurOptions; +} + +/** + * Defines the options of BackgroundEffect + * + * @interface BackgroundEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the options of BackgroundEffect + * + * @interface BackgroundEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface BackgroundEffectOptions { + + /** + * Define the radius size of BackgroundEffect.The range of this value is [0, ∞) + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the radius size of BackgroundEffect.The range of this value is [0, ∞) + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius: number; + + /** + * Define the saturation of BackgroundEffect. Value range [0, ∞) + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the saturation of BackgroundEffect. Value range [0, ∞) + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + saturation?: number; + + /** + * Define the brightness of BackgroundEffect. Value range [0, ∞) + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the brightness of BackgroundEffect. Value range [0, ∞) + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + brightness?: number; + + /** + * color the brightness of BackgroundEffect. + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * color the brightness of BackgroundEffect. + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * Define the adaptiveColor of BackgroundEffect. + * + * @type { ?AdaptiveColor } + * @default AdaptiveColor.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the adaptiveColor of BackgroundEffect. + * + * @type { ?AdaptiveColor } + * @default AdaptiveColor.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + adaptiveColor?: AdaptiveColor; + + /** + * Define the blurOptions of BackgroundEffect. + * + * @type { ?BlurOptions } + * @default { grayScale: [0,1] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the blurOptions of BackgroundEffect. + * + * @type { ?BlurOptions } + * @default { grayScale: [0,0] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + blurOptions?: BlurOptions; + + /** + * Defines the policy for activating the blur style. + * + * @type { ?BlurStyleActivePolicy } + * @default BlurStyleActivePolicy.ALWAYS_ACTIVE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + policy?: BlurStyleActivePolicy; + + /** + * Color of the background effect when the window is not focused. + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + inactiveColor?: ResourceColor; +} + +/** + * Defines the options of ForegroundEffect + * + * @interface ForegroundEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ForegroundEffectOptions { + + /** + * Define the radius size of ForegroundEffect.The range of this value is [0, ∞) + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius: number; +} + +/** + * Provide an interface for the text style of picker + * + * @interface PickerTextStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provide an interface for the text style of picker + * + * @interface PickerTextStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PickerTextStyle { + /** + * Define the text color of picker. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the text color of picker. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + + /** + * Define the text font of picker. + * Only support size and weight. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the text font of picker. + * Only support size and weight. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font?: Font; +} + +/** + * Provide an interface for the button style of picker + * + * @interface PickerDialogButtonStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface PickerDialogButtonStyle { + /** + * Describes the button style. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type?: ButtonType; + + /** + * Describes the button style. + * + * @type { ?ButtonStyleMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: ButtonStyleMode; + + /** + * Describes the button role. + * + * @type { ?ButtonRole } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + role?: ButtonRole; + + /** + * Describes the button text size. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontSize?: Length; + + /** + * Describes the button text color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontColor?: ResourceColor; + + /** + * Describes the button font weight. + * + * @type { ?(FontWeight | number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontWeight?: FontWeight | number | string; + + /** + * Describes the button font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontStyle?: FontStyle; + + /** + * Describes the button font family. + * + * @type { ?(Resource | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFamily?: Resource | string; + + /** + * Describes the button background color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Describes the button border radius. + * + * @type { ?(Length | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderRadius?: Length | BorderRadiuses; + + /** + * Define whether the button default to responding to the Enter key + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + primary?: boolean; +} + +/** + * Define the type of shadow + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define the type of shadow + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ShadowType { + /** + * Define a color type of shadow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define a color type of shadow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + COLOR, + + /** + * Define a blur type of shadow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define a blur type of shadow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BLUR, +} + +/** + * Define the options of shadow + * + * @interface ShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Define the options of shadow + * + * @interface ShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Define the options of shadow + * + * @interface ShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Define the options of shadow + * + * @interface ShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ShadowOptions { + /** + * Define the radius size of shadow + * + * @type { number | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Define the radius size of shadow + * + * @type { number | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define the radius size of shadow + * + * @type { number | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Define the radius size of shadow + * + * @type { number | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radius: number | Resource; + + /** + * Define the type of shadow + * + * @type { ?ShadowType } + * @default ShadowType.COLOR + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the type of shadow + * + * @type { ?ShadowType } + * @default ShadowType.COLOR + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type?: ShadowType; + + /** + * Define the color of shadow + * + * @type { ?(Color | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Define the color of shadow + * + * @type { ?(Color | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define the color of shadow + * + * @type { ?(Color | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Define the color or the color strategy of shadow + * + * @type { ?(Color | string | Resource| ColoringStrategy) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color?: Color | string | Resource | ColoringStrategy; + + /** + * Define the horizontal offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Define the horizontal offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define the horizontal offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Define the horizontal offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + offsetX?: number | Resource; + + /** + * Define the vertical offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Define the vertical offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define the vertical offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Define the vertical offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + offsetY?: number | Resource; + + /** + * Define whether the shadow should fill the area + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define whether the shadow should fill the area + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fill?: boolean; +} + +/** + * enum Shadow style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * enum Shadow style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ShadowStyle { + /** + * Defines the super small default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the super small default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_DEFAULT_XS, + + /** + * Defines the small default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the small default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_DEFAULT_SM, + + /** + * Defines the medium default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the medium default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_DEFAULT_MD, + + /** + * Defines the large default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the large default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_DEFAULT_LG, + + /** + * Defines the small floating shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the small floating shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_FLOATING_SM, + + /** + * Defines the medium floating shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the medium floating shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_FLOATING_MD, +} + +/** + * Defines the options of Shadow. + * + * @interface MultiShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of Shadow. + * + * @interface MultiShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MultiShadowOptions { + /** + * Current shadow radius. + * + * @type { ?(number | Resource) } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Current shadow radius. + * + * @type { ?(number | Resource) } + * @default 20 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + radius?: number | Resource; + + /** + * Current shadow offsetX. + * + * @type { ?(number | Resource) } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Current shadow offsetX. + * + * @type { ?(number | Resource) } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetX?: number | Resource; + + /** + * Current shadow offsetY + * + * @type { ?(number | Resource) } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Current shadow offsetY + * + * @type { ?(number | Resource) } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetY?: number | Resource; +} + +/** + * Enumerates the safe area types. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the safe area types. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SafeAreaType { + /** + * Default area of the system, including the status bar and navigation bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Default area of the system, including the status bar and navigation bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SYSTEM, + + /** + * Notch or punch hole. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Notch or punch hole. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CUTOUT, + + /** + * Soft keyboard area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Soft keyboard area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + KEYBOARD +} + +/** + * Enumerates the safe area edges. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the safe area edges. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SafeAreaEdge { + /** + * Top edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Top edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TOP, + + /** + * Bottom edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Bottom edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOTTOM, + + /** + * Start edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Start edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + START, + + /** + * End edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * End edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + END +} + +/** + * Enumerates the safe area types can be ignored. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum LayoutSafeAreaType { + /** + * Default area of the system, including the status bar and navigation bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SYSTEM = 0, +} + +/** + * Enumerates the safe area edges can be ignored. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum LayoutSafeAreaEdge { + /** + * Top edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TOP = 0, + + /** + * Bottom edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BOTTOM = 1, +} + +/** + * Defines sheet size type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines sheet size type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SheetSize { + /** + * Defines the sheet size medium height type. The height is half the screen height + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the sheet size medium height type. The height is half the screen height + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MEDIUM, + + /** + * Defines the sheet size large height type. The height is almost screen height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the sheet size large height type. The height is almost screen height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LARGE, + + /** + * Defines the sheet size fit content height type. The height fit content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the sheet size fit content height type. The height fit content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FIT_CONTENT = 2, +} + +/** + * Defines the base event. + * + * @interface BaseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the base event. + * + * @interface BaseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the base event. + * + * @interface BaseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the base event. + * + * @interface BaseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface BaseEvent { + /** + * Defines the current target which fires this event. + * + * @type { EventTarget } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the current target which fires this event. + * + * @type { EventTarget } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the current target which fires this event. + * + * @type { EventTarget } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the current target which fires this event. + * + * @type { EventTarget } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + target: EventTarget; + + /** + * Event timestamp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Event timestamp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Event timestamp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Event timestamp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + timestamp: number; + + /** + * the event source info. + * + * @type { SourceType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * the event source info. + * + * @type { SourceType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * the event source info. + * + * @type { SourceType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * the event source info. + * + * @type { SourceType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + source: SourceType; + + /** + * the Horizontal axis coordinate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + axisHorizontal?: number; + + /** + * the Vertical axis coordinate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + axisVertical?: number; + + /** + * Touch pressure. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Touch pressure. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Touch pressure. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + pressure: number; + + /** + * The angle between pencil projection on plane-X-Y and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The angle between pencil projection on plane-X-Y and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The angle between pencil projection on plane-X-Y and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + tiltX: number; + + /** + * The angle between pencil projection on plane-Y-Z and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The angle between pencil projection on plane-Y-Z and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The angle between pencil projection on plane-Y-Z and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + tiltY: number; + + /** + * The event tool type info. + * + * @type { SourceTool } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The event tool type info. + * + * @type { SourceTool } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The event tool type info. + * + * @type { SourceTool } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + sourceTool: SourceTool; + + /** + * Query the ModifierKey press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the keys of the ModifierKey. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getModifierKeyState?(keys: Array): boolean; + + /** + * Indicates the ID of the input device that triggers the current event. + * + * @type { ?number } [deviceId] The ID of the input device that triggers the current event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + deviceId?: number; +} + +/** + * Border image option + * + * @interface BorderImageOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Border image option + * + * @interface BorderImageOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Border image option + * + * @interface BorderImageOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface BorderImageOption { + /** + * Border image slice + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image slice + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image slice + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border image slice + * + * @type { ?(Length | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + slice?: Length | EdgeWidths | LocalizedEdgeWidths, + + /** + * Border image repeat + * + * @type { ?RepeatMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image repeat + * + * @type { ?RepeatMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image repeat + * + * @type { ?RepeatMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + repeat?: RepeatMode, + + /** + * Border image source + * + * @type { ?(string | Resource | LinearGradient) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image source + * + * @type { ?(string | Resource | LinearGradient) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image source + * + * @type { ?(string | Resource | LinearGradient) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + source?: string | Resource | LinearGradient, + + /** + * Border image width + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image width + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image width + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border image width + * + * @type { ?(Length | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + width?: Length | EdgeWidths | LocalizedEdgeWidths, + + /** + * Border image outset + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image outset + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image outset + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border image outset + * + * @type { ?(Length | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outset?: Length | EdgeWidths | LocalizedEdgeWidths, + + /** + * Border image center fill + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image center fill + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image center fill + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fill?: boolean +} + +/** + * The tap action triggers this method invocation. + * + * @interface ClickEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The tap action triggers this method invocation. + * + * @interface ClickEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * The tap action triggers this method invocation. + * + * @interface ClickEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * The tap action triggers this method invocation. + * + * @interface ClickEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ClickEvent extends BaseEvent { + /** + * X coordinate of the click point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the click point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + displayX: number; + + /** + * Y coordinate of the click point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the click point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + displayY: number; + + /** + * X coordinate of the click point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the click point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + windowX: number; + + /** + * Y coordinate of the click point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the click point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + windowY: number; + + /** + * X coordinate of the click point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead ClickEvent#windowX + */ + screenX: number; + + /** + * Y coordinate of the click point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead ClickEvent#windowY + */ + screenY: number; + + /** + * X coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * X coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * X coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * X coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x: number; + + /** + * Y coordinate of the click point relative to the upper edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Y coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Y coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Y coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y: number; + + /** + * Prevent the default function. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preventDefault: () => void; +} + +/** + * The hover action triggers this method invocation. + * + * @interface HoverEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * The hover action triggers this method invocation. + * + * @interface HoverEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface HoverEvent extends BaseEvent { + /** + * The blocking hover event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The blocking hover event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + stopPropagation: () => void; +} + +/** + * The mouse click action triggers this method invocation. + * + * @interface MouseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The mouse click action triggers this method invocation. + * + * @interface MouseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface MouseEvent extends BaseEvent { + /** + * Mouse button of the click event. + * + * @type { MouseButton } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse button of the click event. + * + * @type { MouseButton } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + button: MouseButton; + + /** + * Mouse action of the click event. + * + * @type { MouseAction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse action of the click event. + * + * @type { MouseAction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + action: MouseAction; + + /** + * X coordinate of the mouse point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * X coordinate of the mouse point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + displayX: number; + + /** + * Y coordinate of the mouse point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Y coordinate of the mouse point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + displayY: number; + + /** + * X coordinate of the mouse point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * X coordinate of the mouse point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + windowX: number; + + /** + * Y coordinate of the mouse point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Y coordinate of the mouse point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + windowY: number; + + /** + * X coordinate of the mouse point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + * @useinstead MouseEvent#windowX + */ + screenX: number; + + /** + * Y coordinate of the mouse point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + * @useinstead MouseEvent#windowY + */ + screenY: number; + + /** + * X coordinate of the mouse point relative to the left edge of the mouse hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * X coordinate of the mouse point relative to the left edge of the mouse hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + x: number; + + /** + * Y coordinate of the mouse point relative to the upper edge of the mouse hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Y coordinate of the mouse point relative to the upper edge of the mouse hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + y: number; + + /** + * The blocking event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The blocking event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + stopPropagation: () => void; +} + +/** + * The accessibility hover action triggers this method invocation. + * + * @typedef AccessibilityHoverEvent + * @extends BaseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface AccessibilityHoverEvent extends BaseEvent { + /** + * Type of the accessibility hover event. + * + * @type { AccessibilityHoverType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + type: AccessibilityHoverType; + + /** + * X coordinate of the accessibility hover point relative to the left edge of the event hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + x: number; + + /** + * Y coordinate of the accessibility hover point relative to the upper edge of the event hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + y: number; + + /** + * X coordinate of the accessibility hover point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + displayX: number; + + /** + * Y coordinate of the accessibility hover point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + displayY: number; + + /** + * X coordinate of the accessibility hover point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + windowX: number; + + /** + * Y coordinate of the accessibility hover point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + windowY: number; +} + +/** + * Type of the touch event. + * + * @interface TouchObject + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Type of the touch event. + * + * @interface TouchObject + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Type of the touch event. + * + * @interface TouchObject + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TouchObject { + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type: TouchType; + + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + id: number; + + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + displayX: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + displayY: number; + + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + windowX: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + windowY: number; + + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead TouchObject#windowX + */ + screenX: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead TouchObject#windowY + */ + screenY: number; + + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + x: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + y: number; +} + +/** + * TouchObject getHistoricalPoints Function Parameters + * + * @interface HistoricalPoint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * TouchObject getHistoricalPoints Function Parameters + * + * @interface HistoricalPoint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface HistoricalPoint { + /** + * The base touchObject information of historicalPoint + * + * @type { TouchObject } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The base touchObject information of historicalPoint + * + * @type { TouchObject } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + touchObject: TouchObject; + + /** + * Contact area between the finger pad and the screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Contact area between the finger pad and the screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size: number; + + /** + * Pressure of the touch event. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pressure of the touch event. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + force: number; + + /** + * Timestamp of the touch event. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Timestamp of the touch event. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + timestamp: number; +} + +/** + * Touch Action Function Parameters + * + * @interface TouchEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Touch Action Function Parameters + * + * @interface TouchEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Touch Action Function Parameters + * + * @interface TouchEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TouchEvent extends BaseEvent { + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type: TouchType; + + /** + * All finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * All finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * All finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + touches: TouchObject[]; + + /** + * Indicates the current changed finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates the current changed finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates the current changed finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + changedTouches: TouchObject[]; + + /** + * The blocking event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The blocking event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The blocking event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stopPropagation: () => void; + + /** + * Get the historical points. + * + * @returns { Array } - return all historical points. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the historical points. + * + * @returns { Array } - return all historical points. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getHistoricalPoints(): Array; + + /** + * Prevent the default function. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preventDefault: () => void; +} + +/** + * Defines the callback type used in onSizeChange. + * The value of oldValue is last size of the component. + * The value of newValue is new size of the component. + * + * @typedef { function } SizeChangeCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type SizeChangeCallback = (oldValue: SizeOptions, newValue: SizeOptions) => void; + +/** + * Defines the callback type used in onGestureRecognizerJudgeBegin. + * + * @typedef { function } GestureRecognizerJudgeBeginCallback + * @param { BaseGestureEvent } event - the event information + * @param { GestureRecognizer } current - the current gesture recognizer of the component + * @param { Array } recognizers - the gesture recognizers of the component on the response chain + * @returns { GestureJudgeResult } the gesture judge result + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type GestureRecognizerJudgeBeginCallback = (event: BaseGestureEvent, current: GestureRecognizer, recognizers: Array) => GestureJudgeResult; + +/** + * Defines the callback type used in shouldBuiltInRecognizerParallelWith. + * + * @typedef { function } ShouldBuiltInRecognizerParallelWithCallback + * @param { GestureRecognizer } current - the current gesture recognizer of the component + * @param { Array } others - the gesture recognizers of the component on the response chain + * @returns { GestureRecognizer } gesture recognizer of the component + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ShouldBuiltInRecognizerParallelWithCallback = (current: GestureRecognizer, others: Array) => GestureRecognizer; + +/** + * Defines the finish callback type used in transition. + * + * @typedef { function } TransitionFinishCallback + * @param { boolean } transitionIn - a boolean value indicates whether it is the callback of transitionIn or transitionOut. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type TransitionFinishCallback = (transitionIn: boolean) => void; + +/** + * Defines the PixelMap type object for ui component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the PixelMap type object for ui component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the PixelMap type object for ui component. + * + * @typedef { import('../api/@ohos.multimedia.image').default.PixelMap } PixelMap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type PixelMap = import('../api/@ohos.multimedia.image').default.PixelMap; + +/** + * pixelmap object with release function. + * + * @interface PixelMapMock + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare interface PixelMapMock { + /** + * release function. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + release(): void; +} + +/** + * Enum for Drag Behavior. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enum for Drag Behavior. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum DragBehavior { + /** + * If drag use copy event, then set DragBehavior.COPY. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If drag use copy event, then set DragBehavior.COPY. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + COPY, + /** + * If drag use move event, then set DragBehavior.MOVE. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If drag use move event, then set DragBehavior.MOVE. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + MOVE +} + +/** + * Import the UnifiedData type object for ui component. + * + * @typedef { import('../api/@ohos.data.unifiedDataChannel').default.UnifiedData } UnifiedData + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Import the UnifiedData type object for ui component. + * + * @typedef { import('../api/@ohos.data.unifiedDataChannel').default.UnifiedData } UnifiedData + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type UnifiedData = import('../api/@ohos.data.unifiedDataChannel').default.UnifiedData; + +/** + * Import the Summary type object for ui component. + * + * @typedef { import('../api/@ohos.data.unifiedDataChannel').default.Summary } Summary + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Import the Summary type object for ui component. + * + * @typedef { import('../api/@ohos.data.unifiedDataChannel').default.Summary } Summary + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type Summary = import('../api/@ohos.data.unifiedDataChannel').default.Summary; + +/** + * Import the UniformDataType type object for ui component. + * + * @typedef { import('../api/@ohos.data.uniformTypeDescriptor').default.UniformDataType } UniformDataType + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Import the UniformDataType type object for ui component. + * + * @typedef { import('../api/@ohos.data.uniformTypeDescriptor').default.UniformDataType } UniformDataType + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type UniformDataType = import('../api/@ohos.data.uniformTypeDescriptor').default.UniformDataType; + +/** + * Enum for Drag Result. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enum for Drag Result. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +/** + * Enum for Drag Result. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare enum DragResult { + /** + * If the drag is successful, return DragResult.DRAG_SUCCESSFUL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If the drag is successful, return DragResult.DRAG_SUCCESSFUL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * If the drag is successful, return DragResult.DRAG_SUCCESSFUL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + DRAG_SUCCESSFUL = 0, + /** + * If drag fail, return DragResult.DRAG_FAILED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If drag fail, return DragResult.DRAG_FAILED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * If drag fail, return DragResult.DRAG_FAILED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + DRAG_FAILED = 1, + /** + * If drag action cancel, return DragResult.DRAG_CANCELED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If drag action cancel, return DragResult.DRAG_CANCELED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + DRAG_CANCELED = 2, + /** + * If node allow drop in, return DragResult.DROP_ENABLED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If node allow drop in, return DragResult.DROP_ENABLED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + DROP_ENABLED = 3, + /** + * If node don't allow drop in, return DragResult.DROP_DISABLED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If node don't allow drop in, return DragResult.DROP_DISABLED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + DROP_DISABLED = 4 +} + +/** + * Enum for BlendMode. + * Blend modes for compositing current component + * with overlapping content. Use overlapping content + * as dst, current component as src. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Enum for BlendMode. + * Blend modes for compositing current component + * with overlapping content. Use overlapping content + * as dst, current component as src. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum BlendMode { + /** + * Hybrid mode does not take effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Hybrid mode does not take effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NONE = 0, + /** + * Clear destination color covered by the source to 0. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Clear destination color covered by the source to 0. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + CLEAR = 1, + /** + * r = s + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SRC = 2, + /** + * r = d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DST = 3, + /** + * r = s + (1 - sa) * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s + (1 - sa) * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SRC_OVER = 4, + /** + * r = d + (1 - da) * s + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = d + (1 - da) * s + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DST_OVER = 5, + /** + * r = s * da + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * da + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SRC_IN = 6, + /** + * r = d * sa + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = d * sa + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DST_IN = 7, + /** + * r = s * (1 - da) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * (1 - da) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SRC_OUT = 8, + /** + * r = d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DST_OUT = 9, + /** + * r = s * da + d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * da + d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SRC_ATOP = 10, + /** + * r = d * sa + s * (1 - da) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = d * sa + s * (1 - da) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DST_ATOP = 11, + /** + * r = s * (1 - da) + d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * (1 - da) + d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + XOR = 12, + /** + * r = min(s + d, 1) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = min(s + d, 1) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + PLUS = 13, + /** + * r = s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + MODULATE = 14, + /** + * r = s + d - s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s + d - s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SCREEN = 15, + /** + * multiply or screen, depending on destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * multiply or screen, depending on destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + OVERLAY = 16, + /** + * rc = s + d - max(s * da, d * sa), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * rc = s + d - max(s * da, d * sa), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DARKEN = 17, + /** + * rc = s + d - min(s * da, d * sa), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * rc = s + d - min(s * da, d * sa), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + LIGHTEN = 18, + /** + * brighten destination to reflect source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * brighten destination to reflect source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COLOR_DODGE = 19, + /** + * darken destination to reflect source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * darken destination to reflect source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COLOR_BURN = 20, + /** + * multiply or screen, depending on source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * multiply or screen, depending on source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + HARD_LIGHT = 21, + /** + * lighten or darken, depending on source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * lighten or darken, depending on source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SOFT_LIGHT = 22, + /** + * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DIFFERENCE = 23, + /** + * rc = s + d - two(s * d), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * rc = s + d - two(s * d), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + EXCLUSION = 24, + /** + * r = s * (1 - da) + d * (1 - sa) + s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * (1 - da) + d * (1 - sa) + s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + MULTIPLY = 25, + /** + * hue of source with saturation and luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * hue of source with saturation and luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + HUE = 26, + /** + * saturation of source with hue and luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * saturation of source with hue and luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SATURATION = 27, + /** + * hue and saturation of source with luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * hue and saturation of source with luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COLOR = 28, + /** + * luminosity of source with hue and saturation of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * luminosity of source with hue and saturation of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + LUMINOSITY = 29 +} + +/** + * Enum for BlendApplyType. + * Indicate how to apply specified blend mode to + * the view's content. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Enum for BlendApplyType. + * Indicate how to apply specified blend mode to + * the view's content. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum BlendApplyType { + /** + * Blend view's content in sequence over dst + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Blend view's content in sequence over dst + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + FAST = 0, + + /** + * Composite this views's contents into an + * offscreen image and then blend over dst + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Composite this views's contents into an + * offscreen image and then blend over dst + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + OFFSCREEN = 1, +} + +/** + * DragEvent object description + * + * @interface DragEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * DragEvent object description + * + * @interface DragEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +/** + * DragEvent object description + * + * @interface DragEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare interface DragEvent { + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getDisplayX(): number; + + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getDisplayY(): number; + + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getWindowX(): number; + + /** + * Y coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Y coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getWindowY(): number; + + /** + * X coordinate of the touch point relative to the left edge of the current window. in vp. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead DragEvent#getWindowX + */ + getX(): number; + + /** + * Y coordinate of the touch point relative to the left edge of the current window. in vp. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead DragEvent#getWindowY + */ + getY(): number; + + /** + * If copy is COPY, this DragEvent is a copy event. + * @type { DragBehavior } Operation, if use copy then set COPY, else set MOVE. + * @default COPY + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If copy is COPY, this DragEvent is a copy event. + * @type { DragBehavior } Operation, if use copy then set COPY, else set MOVE. + * @default COPY + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + dragBehavior: DragBehavior; + + /** + * If useCustomDropAnimation is true, System will not use drop animation. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If useCustomDropAnimation is true, System will not use drop animation. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + useCustomDropAnimation: boolean; + + /** + * Set dragData into DragEvent. + * + * @param { UnifiedData } unifiedData - dragData. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set dragData into DragEvent. + * + * @param { UnifiedData } unifiedData - dragData. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setData(unifiedData: UnifiedData): void; + + /** + * Get dragData from DragEvent. + * + * @returns { UnifiedData } - get dragData. + * @throws { BusinessError } 190001 - Data not found. + * @throws { BusinessError } 190002 - Data error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get dragData from DragEvent. + * + * @returns { UnifiedData } - get dragData. + * @throws { BusinessError } 190001 - Data not found. + * @throws { BusinessError } 190002 - Data error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getData(): UnifiedData; + + /** + * Get dragData summary from DragEvent. + * + * @returns { Summary } - get Summary Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get dragData summary from DragEvent. + * + * @returns { Summary } - get Summary Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getSummary(): Summary; + + /** + * Set dragEvent result to DragEvent. + * + * @param { DragResult } dragResult - the return of dragEvent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set dragEvent result to DragEvent. + * + * @param { DragResult } dragResult - the return of dragEvent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Set dragEvent result to DragEvent. + * + * @param { DragResult } dragResult - the return of dragEvent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + setResult(dragResult: DragResult): void; + + /** + * Get dragEvent result from DragEvent. + * + * @returns { DragResult } - dragResult Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get dragEvent result from DragEvent. + * + * @returns { DragResult } - dragResult Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Get dragEvent result from DragEvent. + * + * @returns { DragResult } - dragResult Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getResult(): DragResult; + + /** + * Get the rectangle of drag window. + * + * @returns { Rectangle } - getPreview rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get the rectangle of drag window. + * + * @returns { Rectangle } - getPreview rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Get the rectangle of drag window. + * + * @returns { Rectangle } - getPreview rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getPreviewRect(): Rectangle; + + /** + * Get the x axis velocity of drag gesture. + * + * @returns { number } - get x axis velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the x axis velocity of drag gesture. + * + * @returns { number } - get x axis velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getVelocityX(): number; + + /** + * Get the y axis velocity of drag gesture. + * + * @returns { number } - get y axis velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the y axis velocity of drag gesture. + * + * @returns { number } - get y axis velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getVelocityY(): number; + + /** + * Get the velocity of drag gesture. + * + * @returns { number } - get velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the velocity of drag gesture. + * + * @returns { number } - get velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getVelocity(): number; + + /** + * Query the ModifierKey press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the keys of the ModifierKey. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + /** + * Query the ModifierKey press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the keys of the ModifierKey. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getModifierKeyState?(keys: Array): boolean; +} + +/** + * Import the IntentionCode type object for IntentionCode. + * + * @typedef { import('../api/@ohos.multimodalInput.intentionCode').IntentionCode } IntentionCode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Import the IntentionCode type object for IntentionCode. + * + * @typedef { import('../api/@ohos.multimodalInput.intentionCode').IntentionCode } IntentionCode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type IntentionCode = import('../api/@ohos.multimodalInput.intentionCode').IntentionCode; + +/** + * KeyEvent object description: + * + * @interface KeyEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * KeyEvent object description: + * + * @interface KeyEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * KeyEvent object description: + * + * @interface KeyEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface KeyEvent { + /** + * Type of a key. + * + * @type { KeyType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Type of a key. + * + * @type { KeyType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Type of a key. + * + * @type { KeyType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type: KeyType; + + /** + * Key code of a key + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Key code of a key + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Key code of a key + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + keyCode: number; + + /** + * Key value of a key. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Key value of a key. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Key value of a key. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + keyText: string; + + /** + * Type of the input device that triggers the current key, such as the keyboard or handle. + * + * @type { KeySource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Type of the input device that triggers the current key, such as the keyboard or handle. + * + * @type { KeySource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Type of the input device that triggers the current key, such as the keyboard or handle. + * + * @type { KeySource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + keySource: KeySource; + + /** + * Indicates the ID of the input device that triggers the current key. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates the ID of the input device that triggers the current key. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates the ID of the input device that triggers the current key. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + deviceId: number; + + /** + * Indicates the status of the key when the key is pressed. + * The value 1 indicates the pressed state, and the value 0 indicates the unpressed state. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates the status of the key when the key is pressed. + * The value 1 indicates the pressed state, and the value 0 indicates the unpressed state. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates the status of the key when the key is pressed. + * The value 1 indicates the pressed state, and the value 0 indicates the unpressed state. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + metaKey: number; + + /** + * Timestamp when the key was pressed. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Timestamp when the key was pressed. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Timestamp when the key was pressed. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + timestamp: number; + + /** + * Block event bubbling. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Block event bubbling. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Block event bubbling. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stopPropagation: () => void; + + /** + * Intention code of a key or modifier keys. + * + * @type { IntentionCode } + * @default IntentionCode.INTENTION_UNKNOWN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Intention code of a key or modifier keys. + * + * @type { IntentionCode } + * @default IntentionCode.INTENTION_UNKNOWN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + intentionCode: IntentionCode; + + /** + * Get the modifier keys press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the modifier keys. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + /** + * Get the modifier keys press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the modifier keys. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getModifierKeyState?(keys: Array): boolean; + + /** + * Unicode of a key + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ + unicode?: number; +} + +/** + * Overlay module options + * + * @interface BindOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Overlay module options + * + * @interface BindOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface BindOptions { + /** + * Defines the background color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the background color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundColor?: ResourceColor; + + /** + * Callback function when overlay interface appears + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when overlay interface appears + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAppear?: () => void; + + /** + * Callback function when overlay interface exits + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when overlay interface exits + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onDisappear?: () => void; + + /** + * Callback function before overlay animation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillAppear?: () => void; + + /** + * Callback function before overlay popAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDisappear?: () => void; +} + +/** + * Component content cover dismiss + * + * @interface DismissContentCoverAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DismissContentCoverAction { + /** + * Defines content cover dismiss function + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: Callback; + + /** + * Defines content cover dismiss reason + * + * @type { DismissReason } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reason: DismissReason; +} + +/** + * Component content cover options + * + * @interface ContentCoverOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Component content cover options + * + * @interface ContentCoverOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ContentCoverOptions extends BindOptions { + /** + * Defines transition type + * + * @type { ?ModalTransition } + * @default ModalTransition.Default + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines transition type + * + * @type { ?ModalTransition } + * @default ModalTransition.Default + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + modalTransition?: ModalTransition, + + /** + * Callback function when the content cover interactive dismiss + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: Callback; + + /** + * Defines transition effect param + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; +} + +/** + * Component sheet title options + * + * @interface SheetTitleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Component sheet title options + * + * @interface SheetTitleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SheetTitleOptions { + /** + * Defines title text + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines title text + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + title: ResourceStr; + + /** + * Defines subtitle text + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines subtitle text + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + subtitle?: ResourceStr; +} + +/** + * Defines the sheet type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the sheet type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum SheetType { + /** + * Defines bottom sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines bottom sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BOTTOM = 0, + + /** + * Defines center sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines center sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CENTER = 1, + + /** + * Defines popup sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines popup sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + POPUP = 2, +} + +/** + * Define the display mode of the sheet. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum SheetMode { + /** + * Sheet displays above all page levels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + OVERLAY = 0, + + /** + * Sheet displays within the current page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + EMBEDDED = 1, +} + +/** + * Define the scroll size mode of the sheet. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum ScrollSizeMode { + /** + * Sheet change scroll size after the slide ends. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLLOW_DETENT = 0, + + /** + * Sheet change scroll size during the sliding process. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CONTINUOUS = 1, +} + +/** + * Define the mode of sheet how to avoid keyboard. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare enum SheetKeyboardAvoidMode { + /** + * Sheet will not aovid keyboard. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + NONE = 0, + + /** + * Firstly sheet will avoid keyboard by changing its height. + * And then sheet will avoid by resizing after reaching its maximum height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + TRANSLATE_AND_RESIZE = 1, + + /** + * Sheet will only avoid keyboard by resizing the content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + RESIZE_ONLY = 2, + + /** + * Firstly sheet will avoid keyboard by changing its height. + * And then sheet will avoid keyboard by scrolling after reaching its maximum height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + TRANSLATE_AND_SCROLL = 3, +} + +/** + * Component sheet dismiss + * + * @interface SheetDismiss + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Component sheet dismiss + * + * @interface SheetDismiss + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SheetDismiss { + /** + * Defines sheet dismiss function + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines sheet dismiss function + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: () => void; +} + +/** + * Component sheet dismiss + * + * @interface DismissSheetAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DismissSheetAction { + + /** + * Defines sheet dismiss function + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: Callback; + + /** + * Dismiss reason type. + * + * @type { DismissReason } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reason: DismissReason; +} + +/** + * Defines sheet spring back action + * + * @interface SpringBackAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SpringBackAction { + /** + * Defines spring back function + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + springBack: Callback; +} + +/** + * Component sheet options + * + * @interface SheetOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Component sheet options + * + * @interface SheetOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SheetOptions extends BindOptions { + /** + * Defines sheet height + * + * @type { ?(SheetSize | Length) } + * @default Sheet.LARGE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines sheet height + * + * @type { ?(SheetSize | Length) } + * @default Sheet.LARGE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + height?: SheetSize | Length; + + /** + * Defines whether the control bar is displayed. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines whether the control bar is displayed. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + dragBar?: boolean; + + /** + * Defines sheet maskColor + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines sheet maskColor + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maskColor?: ResourceColor; + + /** + * Defines sheet detents + * + * @type { ?[(SheetSize | Length), (SheetSize | Length)?, (SheetSize | Length)?] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines sheet detents + * + * @type { ?[(SheetSize | Length), (SheetSize | Length)?, (SheetSize | Length)?] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + detents?: [(SheetSize | Length), (SheetSize | Length)?, (SheetSize | Length)?]; + + /** + * Defines sheet background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines sheet background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + blurStyle?: BlurStyle; + + /** + * Defines whether the close icon is displayed + * + * @type { ?(boolean | Resource) } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines whether the close icon is displayed + * + * @type { ?(boolean | Resource) } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showClose?: boolean | Resource; + + /** + * Defines the sheet prefer type + * + * @type { ?(SheetType.CENTER | SheetType.POPUP) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the sheet prefer type + * + * @type { ?SheetType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preferType?: SheetType; + + /** + * Defines the sheet title + * + * @type { ?(SheetTitleOptions | CustomBuilder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the sheet title + * + * @type { ?(SheetTitleOptions | CustomBuilder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + title?: SheetTitleOptions | CustomBuilder; + + /** + * Callback function when the sheet interactive dismiss + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Callback function when the sheet interactive dismiss + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shouldDismiss?: (sheetDismiss: SheetDismiss) => void; + + /** + * Callback function when the sheet will dismiss + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: Callback; + + /** + * Sheet springs back callback when dismiss + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillSpringBackWhenDismiss?: Callback; + + /** + * Set whether interaction is allowed outside the sheet + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set whether interaction is allowed outside the sheet + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableOutsideInteractive?: boolean; + + /** + * Defines the sheet's width. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width?: Dimension; + + /** + * Defines the sheet's border width. + * + * @type { ?(Dimension | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderWidth?: Dimension | EdgeWidths | LocalizedEdgeWidths; + + /** + * Defines the sheet's border color. + * + * @type { ?(ResourceColor | EdgeColors | LocalizedEdgeColors) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderColor?: ResourceColor | EdgeColors | LocalizedEdgeColors; + + /** + * Defines the sheet's border style. + * + * @type { ?(BorderStyle | EdgeStyles) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderStyle?: BorderStyle | EdgeStyles; + + /** + * Defines the sheet's shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Called when height of the sheet is changed + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onHeightDidChange?: Callback; + + /** + * Determine the level sheet shows, whether sheet should be displayed within the page + * + * @type { ?SheetMode } + * @default SheetMode.OVERLAY + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + mode?: SheetMode; + + /** + * Determine sheet scroll size mode. + * + * @type { ?ScrollSizeMode } + * @default ScrollSizeMode.FELLOW_DETEND + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scrollSizeMode?: ScrollSizeMode; + + /** + * Called when detents of the sheet changed + * + * @type { ?Callback } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDetentsDidChange?: Callback; + + /** + * Called when width of the sheet changed + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWidthDidChange?: Callback; + + /** + * Called when the sheet type changed + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onTypeDidChange?: Callback; + + /** + * The UIContext that the sheet belongs to + * + * @type { ?UIContext } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + uiContext?: UIContext; + + /** + * Determine the mode of sheet how to avoid keyboard. + * + * @type { ?SheetKeyboardAvoidMode } + * @default SheetKeyboardAvoidMode.TRANSLATE_AND_SCROLL + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + keyboardAvoidMode?: SheetKeyboardAvoidMode; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the sheet's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; + + /** + * Sets the position offset of the bindSheet. + * + * @type { ?Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + offset?: Position +} + +/** + * Component State Styles. + * + * @interface StateStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Component State Styles. + * + * @interface StateStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Component State Styles. + * + * @interface StateStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Component State Styles. + * + * @interface StateStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface StateStyles { + /** + * Defines normal state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines normal state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines normal state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines normal state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + normal?: any; + + /** + * Defines pressed state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines pressed state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines pressed state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines pressed state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + pressed?: any; + + /** + * Defines disabled state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines disabled state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines disabled state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines disabled state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + disabled?: any; + + /** + * Defines focused state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines focused state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines focused state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines focused state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + focused?: any; + + /** + * Defines clicked state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines clicked state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines clicked state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines clicked state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + clicked?: any; + + /** + * Defines selected state styles. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines selected state styles. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selected?: object; +} + +/** + * Defines the options of popup message. + * + * @interface PopupMessageOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of popup message. + * + * @interface PopupMessageOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PopupMessageOptions { + /** + * Sets the color of popup text. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the color of popup text. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textColor?: ResourceColor; + + /** + * Sets the font of popup text. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the font of popup text. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font?: Font; +} + +/** + * Dismiss reason type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum DismissReason { + /** + * Press back + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PRESS_BACK = 0, + + /** + * Touch component outside + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TOUCH_OUTSIDE = 1, + + /** + * Close button + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CLOSE_BUTTON = 2, + + /** + * Slide down + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SLIDE_DOWN = 3 +} + +/** + * Component popup dismiss + * + * @interface DismissPopupAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DismissPopupAction { + /** + * Defines popup dismiss function + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: Callback; + + /** + * Defines popup dismiss reason + * + * @type { DismissReason } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reason: DismissReason; +} + +/** + * Defines the popup options. + * + * @interface PopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the popup options. + * + * @interface PopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the popup options. + * + * @interface PopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PopupOptions { + /** + * Information in the pop-up window. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Information in the pop-up window. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Information in the pop-up window. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + message: string; + + /** + * placement On Top + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead PopupOptions#placement + */ + placementOnTop?: boolean; + + /** + * The placement of popup. + * Supports all positions defined in Placement. + * + * @type { ?Placement } + * @default Placement.Bottom + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The placement of popup. + * Supports all positions defined in Placement. + * + * @type { ?Placement } + * @default Placement.Bottom + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placement?: Placement; + + /** + * The first button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The first button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The first button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + primaryButton?: { + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string; + + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + action: () => void; + }; + + /** + * The second button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The second button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The second button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + secondaryButton?: { + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string; + + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + action: () => void; + }; + + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onStateChange?: (event: { + /** + * is Visible. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * is Visible. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + isVisible: boolean + }) => void; + + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowOffset?: Length; + + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showInSubWindow?: boolean; + + /** + * The mask to block gesture events of popup. + * When mask is set false, gesture events are not blocked. + * When mask is set true, gesture events are blocked and mask color is transparent. + * + * @type { ?(boolean | { color: ResourceColor }) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The mask to block gesture events of popup. + * When mask is set false, gesture events are not blocked. + * When mask is set true, gesture events are blocked and mask color is transparent. + * + * @type { ?(boolean | { color: ResourceColor }) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + mask?: boolean | { color: ResourceColor }; + + /** + * Sets the options of popup message. + * + * @type { ?PopupMessageOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the options of popup message. + * + * @type { ?PopupMessageOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + messageOptions?: PopupMessageOptions + + /** + * Sets the space of between the popup and target. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the space of between the popup and target. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + targetSpace?: Length + + /** + * whether show arrow + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * whether show arrow + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableArrow?: boolean; + /** + * Sets the position offset of the popup. + * + * @type { ?Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the position offset of the popup. + * + * @type { ?Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Position + + /** + * Set the background color of the popup. + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the background color of the popup. + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + popupColor?: Color | string | Resource | number; + + /** + * Whether hide popup when click mask + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether hide popup when click mask + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + autoCancel?: boolean; + + /** + * Set the width of the popup. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the width of the popup. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width?: Dimension; + + /** + * The position of the sharp corner of popup. + * + * @type { ?ArrowPointPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The position of the sharp corner of popup. + * + * @type { ?ArrowPointPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowPointPosition?: ArrowPointPosition; + + /** + * The width of the arrow. + * + * @type { ?Dimension } + * @default 16.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The width of the arrow. + * + * @type { ?Dimension } + * @default 16.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowWidth?: Dimension; + + /** + * The height of the arrow. + * + * @type { ?Dimension } + * @default 8.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The height of the arrow. + * + * @type { ?Dimension } + * @default 8.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowHeight?: Dimension; + + /** + * The round corners of the popup. + * + * @type { ?Dimension } + * @default 20.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The round corners of the popup. + * + * @type { ?Dimension } + * @default 20.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius?: Dimension; + + /** + * The style of popup Shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @default ShadowStyle.OUTER_DEFAULT_MD. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The style of popup Shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @default ShadowStyle.OUTER_DEFAULT_MD. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Defines popup background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines popup background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Defines the transition effect of popup opening and closing + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Callback function when the popup interactive dismiss + * + * @type { ?(boolean | Callback) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: boolean | Callback; + + /** + * Determine if it is compatible popup's half folded. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHoverMode?: boolean; + + /** + * Determine if popup can follow the target node when it has rotation or scale. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + followTransformOfTarget?: boolean; +} + +/** + * Defines the custom popup options. + * + * @interface CustomPopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the custom popup options. + * + * @interface CustomPopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the custom popup options. + * + * @interface CustomPopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface CustomPopupOptions { + /** + * builder of popup + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * builder of popup + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * builder of popup + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + builder: CustomBuilder; + + /** + * placement of popup + * + * @type { ?Placement } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * placement of popup + * + * @type { ?Placement } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * placement of popup + * + * @type { ?Placement } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placement?: Placement; + + /** + * mask color of popup + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + * @useinstead CustomPopupOptions#mask + */ + maskColor?: Color | string | Resource | number; + + /** + * background color of popup + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * background color of popup + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * background color of popup + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popupColor?: Color | string | Resource | number; + + /** + * whether show arrow + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * whether show arrow + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * whether show arrow + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableArrow?: boolean; + + /** + * whether hide popup when click mask + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * whether hide popup when click mask + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * whether hide popup when click mask + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + autoCancel?: boolean; + + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onStateChange?: (event: { + /** + * is Visible. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * is Visible. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + isVisible: boolean + }) => void; + + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowOffset?: Length; + + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showInSubWindow?: boolean; + + /** + * The mask to block gesture events of popup. + * When mask is set false, gesture events are not blocked. + * When mask is set true, gesture events are blocked and mask color is transparent. + * + * @type { ?(boolean | { color: ResourceColor }) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The mask to block gesture events of popup. + * When mask is set false, gesture events are not blocked. + * When mask is set true, gesture events are blocked and mask color is transparent. + * + * @type { ?(boolean | { color: ResourceColor }) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + mask?: boolean | { color: ResourceColor }; + + /** + * Sets the space of between the popup and target. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the space of between the popup and target. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + targetSpace?: Length + + /** + * Sets the position offset of the popup. + * + * @type { ?Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the position offset of the popup. + * + * @type { ?Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Position + + /** + * Set the width of the popup. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the width of the popup. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width?: Dimension; + + /** + * The position of the sharp corner of popup. + * + * @type { ?ArrowPointPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The position of the sharp corner of popup. + * + * @type { ?ArrowPointPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowPointPosition?: ArrowPointPosition; + + /** + * The width of the arrow. + * + * @type { ?Dimension } + * @default 16.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The width of the arrow. + * + * @type { ?Dimension } + * @default 16.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowWidth?: Dimension; + + /** + * The height of the arrow. + * + * @type { ?Dimension } + * @default 8.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The height of the arrow. + * + * @type { ?Dimension } + * @default 8.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowHeight?: Dimension; + + /** + * The round corners of the popup. + * + * @type { ?Dimension } + * @default 20.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The round corners of the popup. + * + * @type { ?Dimension } + * @default 20.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius?: Dimension; + + /** + * The style of popup Shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @default ShadowStyle.OUTER_DEFAULT_MD. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The style of popup Shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @default ShadowStyle.OUTER_DEFAULT_MD. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Defines popup background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines popup background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Set popup focusable + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set popup focusable + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + focusable?: boolean; + + /** + * Defines the transition effect of popup opening and closing + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Callback function when the popup interactive dismiss + * + * @type { ?(boolean | Callback) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: boolean | Callback; + + /** + * Determine if it is compatible popup's half folded. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHoverMode?: boolean; + + /** + * Determine if popup can follow the target node when it has rotation or scale. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + followTransformOfTarget?: boolean; +} + +/** + * Defines the menu preview mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the menu preview mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum MenuPreviewMode { + /** + * No preview content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * No preview content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NONE = 0, + /** + * Defines image type preview content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines image type preview content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IMAGE = 1 +} + +/** + * Defines the animator range of start and end property. + * + * @typedef { [from: T, to: T] } AnimationRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the animator range of start and end property. + * + * @typedef { [from: T, to: T] } AnimationRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type AnimationRange = [from: T, to: T]; + +/** + * Defines the ContextMenu's preview animator options. + * + * @interface ContextMenuAnimationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the ContextMenu's preview animator options. + * + * @interface ContextMenuAnimationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface ContextMenuAnimationOptions { + /** + * Sets the start animator scale and end animator scale. + * + * @type { ?AnimationRange } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets the start animator scale and end animator scale. + * + * @type { ?AnimationRange } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scale?: AnimationRange; + /** + * Defines the transition effect of menu preview opening and closing. + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Sets the scale start and end animator of the image displayed before the custom builder preview is displayed. + * + * @type { ?AnimationRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + hoverScale?: AnimationRange; +} + +/** + * Defines the context menu options. + * + * @interface ContextMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the context menu options. + * + * @interface ContextMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ContextMenuOptions { + /** + * Sets the position offset of the context menu window. + * + * @type { ?Position } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the position offset of the context menu window. + * + * @type { ?Position } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Position; + + /** + * Sets the placement of the context menu window. + * + * @type { ?Placement } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the placement of the context menu window. + * + * @type { ?Placement } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placement?: Placement; + + /** + * whether show arrow belong to the menu, default: false, not show arrow + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * whether show arrow belong to the menu, default: false, not show arrow + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableArrow?: boolean; + + /** + * The horizontal offset to the left of menu or vertical offset to the top of menu + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The horizontal offset to the left of menu or vertical offset to the top of menu + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowOffset?: Length; + + /** + * The preview content of context menu. + * + * @type { ?(MenuPreviewMode | CustomBuilder) } + * @default MenuPreviewMode.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The preview content of context menu. + * + * @type { ?(MenuPreviewMode | CustomBuilder) } + * @default MenuPreviewMode.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preview?: MenuPreviewMode | CustomBuilder; + + /** + * Defines the border radius of menu. + * + * @type { ?(Length | BorderRadiuses | LocalizedBorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderRadius?: Length | BorderRadiuses | LocalizedBorderRadiuses; + + /** + * Callback function when the context menu appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when the context menu appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAppear?: () => void; + + /** + * Callback function when the context menu disappear. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when the context menu disappear. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onDisappear?: () => void; + + /** + * Callback function before the context menu animation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Callback function before the context menu animation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + aboutToAppear?: () => void; + + /** + * Callback function before the context menu popAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Callback function before the context menu popAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + aboutToDisappear?: () => void; + + /** + * The margin of menu's layoutRegion. + * + * @type { ?Margin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + layoutRegionMargin?: Margin; + + /** + * The preview animator options. + * + * @type { ?ContextMenuAnimationOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The preview animator options. + * + * @type { ?ContextMenuAnimationOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + previewAnimationOptions?: ContextMenuAnimationOptions; + + /** + * Defines the menu's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the menu's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Defines menu background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines menu background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Defines the transition effect of menu opening and closing. + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Determine if it is compatible menu's half folded. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHoverMode?: boolean; +} + +/** + * Defines the menu options. + * + * @interface MenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the menu options. + * + * @interface MenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MenuOptions extends ContextMenuOptions { + /** + * Sets the title of the menu window. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the title of the menu window. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + title?: ResourceStr; + + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showInSubWindow?: boolean; +} + +/** + * Defines the ProgressMask class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the ProgressMask class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class ProgressMask { + /** + * constructor. + * + * @param { number } value - indicates the current value of the progress. + * @param { number } total - indicates the total value of the progress. + * @param { ResourceColor } color - indicates the color of the mask. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @param { number } value - indicates the current value of the progress. + * @param { number } total - indicates the total value of the progress. + * @param { ResourceColor } color - indicates the color of the mask. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(value: number, total: number, color: ResourceColor); + + /** + * Update the current value of the progress. + * + * @param { number } value - indicates the current value of the progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Update the current value of the progress. + * + * @param { number } value - indicates the current value of the progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + updateProgress(value: number): void; + + /** + * Update the color of the mask. + * + * @param { ResourceColor } value - indicates the color of the mask. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Update the color of the mask. + * + * @param { ResourceColor } value - indicates the color of the mask. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + updateColor(value: ResourceColor): void; + + /** + * Enable the breathe animation of mask. + * + * @param { boolean } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableBreathingAnimation(value: boolean): void; +} + +/** + * Defines TouchTestInfo class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines TouchTestInfo class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TouchTestInfo { + /** + * Get the X-coordinate relative to the window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the X-coordinate relative to the window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + windowX: number; + + /** + * Get the Y-coordinate relative to the window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the Y-coordinate relative to the window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + windowY: number; + + /** + * Get the X-coordinate relative to the current component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the X-coordinate relative to the current component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + parentX: number; + + /** + * Get the Y-coordinate relative to the current component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the Y-coordinate relative to the current component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + parentY: number; + + /** + * Get the X-coordinate relative to the sub component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the X-coordinate relative to the sub component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + x: number; + + /** + * Get the Y-coordinate relative to the sub component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the Y-coordinate relative to the sub component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + y: number; + + /** + * Get the rectangle of sub component. + * + * @type { RectResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the rectangle of sub component. + * + * @type { RectResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + rect: RectResult; + + /** + * Get the name of sub component. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the name of sub component. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id: string; +} + +/** + * Defines TouchResult class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines TouchResult class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TouchResult { + /** + * Defines the touch test strategy. + * + * @type { TouchTestStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the touch test strategy. + * + * @type { TouchTestStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + strategy: TouchTestStrategy; + + /** + * Defines the component's name. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the component's name. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id?: string; +} + +/** + * Set the edge blur effect distance of the corresponding defense line of the component + * When the component expand out, no re-layout is triggered + * + * @interface PixelStretchEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Set the edge blur effect distance of the corresponding defense line of the component + * When the component expand out, no re-layout is triggered + * + * @interface PixelStretchEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PixelStretchEffectOptions { + /** + * top property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * top property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + top?: Length; + + /** + * bottom property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * bottom property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + bottom?: Length; + + /** + * left property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * left property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + left?: Length; + + /** + * right property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * right property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + right?: Length; +} + +/** + * Defines the click effect. + * + * @interface ClickEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the click effect. + * + * @interface ClickEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ClickEffect { + /** + * Set the click effect level. + * + * @type { ClickEffectLevel } + * @default ClickEffectLevel.Light + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set the click effect level. + * + * @type { ClickEffectLevel } + * @default ClickEffectLevel.Light + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + level: ClickEffectLevel; + + /** + * Set scale number. + * This default scale is same as the scale of click effect level. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set scale number. + * This default scale is same as the scale of click effect level. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + scale?: number; +} + +/** + * Defines the fadingEdge options. + * + * @typedef FadingEdgeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface FadingEdgeOptions { + /** + * The length of FadingEdge. + * + * @type { LengthMetrics } + * @default 32vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + fadingEdgeLength?: LengthMetrics; +} + +/** + * Define nested scroll options + * + * @interface NestedScrollOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Define nested scroll options + * + * @interface NestedScrollOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface NestedScrollOptions { + /** + * Set NestedScrollMode when the scrollable component scrolls forward + * + * @type { NestedScrollMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set NestedScrollMode when the scrollable component scrolls forward + * + * @type { NestedScrollMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollForward: NestedScrollMode; + + /** + * Set NestedScrollMode when the scrollable component scrolls backward + * + * @type { NestedScrollMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set NestedScrollMode when the scrollable component scrolls backward + * + * @type { NestedScrollMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBackward: NestedScrollMode; +} + +/** + * Defines the menu element. + * + * @interface MenuElement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the menu element. + * + * @interface MenuElement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the menu element. + * + * @interface MenuElement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MenuElement { + /** + * Sets the value of the menu element. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the value of the menu element. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the value of the menu element. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: ResourceStr; + + /** + * Sets the icon of the menu element. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the icon of the menu element. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + icon?: ResourceStr; + + /** + * Sets the symbol of the menu element. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolIcon?: SymbolGlyphModifier; + + /** + * If the value is true, the menu element is available and can respond to operations such as clicking. + * If the value is false, the menu element is not available and click operations are not responded. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * If the value is true, the menu element is available and can respond to operations such as clicking. + * If the value is false, the menu element is not available and click operations are not responded. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enabled?: boolean; + + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + action: () => void; +} + +/** + * Defines the attribute modifier. + * + * @interface AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the attribute modifier. + * + * @interface AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface AttributeModifier { + + /** + * Defines the normal update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the normal update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyNormalAttribute?(instance: T) : void; + + /** + * Defines the pressed update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the pressed update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyPressedAttribute?(instance: T) : void; + + /** + * Defines the focused update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the focused update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyFocusedAttribute?(instance: T) : void; + + /** + * Defines the disabled update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the disabled update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyDisabledAttribute?(instance: T) : void; + + /** + * Defines the selected update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the selected update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applySelectedAttribute?(instance: T) : void; +} + +/** + * Defines the content modifier. + * + * @interface ContentModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ContentModifier { + + /** + * Defining applyContent function. + * + * @returns { WrappedBuilder<[T]> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyContent(): WrappedBuilder<[T]> +} + +/** + * Defines the common configuration. + * + * @interface CommonConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CommonConfiguration { + + /** + * If the value is true, the contentModifier is available and can respond to operations such as triggerChange. + * If it is set to false, triggerChange operations are not responded. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enabled: boolean, + + /** + * Obtains the contentModifier instance object + * + * @type { ContentModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier: ContentModifier +} + +/** + * Outline Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Outline Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum OutlineStyle { + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SOLID = 0, + + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DASHED = 1, + + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DOTTED = 2, +} + +/** + * Defines the drag preview mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Defines the drag preview mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum DragPreviewMode { + /** + * Default preview mode, let system process preview scale. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Default preview mode, let system process preview scale. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + AUTO = 1, + /** + * Disable system scale to preview panel + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Disable system scale to preview panel + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + DISABLE_SCALE = 2, + /** + * Enable the default shadow effect of preview. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ENABLE_DEFAULT_SHADOW = 3, + /** + * Enable the default radius effect of preview. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ENABLE_DEFAULT_RADIUS = 4, +} + +/** + * Define the menu pop-up policy + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum MenuPolicy { + /** + * Default value. The default logic of whether to pop up a menu depends on the scene. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DEFAULT = 0, + + /** + * Hide pop up menu. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HIDE = 1, + + /** + * Show pop up menu. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SHOW = 2, +} + +/** + * ImageModifier + * + * @typedef { import('../api/arkui/ImageModifier').ImageModifier } ImageModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ImageModifier = import('../api/arkui/ImageModifier').ImageModifier; + +/** + * SymbolGlyphModifier + * + * @typedef {import('../api/arkui/SymbolGlyphModifier').SymbolGlyphModifier} SymbolGlyphModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type SymbolGlyphModifier = import('../api/arkui/SymbolGlyphModifier').SymbolGlyphModifier; + +/** + * Defines the preview options. + * + * @interface DragPreviewOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Defines the preview options. + * + * @interface DragPreviewOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface DragPreviewOptions { + /** + * Drag preview mode. + * + * @type { ?DragPreviewMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Drag preview mode. + * + * @type { ?(DragPreviewMode | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + mode?: DragPreviewMode | Array; + + /** + * Drag preview modifier. + * + * @type { ?ImageModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + modifier?: ImageModifier; + + /** + * The flag for number showing. + * + * @type { ?(boolean | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + numberBadge?: boolean | number; +} + +/** + * Defines the drag options. + * + * @interface DragInteractionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface DragInteractionOptions { + /** + * Define whether to gather selected nodes in grid or list. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + isMultiSelectionEnabled?: boolean; + + /** + * Define whether to execute animation before preview floating. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + defaultAnimationBeforeLifting?: boolean; +} + +/** + * Define the options of invert + * + * @interface InvertOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Define the options of invert + * + * @interface InvertOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface InvertOptions { + + /** + * Defines the low value of threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the low value of threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + low: number; + + /** + * Defines the high value of threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the high value of threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + high: number; + + /** + * Defines the threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + threshold: number; + + /** + *Defines the threshold range + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + *Defines the threshold range + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + thresholdRange: number; +} + +/** + * Import the CircleShape type object for common method. + * + * @typedef { import('../api/@ohos.arkui.shape').CircleShape } CircleShape + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type CircleShape = import('../api/@ohos.arkui.shape').CircleShape; + +/** + * Import the EllipseShape type object for common method. + * + * @typedef { import('../api/@ohos.arkui.shape').EllipseShape } EllipseShape + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type EllipseShape = import('../api/@ohos.arkui.shape').EllipseShape; + +/** + * Import the PathShape type object for common method. + * + * @typedef { import('../api/@ohos.arkui.shape').PathShape } PathShape + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type PathShape = import('../api/@ohos.arkui.shape').PathShape; + +/** + * Import the RectShape type object for common method. + * + * @typedef { import('../api/@ohos.arkui.shape').RectShape } RectShape + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type RectShape = import('../api/@ohos.arkui.shape').RectShape; + +/** + * Defines the type that can be undefined. + * + * @typedef { T | undefined } Optional + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type Optional = T | undefined; + +/** + * CommonMethod. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * CommonMethod. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CommonMethod. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CommonMethod. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CommonMethod { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 9 + */ + constructor(); + + /** + * Sets the width of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the width of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the width of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the width of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width(value: Length): T; + + /** + * Sets the height of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the height of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the height of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the height of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height(value: Length): T; + + /** + * Sets the drawModifier of the current component. + * + * @param { DrawModifier | undefined } modifier - drawModifier used to draw, or undefined if it is not available. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + drawModifier(modifier: DrawModifier | undefined): T; + + /** + * Sets the custom property of the current component. + * + * @param { string } name - the name of the custom property. + * @param { Optional } value - the value of the custom property. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customProperty(name: string, value: Optional): T; + + /** + * Expands the safe area. + * + * @param { Array } types - Indicates the types of the safe area. + * @param { Array } edges - Indicates the edges of the safe area. + * @returns { T } The component instance. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Expands the safe area. + * + * @param { Array } types - Indicates the types of the safe area. + * @param { Array } edges - Indicates the edges of the safe area. + * @returns { T } The component instance. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + expandSafeArea(types?: Array, edges?: Array): T; + + /** + * Sets the response region of the current component. + * + * @param { Array | Rectangle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the response region of the current component. + * + * @param { Array | Rectangle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the response region of the current component. + * + * @param { Array | Rectangle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the response region of the current component. + * + * @param { Array | Rectangle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + responseRegion(value: Array | Rectangle): T; + + /** + * Sets the mouse response region of current component + * + * @param { Array | Rectangle } value + * @returns { T } return the component attribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the mouse response region of current component + * + * @param { Array | Rectangle } value + * @returns { T } return the component attribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + mouseResponseRegion(value: Array | Rectangle): T; + + /** + * The size of the current component. + * + * @param { SizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The size of the current component. + * + * @param { SizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The size of the current component. + * + * @param { SizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The size of the current component. + * + * @param { SizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + size(value: SizeOptions): T; + + /** + * constraint Size: + * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. + * + * @param { ConstraintSizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * constraint Size: + * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. + * + * @param { ConstraintSizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * constraint Size: + * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. + * + * @param { ConstraintSizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * constraint Size: + * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. + * + * @param { ConstraintSizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constraintSize(value: ConstraintSizeOptions): T; + + /** + * Sets the touchable of the current component + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead hitTestBehavior + */ + touchable(value: boolean): T; + + /** + * Defines the component's hit test behavior in touch events. + * + * @param { HitTestMode } value - the hit test mode. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Defines the component's hit test behavior in touch events. + * + * @param { HitTestMode } value - the hit test mode. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the component's hit test behavior in touch events. + * + * @param { HitTestMode } value - the hit test mode. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hitTestBehavior(value: HitTestMode): T; + + /** + * Defines the pre-touch test of sub component in touch events. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the pre-touch test of sub component in touch events. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onChildTouchTest(event: (value: Array) => TouchResult): T; + + /** + * layout Weight + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * layout Weight + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * layout Weight + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * layout Weight + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + layoutWeight(value: number | string): T; + + /** + * chain Weight + * + * @param { ChainWeightOptions } chainWeight + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + chainWeight(chainWeight: ChainWeightOptions): T; + + /** + * Inner margin. + * + * @param { Padding | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Inner margin. + * + * @param { Padding | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Inner margin. + * + * @param { Padding | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Inner margin. + * + * @param { Padding | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Inner margin. + * + * @param { Padding | Length | LocalizedPadding } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + padding(value: Padding | Length | LocalizedPadding): T; + + /** + * Inner safeArea padding. + * + * @param { Padding | LengthMetrics | LocalizedPadding } paddingValue - Indicates safeArea padding values + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + safeAreaPadding(paddingValue: Padding | LengthMetrics | LocalizedPadding): T; + + /** + * Outer Margin. + * + * @param { Margin | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Outer Margin. + * + * @param { Margin | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Outer Margin. + * + * @param { Margin | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Outer Margin. + * + * @param { Margin | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Outer Margin. + * + * @param { Margin | Length | LocalizedMargin } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + margin(value: Margin | Length | LocalizedMargin): T; + + /** + * Background. + * + * @param { CustomBuilder } builder + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Background. + * + * @param { CustomBuilder } builder + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + background(builder: CustomBuilder, options?: { align?: Alignment }): T; + + /** + * Background color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundColor(value: ResourceColor): T; + + /** + * PixelRound + * + * @param { PixelRoundPolicy } value - indicates the pixel round policy. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + pixelRound(value: PixelRoundPolicy): T; + + /** + * Background image + * src: Image address url + * + * @param { ResourceStr } src + * @param { ImageRepeat } repeat + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background image + * src: Image address url + * + * @param { ResourceStr } src + * @param { ImageRepeat } repeat + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background image + * src: Image address url + * + * @param { ResourceStr } src + * @param { ImageRepeat } repeat + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background image + * src: Image address url + * + * @param { ResourceStr } src + * @param { ImageRepeat } repeat + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Background image + * src: Image address url + * + * @param { ResourceStr | PixelMap } src + * @param { ImageRepeat } repeat + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + backgroundImage(src: ResourceStr | PixelMap, repeat?: ImageRepeat): T; + + /** + * Background image size + * + * @param { SizeOptions | ImageSize } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background image size + * + * @param { SizeOptions | ImageSize } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background image size + * + * @param { SizeOptions | ImageSize } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background image size + * + * @param { SizeOptions | ImageSize } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundImageSize(value: SizeOptions | ImageSize): T; + + /** + * Background image position + * x:Horizontal coordinate;y:Vertical axis coordinate. + * + * @param { Position | Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background image position + * x:Horizontal coordinate;y:Vertical axis coordinate. + * + * @param { Position | Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background image position + * x:Horizontal coordinate;y:Vertical axis coordinate. + * + * @param { Position | Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background image position + * x:Horizontal coordinate;y:Vertical axis coordinate. + * + * @param { Position | Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundImagePosition(value: Position | Alignment): T; + + /** + * Background blur style. + * blurStyle:Blur style type. + * + * @param { BlurStyle } value + * @param { BackgroundBlurStyleOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background blur style. + * blurStyle:Blur style type. + * + * @param { BlurStyle } value + * @param { BackgroundBlurStyleOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background blur style. + * blurStyle:Blur style type. + * + * @param { BlurStyle } value + * @param { BackgroundBlurStyleOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundBlurStyle(value: BlurStyle, options?: BackgroundBlurStyleOptions): T; + + /** + * options:background effect options. + * + * @param { BackgroundEffectOptions } options - options indicates the effect options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * options:background effect options. + * + * @param { BackgroundEffectOptions } options - options indicates the effect options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundEffect(options: BackgroundEffectOptions): T; + + /** + * Background image resizable. + * value:resizable options + * + * @param { ResizableOptions } value - Indicates the resizable options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundImageResizable(value: ResizableOptions): T; + + /** + * Foreground effect. + * + * @param { ForegroundEffectOptions } options - options indicates the effect options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + foregroundEffect(options: ForegroundEffectOptions): T; + + + /** + * Unified visual effect interface. + * + * @param { VisualEffect } effect - Visual effect parameters. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + visualEffect(effect: VisualEffect): T; + + /** + * Filter applied to the background layer of the component. + * + * @param { Filter } filter - Filter effect parameters. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundFilter(filter: Filter): T; + + /** + * Filter applied to the foreground layer of the component. + * + * @param { Filter } filter - Filter effect parameters. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + foregroundFilter(filter: Filter): T; + + /** + * Filter applied to the compositing layer of the component. + * + * @param { Filter } filter - Filter effect parameters. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + compositingFilter(filter: Filter): T; + + /** + * Foreground blur style. + * blurStyle:Blur style type. + * + * @param { BlurStyle } value + * @param { ForegroundBlurStyleOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Foreground blur style. + * blurStyle:Blur style type. + * + * @param { BlurStyle } value + * @param { ForegroundBlurStyleOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + foregroundBlurStyle(value: BlurStyle, options?: ForegroundBlurStyleOptions): T; + + /** + * Opacity + * + * @param { number | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Opacity + * + * @param { number | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Opacity + * + * @param { number | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Opacity + * + * @param { number | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + opacity(value: number | Resource): T; + + /** + * Opacity + * width:Border width;color:Border color;radius:Border radius; + * + * @param { BorderOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Opacity + * width:Border width;color:Border color;radius:Border radius; + * + * @param { BorderOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Opacity + * width:Border width;color:Border color;radius:Border radius; + * + * @param { BorderOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Opacity + * width:Border width;color:Border color;radius:Border radius; + * + * @param { BorderOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + border(value: BorderOptions): T; + + /** + * Border style + * + * @param { BorderStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Border style + * + * @param { BorderStyle | EdgeStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border style + * + * @param { BorderStyle | EdgeStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border style + * + * @param { BorderStyle | EdgeStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + borderStyle(value: BorderStyle | EdgeStyles): T; + + /** + * Border width + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Border width + * + * @param { Length | EdgeWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border width + * + * @param { Length | EdgeWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border width + * + * @param { Length | EdgeWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border width + * + * @param { Length | EdgeWidths | LocalizedEdgeWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + borderWidth(value: Length | EdgeWidths | LocalizedEdgeWidths): T; + + /** + * Border color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Border color + * + * @param { ResourceColor | EdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border color + * + * @param { ResourceColor | EdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border color + * + * @param { ResourceColor | EdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border color + * + * @param { ResourceColor | EdgeColors | LocalizedEdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + borderColor(value: ResourceColor | EdgeColors | LocalizedEdgeColors): T; + + /** + * Border radius + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Border radius + * + * @param { Length | BorderRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border radius + * + * @param { Length | BorderRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border radius + * + * @param { Length | BorderRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border radius + * + * @param { Length | BorderRadiuses | LocalizedBorderRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + borderRadius(value: Length | BorderRadiuses | LocalizedBorderRadiuses): T; + + /** + * Border image + * + * @param { BorderImageOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image + * + * @param { BorderImageOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image + * + * @param { BorderImageOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + borderImage(value: BorderImageOption): T; + + /** + * Outline + * width:Outline width;color:Outline color;radius:Outline radius;style:Outline style; + * + * @param { OutlineOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Outline + * width:Outline width;color:Outline color;radius:Outline radius;style:Outline style; + * + * @param { OutlineOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outline(value: OutlineOptions): T; + + /** + * Outline style + * The input parameter default value is OutlineStyle.SOLID + * + * @param { OutlineStyle | EdgeOutlineStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Outline style + * + * @param { OutlineStyle | EdgeOutlineStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outlineStyle(value: OutlineStyle | EdgeOutlineStyles): T; + + /** + * Outline width + * The input parameter default value is 0 + * + * @param { Dimension | EdgeOutlineWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Outline width + * + * @param { Dimension | EdgeOutlineWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outlineWidth(value: Dimension | EdgeOutlineWidths): T; + + /** + * Outline color + * The input parameter default value is Color.Black + * + * @param { ResourceColor | EdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Outline color + * + * @param { ResourceColor | EdgeColors | LocalizedEdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outlineColor(value: ResourceColor | EdgeColors | LocalizedEdgeColors): T; + + /** + * Outline radius + * The input parameter default value is 0 + * + * @param { Dimension | OutlineRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Outline radius + * + * @param { Dimension | OutlineRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outlineRadius(value: Dimension | OutlineRadiuses): T; + + /** + * Provides the general foreground color capability of UI components, and assigns color values + * according to the characteristics of components. + * + * @param { ResourceColor | ColoringStrategy } value - indicates the color or color selection strategy + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provides the general foreground color capability of UI components, and assigns color values + * according to the characteristics of components. + * + * @param { ResourceColor | ColoringStrategy } value - indicates the color or color selection strategy + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + foregroundColor(value: ResourceColor | ColoringStrategy): T; + + /** + * Trigger a click event when a click is clicked. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Trigger a click event when a click is clicked. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Trigger a click event when a click is clicked. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Trigger a click event when a click is clicked. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onClick(event: (event: ClickEvent) => void): T; + + /** + * Trigger a click event when a click is clicked, move distance should smaller than distanceThreshold. + * + * @param { function } event - this function callback executed when the click action is recognized + * @param { number } distanceThreshold - the distance threshold of finger's movement when detecting a click action + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + onClick(event: Callback, distanceThreshold: number): T; + + /** + * Trigger a hover event. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger a hover event. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onHover(event: (isHover: boolean, event: HoverEvent) => void): T; + + /** + * Trigger a accessibility hover event. + * + * @param { AccessibilityCallback } callback - A callback instance used when the component is touched after accessibility mode is enabled. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAccessibilityHover(callback: AccessibilityCallback): T; + + /** + * Set hover effect. + * + * @param { HoverEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set hover effect. + * + * @param { HoverEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set hover effect. + * + * @param { HoverEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hoverEffect(value: HoverEffect): T; + + /** + * Trigger a mouse event. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger a mouse event. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + onMouse(event: (event: MouseEvent) => void): T; + + /** + * Trigger a touch event when touched. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Trigger a touch event when touched. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger a touch event when touched. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onTouch(event: (event: TouchEvent) => void): T; + + /** + * Keyboard input + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keyboard input + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Keyboard input + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onKeyEvent(event: (event: KeyEvent) => void): T; + + /** + * Handle keyboard events before input method events. + * + * @param { Callback } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onKeyPreIme(event: Callback): T; + + /** + * Set focusable. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set focusable. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set focusable. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + focusable(value: boolean): T; + + /** + * Set TabStop on component focus + * + * @param { boolean } isTabStop + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + tabStop(isTabStop: boolean): T; + + /** + * Trigger a event when got focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger a event when got focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger a event when got focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onFocus(event: () => void): T; + + /** + * Trigger a event when lose focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger a event when lose focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger a event when lose focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onBlur(event: () => void): T; + + /** + * Set focus index by key tab. + * + * @param { number } index + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set focus index by key tab. + * + * @param { number } index + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set focus index by key tab. + * + * @param { number } index + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + tabIndex(index: number): T; + + /** + * Set default focused component when a page create. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set default focused component when a page create. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set default focused component when a page create. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + defaultFocus(value: boolean): T; + + /** + * Set default focused component when focus on a focus group. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set default focused component when focus on a focus group. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set default focused component when focus on a focus group. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + groupDefaultFocus(value: boolean): T; + + /** + * Set a component focused when the component be touched. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set a component focused when the component be touched. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set a component focused when the component be touched. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + focusOnTouch(value: boolean): T; + + /** + * Set the component's focusBox style. + * + * @param { FocusBoxStyle } style + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + focusBox(style: FocusBoxStyle): T; + + /** + * Set container as a focus group with a specific identifier. + * + * @param { string } id - focus scope identifier. + * @param { boolean } [isGroup] - whether this scope is a focus group, the default value is false + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + focusScopeId(id: string, isGroup?: boolean): T; + /** + * Set container as a focus group with a specific identifier. + * + * @param { string } id - focus scope identifier. + * @param { boolean } [isGroup] - whether this scope is a focus group, the default value is false. + * @param { boolean } [arrowStepOut] - whether the arrow keys can move focus from inside the focus group to outside, + * only effective when isGroup is true, the default value is true. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + focusScopeId(id: string, isGroup?: boolean, arrowStepOut?: boolean): T; + + /** + * Set the focus priority of component in a specific focus scope. + * + * @param { string } scopeId + * @param { FocusPriority } [priority] - the default value is AUTO + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + focusScopePriority(scopeId: string, priority?: FocusPriority): T; + + /** + * animation + * + * @param { AnimateParam } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * animation + * + * @param { AnimateParam } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * animation + * + * @param { AnimateParam } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * animation + * + * @param { AnimateParam } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + animation(value: AnimateParam): T; + + /** + * Transition parameter + * + * @param { TransitionOptions | TransitionEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Transition parameter + * + * @param { TransitionOptions | TransitionEffect } value - transition options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Transition parameter + * + * @param { TransitionOptions | TransitionEffect } value - transition options or transition effect + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Transition parameter + * + * @param { TransitionOptions | TransitionEffect } value - transition options or transition effect + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + transition(value: TransitionOptions | TransitionEffect): T; + + /** + * Set the transition effect of component when it appears and disappears. + * + * @param { TransitionEffect } effect - transition effect + * @param { Optional } onFinish - transition finish callback. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + transition(effect: TransitionEffect, onFinish: Optional): T; + + /** + * Bind gesture recognition. + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Bind gesture recognition. + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bind gesture recognition. + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + gesture(gesture: GestureType, mask?: GestureMask): T; + + /** + * Binding Preferential Recognition Gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Binding Preferential Recognition Gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Binding Preferential Recognition Gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + priorityGesture(gesture: GestureType, mask?: GestureMask): T; + + /** + * Binding gestures that can be triggered simultaneously with internal component gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Binding gestures that can be triggered simultaneously with internal component gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Binding gestures that can be triggered simultaneously with internal component gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + parallelGesture(gesture: GestureType, mask?: GestureMask): T; + + /** + * Adds the content blurring effect for the current component. The input parameter is the blurring radius. + * The larger the blurring radius, the more blurring the content. + * If the value is 0, the content blurring effect is not blurring. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds the content blurring effect for the current component. The input parameter is the blurring radius. + * The larger the blurring radius, the more blurring the content. + * If the value is 0, the content blurring effect is not blurring. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the content blurring effect for the current component. The input parameter is the blurring radius. + * The larger the blurring radius, the more blurring the content. + * If the value is 0, the content blurring effect is not blurring. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the content blurring effect for the current component. The input parameter is the blurring radius. + * The larger the blurring radius, the more blurring the content. + * If the value is 0, the content blurring effect is not blurring. + * + * @param { number } value - value indicates radius of backdrop blur. + * @param { BlurOptions } [options] - options indicates blur options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + blur(value: number, options?: BlurOptions): T; + + /** + * Adds the content linear gradient blurring effect for the current component. The input parameter is the blurring radius. + * + * @param { number } value - the blurring radius. + * The larger the blurring radius, the more blurring the content, and if the value is 0, the content blurring effect is not blurring. + * @param { LinearGradientBlurOptions } options - the linear gradient blur options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + linearGradientBlur(value: number, options: LinearGradientBlurOptions): T; + + /** + * Component motion blur interface. + * + * @param { MotionBlurOptions } value - the attributes of motion blur. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + motionBlur(value: MotionBlurOptions):T; + + /** + * Adds a highlight effect to the current component. + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * The component is displayed as all white (percentage). + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds a highlight effect to the current component. + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * The component is displayed as all white (percentage). + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a highlight effect to the current component. + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * The component is displayed as all white (percentage). + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a highlight effect to the current component. + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * The component is displayed as all white (percentage). + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + brightness(value: number): T; + + /** + * Adds a contrast effect to the current component. The input parameter is the contrast value. + * A larger contrast value indicates a sharper image. When the contrast value is 0, the image becomes gray. (%) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds a contrast effect to the current component. The input parameter is the contrast value. + * A larger contrast value indicates a sharper image. When the contrast value is 0, the image becomes gray. (%) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a contrast effect to the current component. The input parameter is the contrast value. + * A larger contrast value indicates a sharper image. When the contrast value is 0, the image becomes gray. (%) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a contrast effect to the current component. The input parameter is the contrast value. + * A larger contrast value indicates a sharper image. When the contrast value is 0, the image becomes gray. (%) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + contrast(value: number): T; + + /** + * Adds a grayscale effect to the current component. + * The value is the gray scale conversion ratio. If the input parameter is 1.0, the gray scale image is completely converted to the gray scale image. If the input parameter is 0.0, the image does not change. + * If the input parameter is between 0.0 and 1.0, the effect changes. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds a grayscale effect to the current component. + * The value is the gray scale conversion ratio. If the input parameter is 1.0, the gray scale image is completely converted to the gray scale image. If the input parameter is 0.0, the image does not change. + * If the input parameter is between 0.0 and 1.0, the effect changes. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a grayscale effect to the current component. + * The value is the gray scale conversion ratio. If the input parameter is 1.0, the gray scale image is completely converted to the gray scale image. If the input parameter is 0.0, the image does not change. + * If the input parameter is between 0.0 and 1.0, the effect changes. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a grayscale effect to the current component. + * The value is the gray scale conversion ratio. If the input parameter is 1.0, the gray scale image is completely converted to the gray scale image. If the input parameter is 0.0, the image does not change. + * If the input parameter is between 0.0 and 1.0, the effect changes. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + grayscale(value: number): T; + + /** + * Adds a color overlay effect for the current component. The input parameter is the superimposed color. + * + * @param { Color | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds a color overlay effect for the current component. The input parameter is the superimposed color. + * + * @param { Color | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a color overlay effect for the current component. The input parameter is the superimposed color. + * + * @param { Color | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a color overlay effect for the current component. The input parameter is the superimposed color. + * + * @param { Color | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + colorBlend(value: Color | string | Resource): T; + + /** + * Adds a saturation effect to the current component. + * The saturation is the ratio of the color-containing component to the achromatic component (gray). + * The larger the color-containing component, the greater the saturation. + * The larger the achromatic component, the smaller the saturation. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds a saturation effect to the current component. + * The saturation is the ratio of the color-containing component to the achromatic component (gray). + * The larger the color-containing component, the greater the saturation. + * The larger the achromatic component, the smaller the saturation. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a saturation effect to the current component. + * The saturation is the ratio of the color-containing component to the achromatic component (gray). + * The larger the color-containing component, the greater the saturation. + * The larger the achromatic component, the smaller the saturation. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a saturation effect to the current component. + * The saturation is the ratio of the color-containing component to the achromatic component (gray). + * The larger the color-containing component, the greater the saturation. + * The larger the achromatic component, the smaller the saturation. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + saturate(value: number): T; + + /** + * Converts the image to sepia. Value defines the scale of the conversion. + * A value of 1 is completely sepia, and a value of 0 does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Converts the image to sepia. Value defines the scale of the conversion. + * A value of 1 is completely sepia, and a value of 0 does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Converts the image to sepia. Value defines the scale of the conversion. + * A value of 1 is completely sepia, and a value of 0 does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Converts the image to sepia. Value defines the scale of the conversion. + * A value of 1 is completely sepia, and a value of 0 does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + sepia(value: number): T; + + /** + * Invert the input image. Value defines the scale of the conversion. 100% of the value is a complete reversal. + * A value of 0% does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Invert the input image. Value defines the scale of the conversion. 100% of the value is a complete reversal. + * A value of 0% does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Invert the input image. Value defines the scale of the conversion. 100% of the value is a complete reversal. + * A value of 0% does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Invert the input image. Value defines the scale of the conversion. 100% of the value is a complete reversal. + * A value of 0% does not change the image. (Percentage) + * + * @param { number | InvertOptions } value - value indicates the scale of the conversion or the options of invert. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + invert(value: number | InvertOptions): T; + + /** + * Sets system bar effect to the component. + * + * @returns { T } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + systemBarEffect(): T; + + /** + * Adds the hue rotation effect to the current component. + * The input parameter is the rotation angle. When the input parameter is 0deg, the image does not change (the default value is 0deg), and the input parameter does not have a maximum value. + * If the value exceeds 360deg, the image is circled again. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds the hue rotation effect to the current component. + * The input parameter is the rotation angle. When the input parameter is 0deg, the image does not change (the default value is 0deg), and the input parameter does not have a maximum value. + * If the value exceeds 360deg, the image is circled again. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the hue rotation effect to the current component. + * The input parameter is the rotation angle. When the input parameter is 0deg, the image does not change (the default value is 0deg), and the input parameter does not have a maximum value. + * If the value exceeds 360deg, the image is circled again. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the hue rotation effect to the current component. + * The input parameter is the rotation angle. When the input parameter is 0deg, the image does not change (the default value is 0deg), and the input parameter does not have a maximum value. + * If the value exceeds 360deg, the image is circled again. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + hueRotate(value: number | string): T; + + /** + * Add an attribute to control whether the shadows of the child nodes overlap each other. + * + * @param { boolean } value - true means the shadows of the child nodes overlap each other effect and drawn in batches. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Add an attribute to control whether the shadows of the child nodes overlap each other. + * + * @param { boolean } value - true means the shadows of the child nodes overlap each other effect and drawn in batches. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + useShadowBatching(value: boolean): T; + + /** + * Sets whether the component should apply the effects template defined by the parent effectComponent or window. + * If multiple parent effectComponents are found, the nearest one will be used. + * If no parent effectComponent is found, this method has no effect. + * + * @param { boolean } useEffect - true means the component should apply the effects template defined by the parent effectComponent or window. + * @param { EffectType } effectType - the effect type of the effects template, defined by the parent effectComponent or window. + * @returns { T } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ + useEffect(useEffect: boolean, effectType: EffectType): T; + + /** + * Sets whether the component should apply the effects template defined by the parent effectComponent. + * If multiple parent effectComponents are found, the nearest one will be used. + * If no parent effectComponent is found, this method has no effect. + * + * @param { boolean } value - true means the component should apply the effects template. + * @returns { T } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + useEffect(value: boolean): T; + + /** + * Adds the background blur effect for the current component. The input parameter is the blur radius. + * The larger the blur radius, the more blurred the background. If the value is 0, the background blur is not blurred. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds the background blur effect for the current component. The input parameter is the blur radius. + * The larger the blur radius, the more blurred the background. If the value is 0, the background blur is not blurred. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the background blur effect for the current component. The input parameter is the blur radius. + * The larger the blur radius, the more blurred the background. If the value is 0, the background blur is not blurred. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the background blur effect for the current component. The input parameter is the blur radius. + * The larger the blur radius, the more blurred the background. If the value is 0, the background blur is not blurred. + * + * @param { number } value - value indicates radius of backdrop blur. + * @param { BlurOptions } [options] - options indicates the backdrop blur options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backdropBlur(value: number, options?: BlurOptions): T; + + /** + * Composite the contents of this view and its children into an offscreen cache before display in the screen. + * + * @param { boolean } value - if this view and its children need to composite into an offscreen cache. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Composite the contents of this view and its children into an offscreen cache before display in the screen. + * + * @param { boolean } value - if this view and its children need to composite into an offscreen cache. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Composite the contents of this view and its children into an offscreen cache before display in the screen. + * + * @param { boolean } value - if this view and its children need to composite into an offscreen cache. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + renderGroup(value: boolean): T; + + /** + * Sets whether the component should remain stationary, reusing the results of the current frame's off-screen rendering. + * If the input parameter is true, the component and subcomponent changes do not affect the display. + * + * @param { boolean } value - true means the component should remain stationary. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + freeze(value: boolean): T; + + /** + * Sets the translation effect during page transition. + * The value is the start point of entry and end point of exit. + * When this parameter is set together with slide, slide takes effect by default. + * + * @param { TranslateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the translation effect during page transition. + * The value is the start point of entry and end point of exit. + * When this parameter is set together with slide, slide takes effect by default. + * + * @param { TranslateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the translation effect during page transition. + * The value is the start point of entry and end point of exit. + * When this parameter is set together with slide, slide takes effect by default. + * + * @param { TranslateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set component translation. + * + * @param { TranslateOptions } value default:{x:0,y:0,z:0} + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + translate(value: TranslateOptions): T; + + /** + * Sets the zoom effect during page transition. The value is the start point of entry and end point of exit. + * + * @param { ScaleOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the zoom effect during page transition. The value is the start point of entry and end point of exit. + * + * @param { ScaleOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the zoom effect during page transition. The value is the start point of entry and end point of exit. + * + * @param { ScaleOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set component scaling. + * + * @param { ScaleOptions } value default:{x:1,y:1,z:1,centerX:'50%',centerY:'50%'} + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scale(value: ScaleOptions): T; + + /** + * Default number of occupied columns, indicating the number of occupied grid columns when the number of columns (span) of the corresponding size is not set in the useSizeType attribute. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Default number of occupied columns, indicating the number of occupied grid columns when the number of columns (span) of the corresponding size is not set in the useSizeType attribute. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default number of occupied columns, indicating the number of occupied grid columns when the number of columns (span) of the corresponding size is not set in the useSizeType attribute. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + gridSpan(value: number): T; + + /** + * The default offset column number indicates the number of offset columns of the current component in the start direction of the parent component when the useSizeType attribute does not set the offset of the corresponding dimension. That is, + * the current component is located in the nth column. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The default offset column number indicates the number of offset columns of the current component in the start direction of the parent component when the useSizeType attribute does not set the offset of the corresponding dimension. That is, + * the current component is located in the nth column. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The default offset column number indicates the number of offset columns of the current component in the start direction of the parent component when the useSizeType attribute does not set the offset of the corresponding dimension. That is, + * the current component is located in the nth column. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + gridOffset(value: number): T; + + /** + * Sets the rotation effect during assembly transition. + * The values are the start point during insertion and the end point during deletion. + * + * @param { RotateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the rotation effect during assembly transition. + * The values are the start point during insertion and the end point during deletion. + * + * @param { RotateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the rotation effect during assembly transition. + * The values are the start point during insertion and the end point during deletion. + * + * @param { RotateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set component rotation. + * + * @param { RotateOptions } value default:{x:0,y:0,z:0,centerX:'50%',centerY:'50%',centerZ:0,perspective:0} + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + rotate(value: RotateOptions): T; + + /** + * Sets the transformation matrix for the current component. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the transformation matrix for the current component. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the transformation matrix for the current component. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + transform(value: object): T; + + /** + * This callback is triggered when a component mounts a display. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This callback is triggered when a component mounts a display. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * This callback is triggered when a component mounts a display. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * This callback is triggered when a component mounts a display. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onAppear(event: () => void): T; + + /** + * This callback is triggered when component uninstallation disappears. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This callback is triggered when component uninstallation disappears. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * This callback is triggered when component uninstallation disappears. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * This callback is triggered when component uninstallation disappears. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onDisAppear(event: () => void): T; + + /** + * This callback is triggered when a component mounts to view tree. + * + * @param { Callback } callback + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAttach(callback: Callback): T; + + /** + * This callback is triggered when a component is detached from view tree. + * + * @param { Callback } callback + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDetach(callback: Callback): T; + + /** + * This callback is triggered when the size or position of this component change finished. + * + * @param { function } event - event callback. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * This callback is triggered when the size or position of this component change finished. + * + * @param { function } event - event callback. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This callback is triggered when the size or position of this component change finished. + * + * @param { function } event - event callback. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAreaChange(event: (oldValue: Area, newValue: Area) => void): T; + + /** + * Controls the display or hide of the current component. + * + * @param { Visibility } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Controls the display or hide of the current component. + * + * @param { Visibility } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Controls the display or hide of the current component. + * + * @param { Visibility } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Controls the display or hide of the current component. + * + * @param { Visibility } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + visibility(value: Visibility): T; + + /** + * The percentage of the remaining space of the Flex container allocated to the component on which this property resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The percentage of the remaining space of the Flex container allocated to the component on which this property resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The percentage of the remaining space of the Flex container allocated to the component on which this property resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The percentage of the remaining space of the Flex container allocated to the component on which this property resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + flexGrow(value: number): T; + + /** + * The proportion of the Flex container compression size assigned to the component on which this attribute resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The proportion of the Flex container compression size assigned to the component on which this attribute resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The proportion of the Flex container compression size assigned to the component on which this attribute resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The proportion of the Flex container compression size assigned to the component on which this attribute resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + flexShrink(value: number): T; + + /** + * The base dimension of the assembly on which this attribute is located in the direction of the principal axis in the Flex container. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The base dimension of the assembly on which this attribute is located in the direction of the principal axis in the Flex container. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The base dimension of the assembly on which this attribute is located in the direction of the principal axis in the Flex container. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The base dimension of the assembly on which this attribute is located in the direction of the principal axis in the Flex container. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + flexBasis(value: number | string): T; + + /** + * Overrides the default configuration of alignItems in the Flex Layout container. + * + * @param { ItemAlign } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Overrides the default configuration of alignItems in the Flex Layout container. + * + * @param { ItemAlign } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Overrides the default configuration of alignItems in the Flex Layout container. + * + * @param { ItemAlign } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Overrides the default configuration of alignItems in the Flex Layout container. + * + * @param { ItemAlign } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignSelf(value: ItemAlign): T; + + /** + * Sets the current component and displays the priority in the layout container. This parameter is valid only in Row, Column, and Flex single-row layouts. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the current component and displays the priority in the layout container. This parameter is valid only in Row, Column, and Flex single-row layouts. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the current component and displays the priority in the layout container. This parameter is valid only in Row, Column, and Flex single-row layouts. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the current component and displays the priority in the layout container. This parameter is valid only in Row, Column, and Flex single-row layouts. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + displayPriority(value: number): T; + + /** + * The sibling components in the same container are hierarchically displayed. A larger value of z indicates a higher display level. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The sibling components in the same container are hierarchically displayed. A larger value of z indicates a higher display level. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The sibling components in the same container are hierarchically displayed. A larger value of z indicates a higher display level. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The sibling components in the same container are hierarchically displayed. A larger value of z indicates a higher display level. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + zIndex(value: number): T; + + /** + * If the components of the two pages are configured with the same ID, the shared element transition is performed during transition. If the parameter is set to an empty string, the shared element transition does not occur. For details about the options parameter, see the options parameter description. + * + * @param { string } id + * @param { sharedTransitionOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * If the components of the two pages are configured with the same ID, the shared element transition is performed during transition. If the parameter is set to an empty string, the shared element transition does not occur. For details about the options parameter, see the options parameter description. + * + * @param { string } id + * @param { sharedTransitionOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * If the components of the two pages are configured with the same ID, the shared element transition is performed during transition. If the parameter is set to an empty string, the shared element transition does not occur. For details about the options parameter, see the options parameter description. + * + * @param { string } id + * @param { sharedTransitionOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + sharedTransition(id: string, options?: sharedTransitionOptions): T; + + /** + * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). + * + * @param { Direction } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). + * + * @param { Direction } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). + * + * @param { Direction } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). + * + * @param { Direction } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + direction(value: Direction): T; + + /** + * align + * + * @param { Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * align + * + * @param { Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * align + * + * @param { Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * align + * + * @param { Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + align(value: Alignment): T; + + /** + * position + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * position + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * position + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * position + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * position + * + * @param { Position | Edges | LocalizedEdges } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + position(value: Position | Edges | LocalizedEdges): T; + + /** + * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. + * + * @param { Position | LocalizedPosition} value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + markAnchor(value: Position | LocalizedPosition): T; + + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. + * + * @param { Position | Edges | LocalizedEdges } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + offset(value: Position | Edges | LocalizedEdges): T; + + /** + * If the value is true, the component is available and can respond to operations such as clicking. + * If it is set to false, click operations are not responded. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * If the value is true, the component is available and can respond to operations such as clicking. + * If it is set to false, click operations are not responded. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * If the value is true, the component is available and can respond to operations such as clicking. + * If it is set to false, click operations are not responded. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * If the value is true, the component is available and can respond to operations such as clicking. + * If it is set to false, click operations are not responded. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + enabled(value: boolean): T; + + /** + * Sets the number of occupied columns and offset columns for a specific device width type. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead grid_col/GridColColumnOption and grid_row/GridRowColumnOption + */ + useSizeType(value: { + xs?: number | { span: number; offset: number }; + sm?: number | { span: number; offset: number }; + md?: number | { span: number; offset: number }; + lg?: number | { span: number; offset: number }; + }): T; + + /** + * Specifies the alignRules of relative container + * + * @param { AlignRuleOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies the alignRules of relative container + * + * @param { AlignRuleOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies the alignRules of relative container + * + * @param { AlignRuleOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignRules(value: AlignRuleOption): T; + + /** + * Specifies the localized alignRules of relative container + * + * @param { LocalizedAlignRuleOptions } alignRule + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + alignRules(alignRule: LocalizedAlignRuleOptions): T; + + /** + * Specifies the direction and style of chain in relative container + * + * @param { Axis } direction - indicates direction of the chain + * @param { ChainStyle } style - indicates style of the chain + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + chainMode(direction: Axis, style: ChainStyle): T; + + /** + * Specifies the aspect ratio of the current component. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Specifies the aspect ratio of the current component. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies the aspect ratio of the current component. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies the aspect ratio of the current component. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + aspectRatio(value: number): T; + + /** + * The click effect level and scale number. + * + * @param { ClickEffect | null } value + * @returns { T } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The click effect level and scale number. + * + * @param { ClickEffect | null } value + * @returns { T } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + clickEffect(value: ClickEffect | null): T; + + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDragStart(event: (event: DragEvent, extraParams?: string) => CustomBuilder | DragItemInfo): T; + + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDragEnter(event: (event: DragEvent, extraParams?: string) => void): T; + + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDragMove(event: (event: DragEvent, extraParams?: string) => void): T; + + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDragLeave(event: (event: DragEvent, extraParams?: string) => void): T; + + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDrop(event: (event: DragEvent, extraParams?: string) => void): T; + + /** + * This function is called when the drag event is end. + * + * @param { function } event - indicates the function to be called. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * This function is called when the drag event is end. + * + * @param { function } event - indicates the function to be called. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * This function is called when the drag event is end. + * + * @param { function } event - indicates the function to be called. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDragEnd(event: (event: DragEvent, extraParams?: string) => void): T; + + /** + * Allowed drop uniformData type for this node. + * + * @param { Array } value - the uniformData type for this node. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Allowed drop uniformData type for this node. + * + * @param { Array } value - the uniformData type for this node. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Allowed drop uniformData type for this node. + * + * @param { Array | null } value - the uniformData type for this node. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + allowDrop(value: Array | null): T; + + /** + * Enable the selectable area can be dragged. + * + * @param { boolean } value - true means the area can be dragged, false means the area can't be dragged. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Enable the selectable area can be dragged. + * + * @param { boolean } value - true means the area can be dragged, false means the area can't be dragged. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + draggable(value: boolean): T; + + /** + * Set preview of the component for dragging process + * + * @param { CustomBuilder | DragItemInfo } value - preview of the component for dragging process + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Set preview of the component for dragging process + * + * @param { CustomBuilder | DragItemInfo | string } value - preview of the component for dragging process + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + dragPreview(value: CustomBuilder | DragItemInfo | string): T; + + /** + * Set the selectable area drag preview options. + * + * @param { DragPreviewOptions } value - preview options value. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Set the selectable area drag preview options. + * + * @param { DragPreviewOptions } value - preview options value. + * @param { DragInteractionOptions } options - drag interaction options value. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + dragPreviewOptions(value: DragPreviewOptions, options?: DragInteractionOptions): T; + + /** + * After binding, a callback is triggered when the preDrag status change finished. + * + * @param { Callback } callback callback - The callback will be triggered when the preDrag status change. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + onPreDrag(callback: Callback): T; + + /** + * Add mask text to the current component. The layout is the same as that of the current component. + * + * @param { string } value + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Add mask text to the current component. The layout is the same as that of the current component. + * + * @param { string } value + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Add mask text to the current component. The layout is the same as that of the current component. + * + * @param { string | CustomBuilder } value + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Add mask text to the current component. The layout is the same as that of the current component. + * + * @param { string | CustomBuilder } value + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Add mask text to the current component. The layout is the same as that of the current component. + * + * @param { string | CustomBuilder | ComponentContent } value + * @param { OverlayOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + overlay(value: string | CustomBuilder | ComponentContent, options?: OverlayOptions): T; + + /** + * Linear Gradient + * angle: Angle of Linear Gradient. The default value is 180; + * direction: Direction of Linear Gradient. The default value is GradientDirection.Bottom; + * colors: Color description for gradients. + * repeating: repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Linear Gradient + * angle: Angle of Linear Gradient. The default value is 180; + * direction: Direction of Linear Gradient. The default value is GradientDirection.Bottom; + * colors: Color description for gradients. + * repeating: repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Linear Gradient + * angle: Angle of Linear Gradient. The default value is 180; + * direction: Direction of Linear Gradient. The default value is GradientDirection.Bottom; + * colors: Color description for gradients. + * repeating: repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Linear Gradient + * angle: Angle of Linear Gradient. The default value is 180; + * direction: Direction of Linear Gradient. The default value is GradientDirection.Bottom; + * colors: Color description for gradients. + * repeating: repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Linear Gradient + * angle: Angle of Linear Gradient. The default value is 180; + * direction: Direction of Linear Gradient. The default value is GradientDirection.Bottom; + * colors: Color description for gradients. + * repeating: repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + linearGradient(value: { + angle?: number | string; + direction?: GradientDirection; + colors: Array<[ResourceColor, number]>; + repeating?: boolean; + }): T; + + /** + * Angle Gradient + * center:is the center point of the angle gradient + * start:Start point of angle gradient. The default value is 0 + * end:End point of angle gradient. The default value is 0 + * number:number + * rotating:rotating. The default value is 0 + * colors:Color description for gradients + * repeating:repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Angle Gradient + * center:is the center point of the angle gradient + * start:Start point of angle gradient. The default value is 0 + * end:End point of angle gradient. The default value is 0 + * number:number + * rotating:rotating. The default value is 0 + * colors:Color description for gradients + * repeating:repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Angle Gradient + * center:is the center point of the angle gradient + * start:Start point of angle gradient. The default value is 0 + * end:End point of angle gradient. The default value is 0 + * number:number + * rotating:rotating. The default value is 0 + * colors:Color description for gradients + * repeating:repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Angle Gradient + * center:is the center point of the angle gradient + * start:Start point of angle gradient. The default value is 0 + * end:End point of angle gradient. The default value is 0 + * number:number + * rotating:rotating. The default value is 0 + * colors:Color description for gradients + * repeating:repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Angle Gradient + * center:is the center point of the angle gradient + * start:Start point of angle gradient. The default value is 0 + * end:End point of angle gradient. The default value is 0 + * number:number + * rotating:rotating. The default value is 0 + * colors:Color description for gradients + * repeating:repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + sweepGradient(value: { + center: [Length, Length]; + start?: number | string; + end?: number | string; + rotation?: number | string; + colors: Array<[ResourceColor, number]>; + repeating?: boolean; + }): T; + + /** + * Radial Gradient + * center:Center point of radial gradient + * radius:Radius of Radial Gradient. value range [0, +∞) + * colors:Color description for gradients + * repeating: Refill. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Radial Gradient + * center:Center point of radial gradient + * radius:Radius of Radial Gradient. value range [0, +∞) + * colors:Color description for gradients + * repeating: Refill. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Radial Gradient + * center:Center point of radial gradient + * radius:Radius of Radial Gradient. value range [0, +∞) + * colors:Color description for gradients + * repeating: Refill. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Radial Gradient + * center:Center point of radial gradient + * radius:Radius of Radial Gradient. value range [0, +∞) + * colors:Color description for gradients + * repeating: Refill. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Radial Gradient + * center:Center point of radial gradient + * radius:Radius of Radial Gradient. value range [0, +∞) + * colors:Color description for gradients + * repeating: Refill. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + radialGradient(value: { + center: [Length, Length]; + radius: number | string; + colors: Array<[ResourceColor, number]>; + repeating?: boolean; + }): T; + + /** + * Set the motion path of the component + * path:Motion path for displacement animation, using the svg path string. + * from:Start point of the motion path. The default value is 0.0. + * to:End point of the motion path. The default value is 1.0. + * rotatable:Whether to follow the path for rotation. + * + * @param { MotionPathOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the motion path of the component + * path:Motion path for displacement animation, using the svg path string. + * from:Start point of the motion path. The default value is 0.0. + * to:End point of the motion path. The default value is 1.0. + * rotatable:Whether to follow the path for rotation. + * + * @param { MotionPathOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the motion path of the component + * path:Motion path for displacement animation, using the svg path string. + * from:Start point of the motion path. The default value is 0.0. + * to:End point of the motion path. The default value is 1.0. + * rotatable:Whether to follow the path for rotation. + * + * @param { MotionPathOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + motionPath(value: MotionPathOptions): T; + + /** + * Add a shadow effect to the current component + * + * @param { ShadowOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Add a shadow effect to the current component + * + * @param { ShadowOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Add a shadow effect to the current component + * + * @param { ShadowOptions | ShadowStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Add a shadow effect to the current component + * + * @param { ShadowOptions | ShadowStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + shadow(value: ShadowOptions | ShadowStyle): T; + + /** + * Add a blendMode effect to the current component + * + * @param { BlendMode } value - Different hybrid modes + * @param { BlendApplyType } [type] - Different blend apply type + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Add a blendMode effect to the current component + * + * @param { BlendMode } value - Different hybrid modes + * @param { BlendApplyType } [type] - Different blend apply type + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + blendMode(value: BlendMode, type?: BlendApplyType): T; + + /** + * Add a blendMode effect to the current component.Cannot be used together with the blendMode interface. + * + * @param { BlendMode | Blender } effect - When the effect type is BlendMode type, define Different hybrid modes. + * When the effect type is Blender type, Define the corresponding blending effect. + * @param { BlendApplyType } [type] - Different blend apply type + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 13 + */ + advancedBlendMode(effect: BlendMode | Blender, type?: BlendApplyType): T; + + /** + * Whether to crop the sub components beyond the current component range. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + clip(value: boolean): T; + + /** + * When the parameter is of the Shape type, the current component is cropped according to the specified shape. + * When the parameter is of the boolean type, this parameter specifies whether to crop based on the edge contour. + * + * @param { boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * When the parameter is of the Shape type, the current component is cropped according to the specified shape. + * When the parameter is of the boolean type, this parameter specifies whether to crop based on the edge contour. + * + * @param { boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * When the parameter is of the Shape type, the current component is cropped according to the specified shape. + * When the parameter is of the boolean type, this parameter specifies whether to crop based on the edge contour. + * + * @param { boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * When the parameter is of the Shape type, the current component is cropped according to the specified shape. + * When the parameter is of the boolean type, this parameter specifies whether to crop based on the edge contour. + * + * @param { boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead CommonMethod#clipShape + */ + clip(value: boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute): T; + + /** + * The current component is cropped according to the specified shape. + * + * @param { CircleShape | EllipseShape | PathShape | RectShape } value - indicates the shape of the clip. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + clipShape(value: CircleShape | EllipseShape | PathShape | RectShape): T; + + /** + * Sets the mask of the current component. + * + * @param { ProgressMask } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + mask(value: ProgressMask): T; + + /** + * Applies a mask of the specified shape to the current assembly. + * + * @param { CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Applies a mask of the specified shape to the current assembly. + * + * @param { CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask } value - indicates the shape of the mask. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Applies a mask of the specified shape to the current assembly. + * + * @param { CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask } value - indicates the shape of the mask. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Applies a mask of the specified shape to the current assembly. + * + * @param { CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask } value - indicates the shape of the mask. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead CommonMethod#maskShape + */ + mask(value: CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask): T; + + /** + * Applies a mask of the specified shape to the current assembly. + * + * @param { CircleShape | EllipseShape | PathShape | RectShape } value - indicates the shape of the mask. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + maskShape(value: CircleShape | EllipseShape | PathShape | RectShape): T; + + /** + * Key. User can set an key to the component to identify it. + * + * @param { string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + * @test + */ + key(value: string): T; + + /** + * Id. User can set an id to the component to identify it. + * + * @param { string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Id. User can set an id to the component to identify it. + * + * @param { string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Id. User can set an id to the component to identify it. + * + * @param { string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Id. User can set an id to the component to identify it. + * + * @param { string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + id(value: string): T; + + /** + * geometryTransition + * + * @param { string } id + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * geometryTransition + * + * @param { string } id + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * geometryTransition + * + * @param { string } id + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + geometryTransition(id: string): T; + /** + * Shared geometry transition + * + * @param { string } id - geometry transition id + * @param { GeometryTransitionOptions } options - Indicates the options of geometry transition. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Shared geometry transition + * + * @param { string } id - geometry transition id + * @param { GeometryTransitionOptions } options - Indicates the options of geometry transition. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + geometryTransition(id: string, options?: GeometryTransitionOptions): T; + + /** + * Popup control + * + * @param { boolean } show + * @param { PopupOptions } popup + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Popup control + * + * @param { boolean } show + * @param { PopupOptions | CustomPopupOptions } popup + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Popup control + * + * @param { boolean } show + * @param { PopupOptions | CustomPopupOptions } popup + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + bindPopup(show: boolean, popup: PopupOptions | CustomPopupOptions): T; + + /** + * Menu control + * + * @param { { value: ResourceStr; icon?: ResourceStr; action: () => void }[] | CustomBuilder } content + * action: () => void }[] | CustomBuilder } content - Indicates the content of menu. + * @param { MenuOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Menu control + * + * @param { { value: ResourceStr; icon?: ResourceStr; action: () => void }[] | CustomBuilder } content + * action: () => void }[] | CustomBuilder } content - Indicates the content of menu. + * @param { MenuOptions } options - Indicates the options of menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Menu control + * + * @param { Array | CustomBuilder } content - Indicates the content of menu. + * @param { MenuOptions } options - Indicates the options of menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + bindMenu(content: Array | CustomBuilder, options?: MenuOptions): T; + + /** + * Menu control + * + * @param { boolean } isShow true means display menu, false means hide menu. + * @param { Array | CustomBuilder } content - Indicates the content of menu. + * @param { MenuOptions } options - Indicates the options of menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Menu control + * + * @param { boolean } isShow true means display menu, false means hide menu. + * @param { Array | CustomBuilder } content - Indicates the content of menu. + * @param { MenuOptions } options - Indicates the options of menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindMenu(isShow: boolean, content: Array | CustomBuilder, options?: MenuOptions): T; + + /** + * ContextMenu control + * + * @param { CustomBuilder } content + * @param { ResponseType } responseType + * @param { ContextMenuOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * ContextMenu control + * + * @param { CustomBuilder } content - Indicates the content of context menu. + * @param { ResponseType } responseType - Indicates response type of context menu. + * @param { ContextMenuOptions } options - Indicates the options of context menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * ContextMenu control + * + * @param { CustomBuilder } content - Indicates the content of context menu. + * @param { ResponseType } responseType - Indicates response type of context menu. + * @param { ContextMenuOptions } options - Indicates the options of context menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + bindContextMenu(content: CustomBuilder, responseType: ResponseType, options?: ContextMenuOptions): T; + + /** + * ContextMenu control + * + * @param { boolean } isShown - true means display content, false means hide content. + * @param { CustomBuilder } content - Indicates the content of context menu. + * @param { ContextMenuOptions } [options] - Indicates the options of context menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindContextMenu(isShown: boolean, content: CustomBuilder, options?: ContextMenuOptions): T; + + /** + * Bind content cover + * + * @param { boolean } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ModalTransition } type - transition type. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bind content cover + * + * @param { boolean } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ModalTransition } type - transition type. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Bind content cover + * + * @param { Optional } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ModalTransition } [type] - transition type. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindContentCover(isShow: Optional, builder: CustomBuilder, type?: ModalTransition): T; + + /** + * Bind content cover + * + * @param { boolean } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ContentCoverOptions } options - options of content cover. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bind content cover + * + * @param { boolean } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ContentCoverOptions } options - options of content cover. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Bind content cover + * + * @param { Optional } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ContentCoverOptions } [options] - options of content cover. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindContentCover(isShow: Optional, builder: CustomBuilder, options?: ContentCoverOptions): T; + + /** + * Bind sheet + * + * @param { boolean } isShow - true means display sheet, false means hide sheet. + * @param { CustomBuilder } builder - the sheet to be displayed. + * @param { SheetOptions } options - options of sheet. + * @returns { T } - template type + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bind sheet + * + * @param { boolean } isShow - true means display sheet, false means hide sheet. + * @param { CustomBuilder } builder - the sheet to be displayed. + * @param { SheetOptions } options - options of sheet. + * @returns { T } - template type + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Bind sheet + * + * @param { Optional } isShow - true means display sheet, false means hide sheet. + * @param { CustomBuilder } builder - the sheet to be displayed. + * @param { SheetOptions } [options] - options of sheet. + * @returns { T } - template type + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindSheet(isShow: Optional, builder: CustomBuilder, options?: SheetOptions): T; + + /** + * Sets styles for component state. + * + * @param { StateStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets styles for component state. + * + * @param { StateStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets styles for component state. + * + * @param { StateStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets styles for component state. + * + * @param { StateStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stateStyles(value: StateStyles): T; + + /** + * id for distribute identification. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * id for distribute identification. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + restoreId(value: number): T; + + /** + * Trigger a visible area change event. + * + * @param { Array } ratios + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Trigger a visible area change event. + * + * @param { Array } ratios + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger a visible area change event. + * + * @param { Array } ratios + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Trigger a visible area change event. + * + * @param { Array } ratios + * @param { VisibleAreaChangeCallback } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onVisibleAreaChange(ratios: Array, event: VisibleAreaChangeCallback): T; + + /** + * Set the spherical effect of the component. + * + * @param { number } value - set the degree of spherical effect, value range [0, 1]. + * If the value is 0, the component keep same, else the value is 1, component are fully spherical. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + sphericalEffect(value: number): T; + + /** + * Set the light up effect of the component + * + * @param { number } value - set the degree to which the component lights up, value range [0, 1]. + * The color brightness in the component rendering content area is greater than the value and can be displayed, otherwise it will not be displayed. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lightUpEffect(value: number): T; + + /** + * Set the edge pixel stretch effect of the Component. + * + * @param { PixelStretchEffectOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pixelStretchEffect(options: PixelStretchEffectOptions): T; + + /** + * Sets hot keys + * + * @param { string | FunctionKey } value - Character of the combination key. + * @param { Array } keys - The modifier keys modify the action of key when the key are pressed at the same time. + * @param { function } [action] - Callback function, triggered when the shortcut keyboard is pressed. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets hot keys + * + * @param { string | FunctionKey } value - Character of the combination key. + * @param { Array } keys - The modifier keys modify the action of key when the key are pressed at the same time. + * @param { function } [action] - Callback function, triggered when the shortcut keyboard is pressed. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + keyboardShortcut(value: string | FunctionKey, keys: Array, action?: () => void): T; + + /** + * Sets accessibilityGroup + * + * @param { boolean } value - set group with accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets accessibilityGroup + * + * @param { boolean } value - set group with accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets accessibilityGroup + * + * @param { boolean } value - set group with accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityGroup(value: boolean): T; + + /** + * Sets accessibilityGroup + * + * @param { boolean } isGroup - set group with accessibility + * @param { AccessibilityOptions } accessibilityOptions - accessibilityOptions for accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + accessibilityGroup(isGroup: boolean, accessibilityOptions: AccessibilityOptions): T; + + /** + * Sets accessibilityText + * + * @param { string } value - set accessibility text + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets accessibilityText + * + * @param { string } value - set accessibility text + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets accessibilityText + * + * @param { string } value - set accessibility text + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityText(value: string): T; + + /** + * Sets accessibilityText + * + * @param { Resource } text - set accessibility text + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityText(text: Resource): T; + + /** + * Sets accessibilityTextHint + * + * @param { string } value - set accessibility text hint + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityTextHint(value: string): T; + + /** + * Sets accessibilityDescription + * + * @param { string } value - set description of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets accessibilityDescription + * + * @param { string } value - set description of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets accessibilityDescription + * + * @param { string } value - set description of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityDescription(value: string): T; + + /** + * Sets accessibilityDescription + * + * @param { Resource } description - set description of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityDescription(description: Resource): T; + + /** + * Sets accessibilityLevel + * + * @param { string } value - set accessibility level + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets accessibilityLevel + * + * @param { string } value - set accessibility level + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets accessibilityLevel + * + * @param { string } value - set accessibility level + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityLevel(value: string): T; + + /** + * Sets accessibilityVirtualNode + * + * @param { CustomBuilder } builder - set virtual node of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets accessibilityVirtualNode + * + * @param { CustomBuilder } builder - set virtual node of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityVirtualNode(builder: CustomBuilder): T; + + /** + * Sets accessibilityChecked + * + * @param { boolean } isCheck - set accessibility checked status + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + accessibilityChecked(isCheck: boolean): T; + + /** + * Sets accessibilitySelected + * + * @param { boolean } isSelect - set accessibility selected status + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + accessibilitySelected(isSelect: boolean): T; + + /** + * Sets obscured + * + * @param { Array } reasons - reasons of obscuration + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets obscured + * + * @param { Array } reasons - reasons of obscuration + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + obscured(reasons: Array): T; + + /** + * Reuse id is used for identify the reuse type for each custom node. + * + * @param { string } id - The id for reusable custom node. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Reuse id is used for identify the reuse type for each custom node. + * + * @param { string } id - The id for reusable custom node. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + reuseId(id: string): T; + + /** + * Sets how content is drawn within nodes duration animation + * + * @param { RenderFit } fitMode - The render fit mode of content. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets how content is drawn within nodes duration animation + * + * @param { RenderFit } fitMode - The render fit mode of content. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + renderFit(fitMode: RenderFit): T; + + /** + * Sets the attribute modifier. + * + * @param { AttributeModifier } modifier + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets the attribute modifier. + * + * @param { AttributeModifier } modifier + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + attributeModifier(modifier: AttributeModifier): T; + + /** + * Sets the gesture modifier. + * + * @param { GestureModifier } modifier + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + gestureModifier(modifier: GestureModifier): T; + + /** + * Adds a background dynamic light up effect to the current component. + * + * @param { BackgroundBrightnessOptions } params - params indicates BackgroundBrightnessOptions + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + backgroundBrightness(params: BackgroundBrightnessOptions): T; + + /** + * When a gesture bound to this component will be accepted, a user-defined callback is triggered to get the result + * + * @param { function } callback - A callback instance used when a gesture bound to this component will be accepted. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * When a gesture bound to this component will be accepted, a user-defined callback is triggered to get the result + * + * @param { function } callback - A callback instance used when a gesture bound to this component will be accepted. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onGestureJudgeBegin(callback: (gestureInfo: GestureInfo, event: BaseGestureEvent) => GestureJudgeResult): T; + + /** + * When a gesture bound to this component will be accepted, a user-defined callback is triggered to get the result + * + * @param { GestureRecognizerJudgeBeginCallback } callback - A callback instance used when a gesture bound to this component will be accepted. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onGestureRecognizerJudgeBegin(callback: GestureRecognizerJudgeBeginCallback): T; + + /** + * When a gesture bound to this component will be accepted, a user-defined callback is triggered to get the result + * + * @param { GestureRecognizerJudgeBeginCallback } callback - A callback instance used when a gesture bound to this component will be accepted. + * @param { boolean } exposeInnerGesture - This parameter is a flag. This flag determines whether to expose internal gestures. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * + * @since 13 + */ + onGestureRecognizerJudgeBegin(callback: GestureRecognizerJudgeBeginCallback, exposeInnerGesture: boolean): T; + + /** + * In the touch test phase, the recognizer is selected to form a parallel relationship with other recognizers on the response chain. + * + * @param { ShouldBuiltInRecognizerParallelWithCallback } callback - A callback instance used when a component is doing touch test. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shouldBuiltInRecognizerParallelWith(callback: ShouldBuiltInRecognizerParallelWithCallback): T; + + /** + * Events are monopolized by components. + * + * @param { boolean } monopolize - indicate the monopoly of events + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Events are monopolized by components. + * + * @param { boolean } monopolize - indicate the monopoly of events + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + monopolizeEvents(monopolize: boolean): T; + + /** + * When the component does a touch test, a user-defined callback is triggered. + * + * @param { Callback } callback - A callback instance used when the component does a touch test. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onTouchIntercept(callback: Callback): T; + + /** + * This callback is triggered when the size of this component change finished. + * + * @param { SizeChangeCallback } event - event callback. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + onSizeChange(event: SizeChangeCallback): T; +} + +/** + * CommonAttribute for ide. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * CommonAttribute for ide. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CommonAttribute for ide. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CommonAttribute for ide. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CommonAttribute extends CommonMethod {} + +/** + * CommonInterface for ide. + * + * @interface CommonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * CommonInterface for ide. + * + * @interface CommonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CommonInterface for ide. + * + * @interface CommonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CommonInterface for ide. + * + * @interface CommonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface CommonInterface { + /** + * Constructor. + * + * @returns { CommonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Constructor + * + * @returns { CommonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Constructor + * + * @returns { CommonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructor + * + * @returns { CommonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (): CommonAttribute; +} + +/** + * CommonInstance for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * CommonInstance for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CommonInstance for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CommonInstance for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const CommonInstance: CommonAttribute; + +/** + * Common for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Common for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Common for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Common for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Common: CommonInterface; + +/** + * Defines the CustomBuilder Type. + * + * @typedef { (() => any) | void } CustomBuilder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the CustomBuilder Type. + * + * @typedef { (() => any) | void } CustomBuilder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the CustomBuilder Type. + * + * @typedef { (() => any) | void } CustomBuilder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the CustomBuilder Type. + * + * @typedef { (() => any) | void } CustomBuilder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type CustomBuilder = (() => any) | void; + +/** + * Defines the OverlayOptions interface. + * + * @typedef OverlayOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface OverlayOptions { + /** + * Defines align type. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines align type. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines align type. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines align type. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + align?: Alignment; + + /** + * Defines offset type. + * + * @type { ?OverlayOffset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines offset type. + * + * @type { ?OverlayOffset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines offset type. + * + * @type { ?OverlayOffset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines offset type. + * + * @type { ?OverlayOffset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + offset?: OverlayOffset; +} + +/** + * Defines the OverlayOffset. + * + * @typedef OverlayOffset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface OverlayOffset { + /** + * Defines x. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines x. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines x. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines x. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: number; + /** + * Defines y. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines y. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines y. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines y. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: number; +} + +/** + * Defines the segment of blur. + * The first element in the tuple means fraction. + * The range of this value is [0,1]. A value of 1 means opaque and 0 means completely transparent. + * The second element means the stop position. + * The range of this value is [0,1]. A value of 1 means region ending position and 0 means region starting position. + * + * @typedef { [ number, number ] } FractionStop + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare type FractionStop = [ number, number ]; + +/** + * CommonShapeMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * CommonShapeMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CommonShapeMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CommonShapeMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CommonShapeMethod extends CommonMethod { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 9 + */ + constructor(); + + /** + * border Color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * border Color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * border Color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * border Color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stroke(value: ResourceColor): T; + + /** + * Fill color. + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Fill color. + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Fill color. + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Fill color. + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fill(value: ResourceColor): T; + + /** + * Offset from the start point of the border drawing. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Offset from the start point of the border drawing. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Offset from the start point of the border drawing. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Offset from the start point of the border drawing. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeDashOffset(value: number | string): T; + + /** + * Path endpoint drawing style. + * + * @param { LineCapStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Path endpoint drawing style. + * + * @param { LineCapStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Path endpoint drawing style. + * + * @param { LineCapStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Path endpoint drawing style. + * + * @param { LineCapStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeLineCap(value: LineCapStyle): T; + + /** + * Border corner drawing style. + * + * @param { LineJoinStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Border corner drawing style. + * + * @param { LineJoinStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border corner drawing style. + * + * @param { LineJoinStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border corner drawing style. + * + * @param { LineJoinStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeLineJoin(value: LineJoinStyle): T; + + /** + * Limits for drawing acute angles as bevels + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Limits for drawing acute angles as bevels + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Limits for drawing acute angles as bevels + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Limits for drawing acute angles as bevels + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeMiterLimit(value: number | string): T; + + /** + * Sets the opacity of the border. + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the opacity of the border. + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the opacity of the border. + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the opacity of the border. + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeOpacity(value: number | string | Resource): T; + + /** + * fill Opacity + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * fill Opacity + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * fill Opacity + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * fill Opacity + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fillOpacity(value: number | string | Resource): T; + + /** + * Sets the width of the dividing line. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the width of the dividing line. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the width of the dividing line. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the width of the dividing line. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeWidth(value: Length): T; + + /** + * Indicates whether to enable anti-aliasing + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether to enable anti-aliasing + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates whether to enable anti-aliasing + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates whether to enable anti-aliasing + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + antiAlias(value: boolean): T; + + /** + * Sets the gap for the border. + * + * @param { Array } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the gap for the border. + * + * @param { Array } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the gap for the border. + * + * @param { Array } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the gap for the border. + * + * @param { Array } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeDashArray(value: Array): T; +} + +/** + * Linear Gradient Interface + * + * @interface LinearGradient + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Linear Gradient Interface + * + * @interface LinearGradient + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Linear Gradient Interface + * + * @interface LinearGradient + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface LinearGradient { + /** + * Linear Gradient Angle + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Linear Gradient Angle + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Linear Gradient Angle + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + angle?: number | string; + /** + * Linear Gradient Direction + * + * @type { ?GradientDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Linear Gradient Direction + * + * @type { ?GradientDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Linear Gradient Direction + * + * @type { ?GradientDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + direction?: GradientDirection; + /** + * Linear Gradient Colors + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Linear Gradient Colors + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Linear Gradient Colors + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Linear Gradient Colors + * + * @type { Array<[ResourceColor, number]> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + colors: Array<[ResourceColor, number]>; + /** + * Linear Gradient Repeating + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Linear Gradient Repeating + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Linear Gradient Repeating + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + repeating?: boolean; +} + +/** + * Defines the pixel round property. + * + * @interface PixelRoundPolicy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface PixelRoundPolicy { + /** + * start property. + * + * @type { ?PixelRoundCalcPolicy } + * @default PixelRoundCalcPolicy.NO_FORCE_ROUND + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + start?: PixelRoundCalcPolicy; + + /** + * top property. + * + * @type { ?PixelRoundCalcPolicy } + * @default PixelRoundCalcPolicy.NO_FORCE_ROUND + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + top?: PixelRoundCalcPolicy; + + /** + * end property. + * + * @type { ?PixelRoundCalcPolicy } + * @default PixelRoundCalcPolicy.NO_FORCE_ROUND + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + end?: PixelRoundCalcPolicy; + + /** + * bottom property. + * + * @type { ?PixelRoundCalcPolicy } + * @default PixelRoundCalcPolicy.NO_FORCE_ROUND + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + bottom?: PixelRoundCalcPolicy; +} + +/** + * Linear Gradient Blur Interface + * + * @interface LinearGradientBlurOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface LinearGradientBlurOptions { + /** + * Percentage of blurring effect. + * + * @type { FractionStop[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + fractionStops: FractionStop[]; + /** + * Direction of linear gradient blur. + * + * @type { GradientDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + direction: GradientDirection; +} + +/** + * Define motion blur anchor coordinates. + * + * @interface MotionBlurAnchor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface MotionBlurAnchor { + /** + * Define anchor coordinate x-value.Value range [0.0, 1.0]. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + x: number; + /** + * Define anchor coordinate y-value.Value range [0.0, 1.0]. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + y: number; +} + +/** + * Define motion blur options. + * + * @interface MotionBlurOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface MotionBlurOptions { + /** + * Define the size of motion blur radius.The range of this value is [0.0, ∞). + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + radius: number; + /** + * Define motion blur anchor coordinates. + * + * @type { MotionBlurAnchor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + anchor: MotionBlurAnchor; +} + +/** + * Sub component border info. + * + * @interface LayoutBorderInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ +declare interface LayoutBorderInfo { + /** + * Sub component borderWidth info. + * + * @type { EdgeWidths } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + borderWidth: EdgeWidths; + + /** + * Sub component margin info. + * + * @type { Margin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + margin: Margin, + + /** + * Sub component padding info. + * + * @type { Padding } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + padding: Padding, +} + +/** + * Sub component layout info. + * + * @interface LayoutInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ +declare interface LayoutInfo { + /** + * Sub component position info. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + position: Position, + + /** + * Sub component constraint info. + * + * @type { ConstraintSizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + constraint: ConstraintSizeOptions, +} + +/** + * Sub component info passed from framework when layout and measure happens. + * + * @interface LayoutChild + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ +declare interface LayoutChild { + /** + * Sub component name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + name: string, + + /** + * Sub component id. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + id: string, + + /** + * Sub component constraint. + * + * @type { ConstraintSizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + constraint: ConstraintSizeOptions, + + /** + * Sub component border info. + * + * @type { LayoutBorderInfo } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + borderInfo: LayoutBorderInfo, + + /** + * Sub component position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + position: Position, + + /** + * Call this measure method in onMeasure callback to supply sub component size. + * + * @param { ConstraintSizeOptions } childConstraint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + measure(childConstraint: ConstraintSizeOptions), + + /** + * Call this layout method in onLayout callback to assign layout info to sub component. + * + * @param { LayoutInfo } childLayoutInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + layout(childLayoutInfo: LayoutInfo), +} + +/** + * Sub component layout info. + * + * @interface GeometryInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sub component layout info. + * + * @interface GeometryInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface GeometryInfo extends SizeResult { + /** + * Sub component borderWidth info. + * + * @type { EdgeWidth } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sub component borderWidth info. + * + * @type { EdgeWidth } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + borderWidth: EdgeWidth; + + /** + * Sub component margin info. + * + * @type { Margin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sub component margin info. + * + * @type { Margin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + margin: Margin, + + /** + * Sub component padding info. + * + * @type { Padding } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sub component padding info. + * + * @type { Padding } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + padding: Padding, +} + +/** + * Sub component info passed from framework when layout happens. + * + * @interface Layoutable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sub component info passed from framework when layout happens. + * + * @interface Layoutable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface Layoutable { + /** + * Measurement result of the child component. + * + * @type { MeasureResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Measurement result of the child component. + * + * @type { MeasureResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + measureResult: MeasureResult, + + /** + * Call this layout method in onLayout callback to assign layout info to sub component. + * + * @param { Position } position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Call this layout method in onLayout callback to assign layout info to sub component. + * + * @param { Position } position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + layout(position: Position): void, + + /** + * Call this method to get the margin of sub component. + * + * @returns { DirectionalEdgesT } the margin of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getMargin() : DirectionalEdgesT, + + /** + * Call this method to get the padding of sub component. + * + * @returns { DirectionalEdgesT } the padding of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getPadding() : DirectionalEdgesT, + + /** + * Call this method to get the borderWidth of sub component. + * + * @returns { DirectionalEdgesT } the borderWidth of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getBorderWidth() : DirectionalEdgesT, +} + +/** + * Sub component info passed from framework when measure happens. + * + * @interface Measurable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sub component info passed from framework when measure happens. + * + * @interface Measurable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface Measurable { + /** + * Call this measure method in onMeasure callback to supply sub component size. + * + * @param { ConstraintSizeOptions } constraint + * @returns { MeasureResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Call this measure method in onMeasure callback to supply sub component size. + * + * @param { ConstraintSizeOptions } constraint + * @returns { MeasureResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + measure(constraint: ConstraintSizeOptions) : MeasureResult, + + /** + * Call this method to get the margin of sub component. + * + * @returns { DirectionalEdgesT } the margin of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getMargin() : DirectionalEdgesT, + + /** + * Call this method to get the padding of sub component. + * + * @returns { DirectionalEdgesT } the padding of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getPadding() : DirectionalEdgesT, + + /** + * Call this method to get the borderWidth of sub component. + * + * @returns { DirectionalEdgesT } the borderWidth of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getBorderWidth() : DirectionalEdgesT, +} + +/** + * Sub component SizeResult info. + * + * @interface SizeResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sub component SizeResult info. + * + * @interface SizeResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SizeResult { + /** + * Width obtained from the measurement result. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Width obtained from the measurement result. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + width: number, + + /** + * Height obtained from the measurement result. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Height obtained from the measurement result. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + height: number, +} + +/** + * Sub component MeasureResult info. + * + * @interface MeasureResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sub component MeasureResult info. + * + * @interface MeasureResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MeasureResult extends SizeResult { + +} + +/** + * The navigation destination information. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * The navigation destination information. + * + * @typedef {import('../api/@ohos.arkui.observer').default.NavDestinationInfo} NavDestinationInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type NavDestinationInfo = import('../api/@ohos.arkui.observer').default.NavDestinationInfo; + +/** + * The navigation information. + * + * @typedef {import('../api/@ohos.arkui.observer').default.NavigationInfo} NavigationInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type NavigationInfo = import('../api/@ohos.arkui.observer').default.NavigationInfo; + +/** + * The router page information. + * + * @typedef {import('../api/@ohos.arkui.observer').default.RouterPageInfo} RouterPageInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type RouterPageInfo = import('../api/@ohos.arkui.observer').default.RouterPageInfo; + +/** + * UIContext + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * UIContext + * + * @typedef { import('../api/@ohos.arkui.UIContext').UIContext } UIContext + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type UIContext = import('../api/@ohos.arkui.UIContext').UIContext; + +/** + * DrawContext + * + * @typedef { import('../api/arkui/Graphics').DrawContext } DrawContext + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type DrawContext = import('../api/arkui/Graphics').DrawContext; + +/** + * VisualEffect + * + * @typedef { import('../api/@ohos.graphics.uiEffect').default.VisualEffect } VisualEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type VisualEffect = import('../api/@ohos.graphics.uiEffect').default.VisualEffect; + + +/** + * Filter + * + * @typedef { import('../api/@ohos.graphics.uiEffect').default.Filter } Filter + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type Filter = import('../api/@ohos.graphics.uiEffect').default.Filter; + +/** + * Blender + * + * @typedef { import('../api/@ohos.graphics.uiEffect').default.Blender } Blender + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 13 + */ +declare type Blender = import('../api/@ohos.graphics.uiEffect').default.Blender; + +/** + * ComponentContent. + * + * @typedef {import('../api/arkui/ComponentContent').ComponentContent} ComponentContent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ComponentContent = import('../api/arkui/ComponentContent').ComponentContent; + +/** + * Theme. + * + * @typedef {import('../api/@ohos.arkui.theme').Theme} Theme + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type Theme = import('../api/@ohos.arkui.theme').Theme; + +/** + * Custom Component + * + * @extends CommonAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Custom Component + * + * @extends CommonAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Custom Component + * + * @extends CommonAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Custom Component + * + * @extends CommonAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CustomComponent extends CommonAttribute { + /** + * Customize the pop-up content constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Customize the pop-up content constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Customize the pop-up content constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Customize the pop-up content constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + build(): void; + + /** + * aboutToAppear Method + * + * The aboutToAppear function is executed after a new instance of the custom component is created, before its build() function is executed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * aboutToAppear Method + * + * The aboutToAppear function is executed after a new instance of the custom component is created, before its build() function is executed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * aboutToAppear Method + * + * The aboutToAppear function is executed after a new instance of the custom component is created, before its build() function is executed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * aboutToAppear Method + * + * The aboutToAppear function is executed after a new instance of the custom component is created, before its build() function is executed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + aboutToAppear?(): void; + + /** + * aboutToDisappear Method + * + * The aboutToDisappear function executes before a custom component is destroyed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * aboutToDisappear Method + * + * The aboutToDisappear function executes before a custom component is destroyed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * aboutToDisappear Method + * + * The aboutToDisappear function executes before a custom component is destroyed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * aboutToDisappear Method + * + * The aboutToDisappear function executes before a custom component is destroyed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + aboutToDisappear?(): void; + + /** + * aboutToReuse Method + * + * @param { object } params - Custom component init params. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * aboutToReuse Method + * + * @param { object } params - Custom component init params. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + aboutToReuse?(params: { [key: string]: unknown }): void; + + /** + * aboutToRecycle Method + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * aboutToRecycle Method + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + aboutToRecycle?(): void; + + /** + * The onWillApplyTheme function is a custom hook to get active theme object from the context + * + * @param { Theme } theme - Custom theme init params. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillApplyTheme?(theme: Theme): void; + + /** + * Custom component override this method to layout each of its sub components. + * + * @param { Array } children + * @param { ConstraintSizeOptions } constraint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + * @useinstead CustomComponent#onPlaceChildren + */ + onLayout?(children: Array, constraint: ConstraintSizeOptions): void; + + /** + * Custom component override this method to layout each of its sub components. + * + * @param { GeometryInfo } selfLayoutInfo + * @param { Array } children + * @param { ConstraintSizeOptions } constraint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Custom component override this method to layout each of its sub components. + * + * @param { GeometryInfo } selfLayoutInfo + * @param { Array } children + * @param { ConstraintSizeOptions } constraint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onPlaceChildren?(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): void; + + /** + * Custom component override this method to measure each of its sub components. + * + * @param { Array } children + * @param { ConstraintSizeOptions } constraint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + * @useinstead CustomComponent#onMeasureSize + */ + onMeasure?(children: Array, constraint: ConstraintSizeOptions): void; + + /** + * Custom component override this method to measure each of its sub components. + * @param { GeometryInfo } selfLayoutInfo + * @param { Array } children - indicate the measure child + * @param { ConstraintSizeOptions } constraint - indicate child constraint size + * @returns { SizeResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Custom component override this method to measure each of its sub components. + * @param { GeometryInfo } selfLayoutInfo + * @param { Array } children - indicate the measure child + * @param { ConstraintSizeOptions } constraint - indicate child constraint size + * @returns { SizeResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onMeasureSize?(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): SizeResult; + + /** + * onPageShow Method + * + * The page is triggered once each time it is displayed, including scenarios such as the routing process and the application entering the foreground + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * onPageShow Method + * + * The page is triggered once each time it is displayed, including scenarios such as the routing process and the application entering the foreground + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * onPageShow Method + * + * The page is triggered once each time it is displayed, including scenarios such as the routing process and the application entering the foreground + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onPageShow?(): void; + + /** + * onPageHide Method + * + * It is triggered once each time the page is hidden, including scenarios such as the routing process and the application entering the background + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * onPageHide Method + * + * It is triggered once each time the page is hidden, including scenarios such as the routing process and the application entering the background + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * onPageHide Method + * + * It is triggered once each time the page is hidden, including scenarios such as the routing process and the application entering the background + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onPageHide?(): void; + + /** + * onFormRecycle Method, this is only for ArkTS form, if form was marked recyclable by form user, when system memory is low, + * it will be recycled after calling this method, you should return a string of params that you wish to be saved, it will be + * passed back as params in onFormRecover, in which you can recover the form + * + * @returns { string } status data of ArkTS form UI, this data will be passed in when recover form later + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * onFormRecycle Method, this is only for ArkTS form, if form was marked recyclable by form user, when system memory is low, + * it will be recycled after calling this method, you should return a string of params that you wish to be saved, it will be + * passed back as params in onFormRecover, in which you can recover the form + * + * @returns { string } status data of ArkTS form UI, this data will be passed in when recover form later + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + onFormRecycle?(): string; + + /** + * onFormRecover Method, this is only for ArkTS form + * + * @param { string } statusData - indicate status data of ArkTS form UI, which is acquired by calling onFormRecycle, it is used to recover form + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * onFormRecover Method, this is only for ArkTS form + * + * @param { string } statusData - indicate status data of ArkTS form UI, which is acquired by calling onFormRecycle, it is used to recover form + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + onFormRecover?(statusData: string): void; + + /** + * onBackPress Method + * + * Triggered when the user clicks the back button + * + * @returns { void | boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * onBackPress Method + * + * Triggered when the user clicks the back button + * + * @returns { void | boolean } true means that the page itself processes the return logic. + * false means that the default return logic is used. + * If no value is returned, the default return logic is used. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * onBackPress Method + * + * Triggered when the user clicks the back button + * + * @returns { void | boolean } true means that the page itself processes the return logic. + * false means that the default return logic is used. + * If no value is returned, the default return logic is used. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onBackPress?(): void | boolean; + + /** + * PageTransition Method. + * Implement Animation when enter this page or move to other pages. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * PageTransition Method. + * Implement Animation when enter this page or move to other pages. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * PageTransition Method. + * Implement Animation when enter this page or move to other pages. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pageTransition?(): void; + + /** + * Get current UIContext + * + * @returns { UIContext } The UIContext that the custom component belongs to. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get current UIContext + * + * @returns { UIContext } The UIContext that the custom component belongs to. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getUIContext(): UIContext; + + /** + * Get uniqueId of the custom component. + * + * @returns { number } - The uniqueId of the custom component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getUniqueId(): number; + + /** + * Queries the navigation destination information. + * + * @returns { NavDestinationInfo | undefined } The navigation destination information, or undefined if it is not available. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Queries the navigation destination information. + * + * @returns { NavDestinationInfo | undefined } The navigation destination information, or undefined if it is not available. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + queryNavDestinationInfo(): NavDestinationInfo | undefined; + + /** + * Query the navigation information of the current custom component. + * + * @returns { NavigationInfo | undefined } The navigation information, or undefined if it is not available + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + queryNavigationInfo(): NavigationInfo | undefined; + + /** + * Query the router page information of the current custom component. + * + * @returns { RouterPageInfo | undefined } The router page information, or undefined if it is not available. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + queryRouterPageInfo(): RouterPageInfo | undefined; + + /** + * The callback method after the custom component is built. + * + * Triggered when the custom component has been built. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidBuild?(): void; +} + +/** + * View + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * View + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 9 + */ +declare class View { + /** + * Just use for generate tsbundle + * + * @param { any } value + * @returns { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Just use for generate tsbundle + * + * @param { any } value + * @returns { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 9 + */ + create(value: any): any; +} + +/** + * Rect info. + * + * @interface RectResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Rect info. + * + * @interface RectResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RectResult { + /** + * x:Horizontal coordinate relative to the component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * x:Horizontal coordinate relative to the component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + x: number; + + /** + * y:Vertical axis coordinate relative to the component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * y:Vertical axis coordinate relative to the component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + y: number; + + /** + * Get the width of the current textRect. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get the width of the current textRect. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + width: number; + + /** + * Get the height of the current textRect. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get the height of the current textRect. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + height: number; +} + +/** + * CaretOffset info. + * + * @interface CaretOffset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * CaretOffset info. + * + * @interface CaretOffset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CaretOffset { + /** + * Get the index of the CaretOffset + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Get the index of the CaretOffset + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + index: number; + + /** + * Get the x of the relative position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Get the x of the relative position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + x: number; + + /** + * Get the y of the relative position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Get the y of the relative position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + y: number; +} + +/** + * TextContentControllerBase + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * TextContentControllerBase + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare abstract class TextContentControllerBase { + /** + * Get the index and relative position of the CaretOffset. + * + * @returns { CaretOffset } index and relative position of the CaretOffset. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the index and relative position of the CaretOffset. + * + * @returns { CaretOffset } index and relative position of the CaretOffset. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getCaretOffset() : CaretOffset; + + /** + * Get the start and end positions of the text content. + * + * @returns { RectResult } Text content rect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the start and end positions of the text content. + * + * @returns { RectResult } Text content rect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getTextContentRect() : RectResult; + + /** + * Get the lines number of the text content. + * + * @returns { number } Text content line count + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the lines number of the text content. + * + * @returns { number } Text content line count + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getTextContentLineCount() : number; +} + +/** + * Enum of scrollable containers' content clip mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare enum ContentClipMode { + /** + * Clip to content rect inside margin & padding. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + CONTENT_ONLY = 0, + + /** + * Clip to scrollable's outer rect, including padding but inside margin. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + BOUNDARY = 1, + + /** + * Clip to the safeArea of scrollable container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + SAFE_AREA = 2, +} + +/** + * CommonScrollableMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * CommonScrollableMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class ScrollableCommonMethod extends CommonMethod { + /** + * Scrollbar status. + * + * @param { BarState } barState - Scrollbar status. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBar(barState: BarState): T; + + /** + * Color of the scrollbar. + * + * @param { Color | number | string } color - Color of the scrollbar. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarColor(color: Color | number | string): T; + + /** + * Width of the scrollbar. + * + * @param { number | string } value - Width of the scrollbar. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarWidth(value: number | string): T; + + /** + * Edge scrolling effect. + * + * @param { EdgeEffect } edgeEffect - edge scrolling effect. + * @param { EdgeEffectOptions } options - edge scrolling effect options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + edgeEffect(edgeEffect: EdgeEffect, options?: EdgeEffectOptions): T; + + /** + * Called when setting whether to enable fading Edge effect. + * + * @param { Optional } enabled - Whether to turn on the edge fade effect + * @param { FadingEdgeOptions } [options] - The options of fadingEdge. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + fadingEdge(enabled: Optional, options?: FadingEdgeOptions): T; + + /** + * Nested scrolling options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: NestedScrollOptions): T; + + /** + * Whether to support scroll gestures by finger or mouse. + * + * @param { boolean } value - Whether to support scroll gestures by finger or mouse. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableScrollInteraction(value: boolean): T; + + /** + * Friction coefficient. + * + * @param { number | Resource } value - friction coefficient. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + friction(value: number | Resource): T; + + /** + * Called when the scrollable scrolls. + * + * @param { function } event - callback of scrollable, + * scrollOffset is offset per frame scrolling, ScrollState is current scroll state. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead ScrollableCommonMethod#onDidScroll + */ + onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void): T; + + /** + * Called when the scrollable will scroll. + * + * @param { Optional } handler - callback of scrollable. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillScroll(handler: Optional): T; + + /** + * Called when the scrollable did scroll. + * + * @param { OnScrollCallback } handler - callback of scrollable, + * scrollOffset is offset this frame did scroll, scrollState is current scroll state. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + onDidScroll(handler: OnScrollCallback): T; + + /** + * Called when the scrollable reaches the start position. + * + * @param { function } event - Callback function, triggered when the scrollable reaches the start position. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReachStart(event: () => void): T; + + /** + * Called when the scrollable reaches the end position. + * + * @param { function } event - Callback function, triggered when the scrollable reaches the end position. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReachEnd(event: () => void): T; + + /** + * Called when the scrollable starts scrolling. + * + * @param { function } event - Callback function, triggered when the scrollable starts scrolling. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollStart(event: () => void): T; + + /** + * Called when the scrollable stops scrolling. + * + * @param { function } event - Callback function, triggered when the scrollable stops scrolling. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollStop(event: () => void): T; + + /** + * Limit the max speed when fling. + * + * @param { number } speedLimit - Max fling speed, the minimum value is 0, the maximum value is not limited. + * The unit is vp/s. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + flingSpeedLimit(speedLimit: number): T; + + /** + * Clip the content of the scrollable container, excluding background. + * + * @param { ContentClipMode | RectShape } clip - A value from enum ContentClipMode or a customized clip rect. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + clipContent(clip: ContentClipMode | RectShape): T; +} + +/** + * The actual offset by which the scrollable scrolls. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ScrollResult { + /** + * Actual offset by which the scrollable scrolls in vp. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offsetRemain: number; +} + +/** + * Called before scroll to allow developer to control real offset the Scrollable can scroll. + * + * @typedef { function } OnWillScrollCallback + * @param { number } scrollOffset - offset this frame will scroll, which may or may not be reached. + * @param { ScrollState } scrollState - current scroll state. + * @param { ScrollSource } scrollSource - source of current scroll. + * @returns { void | ScrollResult } the remain offset for the scrollable, + * same as scrollOffset when no ScrollResult is returned. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type OnWillScrollCallback = +(scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => void | ScrollResult; + +/** + * On scroll callback using in scrollable onDidScroll. + * + * @typedef { function } OnScrollCallback + * @param { number } scrollOffset - offset this frame did scroll. + * @param { ScrollState } scrollState - current scroll state. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type OnScrollCallback = (scrollOffset: number, scrollState: ScrollState) => void; + +/** + * Defines the onMove callback. + * + * @typedef { function } OnMoveHandler + * @param { number } from - Index number for moving elements. + * @param { number } to - Target index number for moving elements. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type OnMoveHandler = (from: number, to: number) => void; + +/** + * Define DynamicNode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class DynamicNode { + /** + * Set the move action. + * + * @param { Optional } handler + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onMove(handler: Optional): T; +} + +/** + * Define EdgeEffect Options. + * + * @interface EdgeEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Define EdgeEffect Options. + * + * @interface EdgeEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface EdgeEffectOptions { + /** + * Enable Sliding effect when component does not full screen. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Enable Sliding effect when component does not full screen. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + alwaysEnabled: boolean; +} + +/** + * Indicates children main size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ChildrenMainSize { + /** + * Creates an instance of ChildrenMainSize. + * + * @param { number } childDefaultSize - default main size, in vp. If the main axis is vertical, it indicates height. + * If the main axis is horizontal, it indicates width. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(childDefaultSize: number); + + /** + * Set default size. + * + * @param { number } value - default main size, in vp. If the main axis is vertical, it indicates height. + * If the main axis is horizontal, it indicates width. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + set childDefaultSize(value: number); + + /** + * Get default size + * + * @returns { number } - default main size, in vp. If the main axis is vertical, it indicates height. + * If the main axis is horizontal, it indicates width. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + get childDefaultSize(): number; + + /** + * Changes children main size by removing or replacing existing elements and/or adding new elements in place. + * + * @param { number } start - Zero-based index at which to start changing the children main size. + * @param { number } [deleteCount] - Indicating the number of children main size to remove from start. + * @param { Array } [childrenSize] - Add the new children main size, beginning from start. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + * @example splice(1, 0, [100]), Insert a child after first child, the child's main size is 100vp. + * splice(1, 1), Delete the second child. + * splice(1, 2, [100, 100]), Change the main size of the second and third children to 100vp. + */ + splice(start: number, deleteCount?: number, childrenSize?: Array): void; + + /** + * Updates main size for specified child. + * + * @param { number } index - index of child to be updated. + * @param { number } childSize - new section options. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + update(index: number, childSize: number): void; +} + +/** + * Define BackgroundBrightness Options. + * + * @interface BackgroundBrightnessOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface BackgroundBrightnessOptions { + + /** + * Rate represents the rate at which lightUpDegree + * decreases with increasing pixel brightness. + * + * @type { number } -The default value is 0.0, value range: (0.0, +∞). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + rate: number; + + /** + * LightUpDegree represents the degree of brightness + * of the rgb value changes when its brightness + * is 0. + * + * @type { number } -The default value is 0.0, value range: [-1.0, 1.0]. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + lightUpDegree: number; +} + +/** + * PointLightStyle info + * + * @interface PointLightStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ +declare interface PointLightStyle { + /** + * Defines the PointLight light intensity and position. + * + * @type { ?LightSource } + * @default undefined + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + lightSource?: LightSource; + /** + * Defines the PointLight illuminated type. + * + * @type { ?IlluminatedType } + * @default IlluminatedType.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + illuminated?: IlluminatedType; + /** + * Defines the PointLight bloom. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + bloom?: number; +} + +/** + * LightSource info + * + * @interface LightSource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ +declare interface LightSource { + /** + * Defines the PointLight light positionX. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + positionX: Dimension; + /** + * Defines the PointLight light positionX. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + positionY: Dimension; + /** + * Defines the PointLight light positionX. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + positionZ: Dimension; + /** + * Defines the PointLight light intensity. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + intensity: number; + /** + * Defines the PointLight light color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + color?: ResourceColor; +} + +/** + * Defining wrapBuilder function. + * @param { function } builder + * @returns { WrappedBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defining wrapBuilder function. + * @param { function } builder + * @returns { WrappedBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare function wrapBuilder(builder: (...args: Args) => void): WrappedBuilder; + +/** + * Defines the WrappedBuilder class. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the WrappedBuilder class. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class WrappedBuilder { + /** + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + builder: (...args: Args) => void; + + /** + * @param { function } builder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * @param { function } builder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(builder: (...args: Args) => void); +} + + +/** + * Defines the overall animation parameters of the keyframe animation. + * + * @interface KeyframeAnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the overall animation parameters of the keyframe animation. + * + * @interface KeyframeAnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface KeyframeAnimateParam { + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + delay?: number; + + /** + * Animation iterations. When set to -1, the animation playing it repeatedly. The value range is greater than or equal to -1. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Animation iterations. When set to -1, the animation playing it repeatedly. The value range is greater than or equal to -1. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + iterations?: number; + + /** + * Callback invoked when the whole keyframe animation is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Callback invoked when the whole keyframe animation is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onFinish?: () => void; +} + +/** + * Defines a keyframe state. + * + * @interface KeyframeState + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines a keyframe state. + * + * @interface KeyframeState + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface KeyframeState { + /** + * Animation duration of this keyframe, in ms. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Animation duration of this keyframe, in ms. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + duration: number; + + /** + * Animation curve of this keyframe. + * + * @type { ?(Curve | string | ICurve) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Animation curve of this keyframe. + * + * @type { ?(Curve | string | ICurve) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + curve?: Curve | string | ICurve; + + /** + * The closure function to specify the terminating state of this keyframe. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The closure function to specify the terminating state of this keyframe. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + event: () => void; +} + + +/** + * Defines the basic callback. + * + * @typedef Callback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface Callback { + /** + * Defines the callback info. + * + * @param { T } data - the data will be used in the callback. + * @returns { V } - Returns result of the callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (data: T): V; +} + +/** + * Defines the callback type used in hover events. + * The value of isHover indicates whether the mouse is hovering over the component. + * The value of event contains information about HoverEvent. + * + * @typedef HoverCallback + * @param { boolean } isHover + * @param { HoverEvent} event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type HoverCallback = (isHover: boolean, event: HoverEvent) => void + +/** + * Defines the callback type used in accessibility hover events. + * The value of isHover indicates whether the touch is hovering over the component. + * The value of event contains information about AccessibilityHoverEvent. + * + * @typedef { function } + * @param { boolean } isHover + * @param { AccessibilityHoverEvent } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type AccessibilityCallback = (isHover: boolean, event: AccessibilityHoverEvent) => void + +/** + * Defines the options about VisibleAreaEvent. + * + * @interface VisibleAreaEventOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface VisibleAreaEventOptions { + /** + * Each number in ratios indicates the value of visibility ratio. Each number in the Array value range in [0, 1]. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ratios: Array; + + /** + * The value of expectedUpdateInterval indicates desired update period(ms). + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + expectedUpdateInterval?: number; +} + +/** + * Defines the callback type used in VisibleAreaChange events. + * + * @typedef { function } VisibleAreaChangeCallback + * @param { boolean } isVisible - Indicates the ratio of the visible area to its own area compared to the last change. + * It is true as the ratio increases and false as the ratio decreases. + * @param { number } currentRatio - The value of currentRatio indicates the visibility ratio of the current component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +/** + * Defines the callback type used in VisibleAreaChange events. + * + * @typedef { function } VisibleAreaChangeCallback + * @param { boolean } isExpanding - Indicates the ratio of the visible area to its own area compared to the last change. + * It is true as the ratio increases and false as the ratio decreases. + * @param { number } currentRatio - The value of currentRatio indicates the visibility ratio of the current component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type VisibleAreaChangeCallback = (isExpanding: boolean, currentRatio: number) => void; + +/** + * Defines a UICommonEvent which is used to set different common event to target component. + * + * @interface UICommonEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface UICommonEvent { + /** + * Set or reset the callback which will be triggered a click event when clicked. + * + * @param { Callback | undefined } callback - The callback about the click event. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnClick(callback: Callback | undefined): void; + + /** + * Set or reset the callback which will be triggered a touch event when touched. + * + * @param { Callback | undefined } callback - The callback about the touch event. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnTouch(callback: Callback | undefined): void; + + /** + * Set or reset the callback is triggered when a component mounts a display. + * + * @param { Callback | undefined } callback - The callback will be triggered when a component mounts a display. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnAppear(callback: Callback | undefined): void; + + /** + * Set or reset the callback is triggered when component uninstallation disappears. + * + * @param { Callback | undefined } callback - The callback will be triggered when component uninstallation disappears. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnDisappear(callback: Callback | undefined): void; + + + /** + * Set or reset the callback is triggered when component has keyboard input. + * + * @param { Callback | undefined } callback - The callback will be triggered when has keyboard input. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnKeyEvent(callback: Callback | undefined): void; + + /** + * Set or reset the callback which is triggered when component get focus. + * + * @param { Callback | undefined } callback - The callback will be triggered when a component get focus. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnFocus(callback: Callback | undefined): void; + + /** + * Set or reset the callback which is triggered when lose focus. + * + * @param { Callback | undefined } callback - The callback will be triggered when a component lose focus. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnBlur(callback: Callback | undefined): void; + + /** + * Set or reset the callback which is triggered when has a hover event. + * + * @param { HoverCallback | undefined } callback - The callback will be triggered when has a hover event. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnHover(callback: HoverCallback | undefined): void; + + /** + * Set or reset the callback which is triggered when has a mouse event. + * + * @param { Callback | undefined } callback - The callback will be triggered when has mouse input. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnMouse(callback: Callback | undefined): void; + + /** + * Set or reset the callback which is triggered when the size of component changed. + * + * @param { SizeChangeCallback | undefined } callback - The callback will be triggered when the size of component changed. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnSizeChange(callback: SizeChangeCallback | undefined): void; + + /** + * Set or reset the callback which is triggered when the visibleArea of component changed. + * + * @param { VisibleAreaEventOptions } options - The options for the visibility event. + * @param { VisibleAreaChangeCallback | undefined } event - The callback will be triggered when the visibleArea of component changed and get close to any number in ratios defined by options. + * If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnVisibleAreaApproximateChange(options: VisibleAreaEventOptions, event: VisibleAreaChangeCallback | undefined): void; +} + +/** + * Defines a UIGestureEvent which is used to set different gestures to target component. + * + * @interface UIGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface UIGestureEvent { + /** + * Add a gesture bound to the component. + * + * @param { GestureHandler } gesture - gesture indicates the gesture bound to a component. + * @param { GesturePriority } priority - priority indicates the gesture's priority. + * @param { GestureMask } mask - mask indicates the gesture's GestureMask value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + addGesture(gesture: GestureHandler, priority?: GesturePriority, mask?: GestureMask): void; + + /** + * Add a parallel gesture bound to the component. + * + * @param { GestureHandler } gesture - gesture indicates the gesture bound to a component. + * @param { GestureMask } mask - mask indicates the gesture's GestureMask value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + addParallelGesture(gesture: GestureHandler, mask?: GestureMask): void; + + /** + * Remove the gesture that is bound to the component and marked as tag. + * + * @param { string } tag - tag indicates the gesture's tag. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeGestureByTag(tag: string): void; + + /** + * Clear gestures bound to the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + clearGestures(): void; +} + +/** + * Defines the gesture modifier. + * + * @interface GestureModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GestureModifier { + /** + * Defines the gesture update function. + * + * @param { UIGestureEvent } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyGesture(event: UIGestureEvent): void; +} + +/** + * Defines the selection options. + * + * @interface SelectionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SelectionOptions { + /** + * Menu pop-up policy. + * + * @type { ?MenuPolicy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + menuPolicy?: MenuPolicy; +} + +/** + * enum keyboard avoid mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum KeyboardAvoidMode { + /** + * Defines avoid keyboard when keyboard shows. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DEFAULT = 0, + + /** + * Defines not avoid keyboard when keyboard shows. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NONE = 1, +} + +/** + * Enumerates the type of area in hover mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare enum HoverModeAreaType { + + /** + * Layout top half screen when the phone in hover mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + TOP_SCREEN = 0, + + /** + * Layout bottom half screen when the phone in hover mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + BOTTOM_SCREEN = 1, +} diff --git a/tests/arkts-sdk/ets/component3d.d.ts b/tests/arkts-sdk/ets/component3d.d.ts new file mode 100644 index 00000000..570ac83e --- /dev/null +++ b/tests/arkts-sdk/ets/component3d.d.ts @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2023-2024 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. + */ + +/** + * @file Defines 3D component + * @kit ArkUI + */ + +/** + * Provides methods for controlling the 3d scene + * + * @typedef { import('../api/@ohos.graphics.scene').Scene } + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ +declare type Scene = import('../api/@ohos.graphics.scene').Scene; + +/** + * The enum of model type + * @enum { number } + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ +declare enum ModelType { + /** + * Render to texture, gpu would compose this texture to screen. + * + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + TEXTURE = 0, + + /** + * Render to surface, special hardware would compose this surface to screen. + * + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + SURFACE = 1, +} + +/** + * Scene options used by 3D scene control + * + * @interface SceneOptions + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ +declare interface SceneOptions { + /** + * ResourceStr type for 3D rendering, Scene type for 3d scene controlling + * + * @type { ?(ResourceStr | Scene) } + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + scene?: ResourceStr | Scene; + + /** + * Scene type when 3D rendering + * + * @type { ?ModelType } + * @default ModelType.SURFACE + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + modelType?: ModelType; +} + +/** + * Defines Component3D. + * + * @interface Component3DInterface + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ +interface Component3DInterface { + /** + * SceneOptions used by constructor + * + * @param { SceneOptions } sceneOptions - The 3D scene controller + * @returns { Component3DAttribute } + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + (sceneOptions?: SceneOptions): Component3DAttribute; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ +declare class Component3DAttribute extends CommonMethod { + /** + * Load 3D model environment resource. + * + * @param { ResourceStr } uri - The path of 3D environment resource + * @returns { Component3DAttribute } The attribute of the component3D + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + environment(uri: ResourceStr): Component3DAttribute; + + /** + * Set render pipeline of 3D scene render. + * + * @param { ResourceStr } uri - The path of Render pipeline config file + * @param { boolean } selfRenderUpdate - Trigger rendering every frame + * @returns { Component3DAttribute } The attribute of the component3D + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + customRender(uri: ResourceStr, selfRenderUpdate: boolean): Component3DAttribute; + + /** + * Load shader uri. + * + * @param { ResourceStr } uri - The path of custom shader + * @returns { Component3DAttribute } The attribute of the component3D + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + shader(uri: ResourceStr): Component3DAttribute; + + /** + * Load shader texture uri. + * + * @param { ResourceStr } uri - The path of texture used by shader + * @returns { Component3DAttribute } The attribute of the component3D + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + shaderImageTexture(uri: ResourceStr): Component3DAttribute; + + /** + * Buffer input for shader animation + * + * @param { Array } buffer - The uniform buffer of shader input + * @returns { Component3DAttribute } The attribute of the component3D + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + shaderInputBuffer(buffer: Array): Component3DAttribute; + + /** + * Set render width resolution. + * + * @param { Dimension } value - Width of gpu render target, target would upscale or downscale to view's width. + * @returns { Component3DAttribute } The attribute of the component3D + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + renderWidth(value: Dimension): Component3DAttribute; + + /** + * Set render height resolution. + * + * @param { Dimension } value - Height of gpu render target, target would upscale or downscale to view's height. + * @returns { Component3DAttribute } The attribute of the component3D + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ + renderHeight(value: Dimension): Component3DAttribute; +} + +/** + * Defines Component3D component. + * + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ +declare const Component3D: Component3DInterface; + +/** + * Defines Component3D instance. + * + * @syscap SystemCapability.ArkUi.Graphics3D + * @atomicservice + * @since 12 + */ +declare const Component3DInstance: Component3DAttribute; diff --git a/tests/arkts-sdk/ets/container_span.d.ts b/tests/arkts-sdk/ets/container_span.d.ts new file mode 100644 index 00000000..aa555965 --- /dev/null +++ b/tests/arkts-sdk/ets/container_span.d.ts @@ -0,0 +1,141 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Span container interface. + * + * @interface ContainerSpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Span container interface. + * + * @interface ContainerSpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface ContainerSpanInterface { + /** + * Called when container is entered in span. + * + * @returns { ContainerSpanAttribute } The attribute of the container span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when container is entered in span. + * + * @returns { ContainerSpanAttribute } The attribute of the container span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (): ContainerSpanAttribute; +} + +/** + * Define the ContainerSpan attribute functions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Define the ContainerSpan attribute functions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ContainerSpanAttribute { + /** + * Span background style. + * + * @param { TextBackgroundStyle } style - The background style of span. + * @returns { ContainerSpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Span background style. + * + * @param { TextBackgroundStyle } style - The background style of span. + * @returns { ContainerSpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textBackgroundStyle(style: TextBackgroundStyle): ContainerSpanAttribute; + + /** + * Sets the attribute modifier. + * + * @param { AttributeModifier } modifier - The instance of contain span modifier. + * @returns { ContainerSpanAttribute } the attribute of the ContainerSpanAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + attributeModifier(modifier: AttributeModifier): ContainerSpanAttribute; +} + +/** + * Defines ContainerSpan Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines ContainerSpan Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const ContainerSpan: ContainerSpanInterface; + +/** + * Defines ContainerSpan Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines ContainerSpan Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const ContainerSpanInstance: ContainerSpanAttribute; diff --git a/tests/arkts-subset/ets/tabs.d.ts b/tests/arkts-sdk/ets/content_slot.d.ts similarity index 32% rename from tests/arkts-subset/ets/tabs.d.ts rename to tests/arkts-sdk/ets/content_slot.d.ts index 3703ea40..bd90fd20 100644 --- a/tests/arkts-subset/ets/tabs.d.ts +++ b/tests/arkts-sdk/ets/content_slot.d.ts @@ -13,45 +13,62 @@ * limitations under the License. */ -declare enum BarMode { - Scrollable = 0, - Fixed = 1, -} - -declare class TabsController { - constructor(); - changeIndex(value: number): void; - // preloadItems(indices: Optional>): Promise; - // setTabBarTranslate(translate: TranslateOptions): void; - // setTabBarOpacity(opacity: number): void; -} - -declare enum BarPosition { - Start, - End, -} +/** + * @file + * @kit ArkUI + */ -declare interface TabsOptions { - barPosition?: BarPosition; - index?: number; - controller?: TabsController -} +/** + * Define Content type + * + * @typedef {import('../api/@ohos.arkui.node').Content} Content + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type Content = import('../api/@ohos.arkui.node').Content; -declare interface TabsInterface { - (options?: TabsOptions): TabsAttribute; +/** + * Define ContentSlot attribute, to prevent improper recursive usage of ContentSlot + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ContentSlotAttribute { } -declare class TabsAttribute extends CommonMethod { - - // TBD: Fix for the TestGeneratorVisitor - // barMode(value: BarMode.Fixed): TabsAttribute; - barMode(value: BarMode): TabsAttribute; - barWidth(value: Length): TabsAttribute; - barHeight(value: Length): TabsAttribute; - barPosition(value: BarPosition): TabsAttribute; - animationDuration(value: number): TabsAttribute; - scrollable(value: boolean): TabsAttribute; - +/** + * Placeholder component for NodeContent and ComponentContent + * + * @interface ContentSlotInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface ContentSlotInterface { + /** + * Called when the content is added to the placeholder component + * + * @param { Content } content - Indicates the class object of ComponentContent or NodeContent + * @returns { ContentSlotAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (content: Content): ContentSlotAttribute; } -declare const Tabs: TabsInterface \ No newline at end of file +/** + * Defines the ContentSlot Component + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const ContentSlot: ContentSlotInterface; \ No newline at end of file diff --git a/tests/arkts-subset/ets/embedded_component.d.ts b/tests/arkts-sdk/ets/context_menu.d.ts similarity index 39% rename from tests/arkts-subset/ets/embedded_component.d.ts rename to tests/arkts-sdk/ets/context_menu.d.ts index 7af16134..d72dfb1c 100644 --- a/tests/arkts-subset/ets/embedded_component.d.ts +++ b/tests/arkts-sdk/ets/context_menu.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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 @@ -13,22 +13,53 @@ * limitations under the License. */ -interface EmbeddedComponentInterface { - ( - loader: import('../api/@ohos.app.ability.Want').default, - type: EmbeddedType - ): EmbeddedComponentAttribute; -} - -declare interface TerminationInfo { - code: number; - want?: import('../api/@ohos.app.ability.Want').default; -} +/** + * @file + * @kit ArkUI + */ -declare class EmbeddedComponentAttribute extends CommonMethod { - onTerminated(callback: import('../api/@ohos.base').Callback): EmbeddedComponentAttribute; - onError(callback: import('../api/@ohos.base').ErrorCallback): EmbeddedComponentAttribute; +/** + * Defines Close contextMenu. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Close contextMenu. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Close contextMenu. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class ContextMenu { + /** + * Invoking method close. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Invoking method close. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoking method close. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + static close(); } - -declare const EmbeddedComponent: EmbeddedComponentInterface; -declare const EmbeddedComponentInstance: EmbeddedComponentAttribute; diff --git a/tests/arkts-sdk/ets/counter.d.ts b/tests/arkts-sdk/ets/counter.d.ts new file mode 100644 index 00000000..0331a32e --- /dev/null +++ b/tests/arkts-sdk/ets/counter.d.ts @@ -0,0 +1,335 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Counter component, which provides corresponding increment or decrement counting operations. + * + * @interface CounterInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Counter component, which provides corresponding increment or decrement counting operations. + * + * @interface CounterInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Counter component, which provides corresponding increment or decrement counting operations. + * + * @interface CounterInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Counter component, which provides corresponding increment or decrement counting operations. + * + * @interface CounterInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface CounterInterface { + /** + * Return Counter. + * + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Return Counter. + * + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Return Counter. + * + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Return Counter. + * + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (): CounterAttribute; +} + +/** + * Defines the Counter attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Counter attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Counter attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Counter attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CounterAttribute extends CommonMethod { + /** + * Listen to the event that the value increases. + * + * @param { function } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Listen to the event that the value increases. + * + * @param { function } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Listen to the event that the value increases. + * + * @param { function } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Listen to the event that the value increases. + * + * @param { function } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Listen to the event that the value increases. + * + * @param { VoidCallback } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onInc(event: VoidCallback): CounterAttribute; + + /** + * Listens to the number decrease event. + * + * @param { function } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Listens to the number decrease event. + * + * @param { function } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Listens to the number decrease event. + * + * @param { function } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Listens to the number decrease event. + * + * @param { function } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Listens to the number decrease event. + * + * @param { VoidCallback } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onDec(event: VoidCallback): CounterAttribute; + + /** + * Indicates whether the decrease button of counter component is available or not. + * + * @param { boolean } value - If true, the decrease button is available and can respond to operations such as clicking. If false, click operations are not responded. + * @returns { CounterAttribute } The attribute of the counter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates whether the decrease button of counter component is available or not. + * + * @param { boolean } value - If true, the decrease button is available and can respond to operations such as clicking. If false, click operations are not responded. + * @returns { CounterAttribute } The attribute of the counter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableDec(value: boolean): CounterAttribute; + + /** + * Indicates whether the increase button of counter component is available or not. + * + * @param { boolean } value - If true, the increase button is available and can respond to operations such as clicking. If false, click operations are not responded. + * @returns { CounterAttribute } The attribute of the counter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates whether the increase button of counter component is available or not. + * + * @param { boolean } value - If true, the increase button is available and can respond to operations such as clicking. If false, click operations are not responded. + * @returns { CounterAttribute } The attribute of the counter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableInc(value: boolean): CounterAttribute; +} + +/** + * Defines Counter Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Counter Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Counter Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Counter Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const CounterInstance: CounterAttribute; + +/** + * Defines Counter Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Counter Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Counter Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Counter Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Counter: CounterInterface; diff --git a/tests/arkts-sdk/ets/custom_dialog_controller.d.ts b/tests/arkts-sdk/ets/custom_dialog_controller.d.ts new file mode 100644 index 00000000..d8419f8e --- /dev/null +++ b/tests/arkts-sdk/ets/custom_dialog_controller.d.ts @@ -0,0 +1,633 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the options of CustomDialogController. + * + * @interface CustomDialogControllerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of CustomDialogController. + * + * @interface CustomDialogControllerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of CustomDialogController. + * + * @interface CustomDialogControllerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface CustomDialogControllerOptions { + /** + * Custom builder function. + * + * @type { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Custom builder function. + * + * @type { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Custom builder function. + * + * @type { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + builder: any; + + /** + * Defines the cancel function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the cancel function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the cancel function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + cancel?: () => void; + + /** + * Defines if use auto cancel when click on the outside of the dialog. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines if use auto cancel when click on the outside of the dialog. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines if use auto cancel when click on the outside of the dialog. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + autoCancel?: boolean; + + /** + * Defines the dialog alignment of the screen. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the dialog alignment of the screen. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the dialog alignment of the screen. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + alignment?: DialogAlignment; + + /** + * Defines the dialog offset. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the dialog offset. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the dialog offset. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Offset; + + /** + * Defines if use custom style. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines if use custom style. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines if use custom style. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + customStyle?: boolean; + + /** + * Grid count of dialog. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Grid count of dialog. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Grid count of dialog. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + gridCount?: number; + + /** + * Mask color of dialog. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mask color of dialog. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maskColor?: ResourceColor; + + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maskRect?: Rectangle; + + /** + * Animation parameters of dialog opening. + * + * @type { ?AnimateParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation parameters of dialog opening. + * + * @type { ?AnimateParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + openAnimation?: AnimateParam; + + /** + * Animation parameters of dialog closing. + * + * @type { ?AnimateParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation parameters of dialog closing. + * + * @type { ?AnimateParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + closeAnimation?: AnimateParam; + + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showInSubWindow?: boolean; + + /** + * Background color of dialog. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Background color of dialog. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundColor?: ResourceColor; + + /** + * Corner radius of dialog. + * + * @type { ?(Dimension | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Corner radius of dialog. + * + * @type { ?(Dimension | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + cornerRadius?: Dimension | BorderRadiuses; + + /** + * Whether it is a modal dialog + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether it is a modal dialog + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isModal?: boolean; + + /** + * Callback function when the CustomDialog interactive dismiss. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: Callback; + + /** + * Defines the custom dialog's width. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width?: Dimension; + + /** + * Defines the custom dialog's height. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + height?: Dimension; + + /** + * Defines the custom dialog's border width. + * + * @type { ?(Dimension | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderWidth?: Dimension | EdgeWidths; + + /** + * Defines the custom dialog's border color. + * + * @type { ?(ResourceColor | EdgeColors) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderColor?: ResourceColor | EdgeColors; + + /** + * Defines the custom dialog's border style. + * + * @type { ?(BorderStyle | EdgeStyles) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderStyle?: BorderStyle | EdgeStyles; + + /** + * Defines the custom dialog's shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Defines the customDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Defines the customDialog's keyboard avoid mode + * + * @type { ?KeyboardAvoidMode } + * @default KeyboardAvoidMode.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + keyboardAvoidMode?: KeyboardAvoidMode; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the customDialog's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; +} + +/** + * Component dialog dismiss action. + * + * @interface DismissDialogAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DismissDialogAction { + /** + * Defines dialog dismiss function + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: Callback; + + /** + * Dismiss reason type. + * + * @type { DismissReason } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reason: DismissReason; +} + +/** + * Use the CustomDialogController class to display the custom pop-up window. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Use the CustomDialogController class to display the custom pop-up window. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Use the CustomDialogController class to display the custom pop-up window. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class CustomDialogController { + /** + * The constructor transfers parameter settings. + * + * @param { CustomDialogControllerOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The constructor transfers parameter settings. + * + * @param { CustomDialogControllerOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The constructor transfers parameter settings. + * + * @param { CustomDialogControllerOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(value: CustomDialogControllerOptions); + + /** + * Display the content of the customized pop-up window. If the content has been displayed, it does not take effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Display the content of the customized pop-up window. If the content has been displayed, it does not take effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Display the content of the customized pop-up window. If the content has been displayed, it does not take effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + open(); + + /** + * Closes the custom pop-up window. If the window is closed, the window does not take effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Closes the custom pop-up window. If the window is closed, the window does not take effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Closes the custom pop-up window. If the window is closed, the window does not take effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + close(); +} diff --git a/tests/arkts-sdk/ets/data_panel.d.ts b/tests/arkts-sdk/ets/data_panel.d.ts new file mode 100644 index 00000000..163bd280 --- /dev/null +++ b/tests/arkts-sdk/ets/data_panel.d.ts @@ -0,0 +1,734 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * DataPanelType enum + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * DataPanelType enum + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * DataPanelType enum + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * DataPanelType enum + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum DataPanelType { + /** + * Line Type + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Line Type + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Line Type + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Line Type + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Line, + + /** + * Line Rainbow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Line Rainbow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Line Rainbow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Line Rainbow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Circle, +} + +/** + * ColorStop type + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * ColorStop type + * @typedef { object } ColorStop + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ColorStop { + /** + * Color property. + * @type { ResourceColor } color - the color value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Color property. + * @type { ResourceColor } color - the color value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color: ResourceColor; + + /** + * Offset property. + * @type { Length } offset - the color offset. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Offset property. + * @type { Length } offset - the color offset. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset: Length; +} + +/** + * LinearGradient class + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * LinearGradient class + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class LinearGradient { + /** + * Constructor. + * + * @param { ColorStop[] } colorStops - the LinearGradient constructor parameter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Constructor. + * + * @param { ColorStop[] } colorStops - the LinearGradient constructor parameter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(colorStops: ColorStop[]); +} + +/** + * Defines the options of Shadow. + * + * @interface DataPanelShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of Shadow. + * + * @interface DataPanelShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface DataPanelShadowOptions extends MultiShadowOptions { + /** + * Current shadow colors. + * + * @type { ?Array } + * @default Consistent with valueColors + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Current shadow colors. + * + * @type { ?Array } + * @default Consistent with valueColors + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + colors?: Array; +} + +/** + * Defines the options of DataPanel. + * + * @interface DataPanelOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of DataPanel. + * + * @interface DataPanelOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of DataPanel. + * + * @interface DataPanelOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of DataPanel. + * + * @interface DataPanelOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface DataPanelOptions { + /** + * Current data value. the max length is 9. + * + * @type { number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Current data value. the max length is 9. + * + * @type { number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Current data value. the max length is 9. + * + * @type { number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Current data value. the max length is 9. + * + * @type { number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + values: number[]; + + /** + * Maximum value of the current data. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Maximum value of the current data. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Maximum value of the current data. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Maximum value of the current data. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + max?: number; + + /** + * DataPanel Type + * + * @type { ?DataPanelType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * DataPanel Type + * + * @type { ?DataPanelType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * DataPanel Type + * + * @type { ?DataPanelType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * DataPanel Type + * + * @type { ?DataPanelType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + type?: DataPanelType; +} + +/** + * Defines the DataPanel component. + * + * @interface DataPanelInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the DataPanel component. + * + * @interface DataPanelInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the DataPanel component. + * + * @interface DataPanelInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the DataPanel component. + * + * @interface DataPanelInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface DataPanelInterface { + /** + * Return a DataPanel. + * + * @param { DataPanelOptions } options + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Return a DataPanel. + * + * @param { DataPanelOptions } options + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Return a DataPanel. + * + * @param { DataPanelOptions } options + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Return a DataPanel. + * + * @param { DataPanelOptions } options + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (options: DataPanelOptions): DataPanelAttribute; +} + +/** + * DataPanelConfiguration used by dataPanel content modifier + * + * @interface DataPanelConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DataPanelConfiguration extends CommonConfiguration { + /** + * Current data value. the max length is 9. + * + * @type { number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + values: number[]; + + /** + * Maximum value of the current data. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maxValue: number; +} + +/** + * Defines the DataPanel attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the DataPanel attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the DataPanel attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the DataPanel attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class DataPanelAttribute extends CommonMethod { + /** + * Disable the special effect of the data ratio chart. + * + * @param { boolean } value + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Disable the special effect of the data ratio chart. + * + * @param { boolean } value + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Disable the special effect of the data ratio chart. + * + * @param { boolean } value + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Disable the special effect of the data ratio chart. + * + * @param { boolean } value + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + closeEffect(value: boolean): DataPanelAttribute; + + /** + * Set the value colors of the data ratio chart. + * + * @param { Array } value - the value colors of the data ratio chart. + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value colors of the data ratio chart. + * + * @param { Array } value - the value colors of the data ratio chart. + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + valueColors(value: Array): DataPanelAttribute; + + /** + * Set track background color of the data ratio chart. + * + * @param { ResourceColor } value - track background color of the data ratio chart. + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set track background color of the data ratio chart. + * + * @param { ResourceColor } value - track background color of the data ratio chart. + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + trackBackgroundColor(value: ResourceColor): DataPanelAttribute; + + /** + * Set the stroke width of the data ratio chart. + * + * @param { Length } value - the stroke width of the data ratio chart. + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the stroke width of the data ratio chart. + * + * @param { Length } value - the stroke width of the data ratio chart. + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeWidth(value: Length): DataPanelAttribute; + + /** + * Set the shadow width of the data ratio chart. + * + * @param { DataPanelShadowOptions } value - the track shadow width of the data ratio chart. + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the shadow width of the data ratio chart. + * + * @param { DataPanelShadowOptions } value - the track shadow width of the data ratio chart. + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + trackShadow(value: DataPanelShadowOptions): DataPanelAttribute; + + /** + * Set the content modifier of data panel. + * + * @param { ContentModifier } modifier - The content modifier of data panel. + * @returns { DataPanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): DataPanelAttribute; +} + +/** + * Defines DataPanel Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines DataPanel Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines DataPanel Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines DataPanel Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const DataPanel: DataPanelInterface + +/** + * Defines DataPanel Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines DataPanel Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines DataPanel Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines DataPanel Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const DataPanelInstance: DataPanelAttribute; diff --git a/tests/arkts-sdk/ets/date_picker.d.ts b/tests/arkts-sdk/ets/date_picker.d.ts new file mode 100644 index 00000000..18402b30 --- /dev/null +++ b/tests/arkts-sdk/ets/date_picker.d.ts @@ -0,0 +1,1121 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the struct of DatePickerResult. + * + * @interface DatePickerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the struct of DatePickerResult. + * + * @interface DatePickerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the struct of DatePickerResult. + * + * @interface DatePickerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface DatePickerResult { + /** + * Application year + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Application year + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Application year + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + year?: number; + + /** + * Application month + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Application month + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Application month + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + month?: number; + + /** + * Application day + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Application day + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Application day + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + day?: number; +} + +/** + * Defines the options of DatePicker. + * + * @interface DatePickerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the options of DatePicker. + * + * @interface DatePickerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of DatePicker. + * + * @interface DatePickerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface DatePickerOptions { + /** + * Specifies the start date of the date selector. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Specifies the start date of the date selector. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specifies the start date of the date selector. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + start?: Date; + + /** + * Specifies the end date for the date selector. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Specifies the end date for the date selector. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specifies the end date for the date selector. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + end?: Date; + + /** + * Specifies the date selector check date or time selector check time. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Specifies the date selector check date or time selector check time. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specifies the date selector check date or time selector check time. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selected?: Date; +} + +/** + * Defines the DatePicker Component. + * + * @interface DatePickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the DatePicker Component. + * + * @interface DatePickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the DatePicker Component. + * + * @interface DatePickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface DatePickerInterface { + /** + * Defines the DatePicker constructor. + * + * @param { DatePickerOptions } options + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the DatePicker constructor. + * + * @param { DatePickerOptions } options + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the DatePicker constructor. + * + * @param { DatePickerOptions } options + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (options?: DatePickerOptions): DatePickerAttribute; +} + +/** + * Defines the DatePicker attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the DatePicker attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the DatePicker attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class DatePickerAttribute extends CommonMethod { + /** + * Date selector: true: displays the lunar calendar. false: The lunar calendar is not displayed. + * + * @param { boolean } value + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Date selector: true: displays the lunar calendar. false: The lunar calendar is not displayed. + * + * @param { boolean } value + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Date selector: true: displays the lunar calendar. false: The lunar calendar is not displayed. + * + * @param { boolean } value + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + lunar(value: boolean): DatePickerAttribute; + + /** + * Sets the text style of disappearing items + * + * @param { PickerTextStyle } value - indicates the text style of disappearing items. + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of disappearing items + * + * @param { PickerTextStyle } value - indicates the text style of disappearing items. + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + disappearTextStyle(value: PickerTextStyle): DatePickerAttribute; + + /** + * Sets the text style of normal items + * + * @param { PickerTextStyle } value - indicates the text style of normal items. + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of normal items + * + * @param { PickerTextStyle } value - indicates the text style of normal items. + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle(value: PickerTextStyle): DatePickerAttribute; + + /** + * Sets the text style of selected items + * + * @param { PickerTextStyle } value - indicates the text style of selected items. + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of selected items + * + * @param { PickerTextStyle } value - indicates the text style of selected items. + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedTextStyle(value: PickerTextStyle): DatePickerAttribute; + + /** + * This event is triggered when a DatePicker date or time is selected. + * + * @param { function } callback + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + * @useinstead datePicker/DatePickerAttribute#onDateChange + */ + onChange(callback: (value: DatePickerResult) => void): DatePickerAttribute; + + /** + * This event is triggered when a DatePicker date or time is selected. + * + * @param { function } callback + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This event is triggered when a DatePicker date or time is selected. + * + * @param { function } callback + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * This event is triggered when a DatePicker date or time is selected. + * + * @param { Callback } callback + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDateChange(callback: Callback): DatePickerAttribute; +} + +/** + * Provide an interface for the lunar switch style of DatePickerDialog + * + * @interface LunarSwitchStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface LunarSwitchStyle { + /** + * Define the selected color of lunar switch. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + selectedColor?: ResourceColor; + + /** + * Define the unselected color of lunar switch. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + unselectedColor?: ResourceColor; + + /** + * Define the stroke color of lunar switch. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + strokeColor?: ResourceColor; +} + +/** + * Defines the DatePickerDialogOptions for Data Picker Dialog. + * + * @interface DatePickerDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the DatePickerDialogOptions for Data Picker Dialog. + * + * @interface DatePickerDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the DatePickerDialogOptions for Data Picker Dialog. + * + * @interface DatePickerDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface DatePickerDialogOptions extends DatePickerOptions { + /** + * Date selector: true: displays the lunar calendar. false: The lunar calendar is not displayed. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Date selector: true: displays the lunar calendar. false: The lunar calendar is not displayed. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Date selector: true: displays the lunar calendar. false: The lunar calendar is not displayed. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + lunar?: boolean; + + /** + * Whether to show the switch to display the lunar. + * + * @type { ?boolean } value - indicates whether to show the switch to display the lunar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Whether to show the switch to display the lunar. + * + * @type { ?boolean } value - indicates whether to show the switch to display the lunar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + lunarSwitch?: boolean; + + /** + * Describes the lunar switch color. + * + * @type { ?LunarSwitchStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + lunarSwitchStyle?: LunarSwitchStyle; + + /** + * Indicates whether to show the time selector. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates whether to show the time selector. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showTime?: boolean; + + /** + * Indicates whether to display the 24-hour clock. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates whether to display the 24-hour clock. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + useMilitaryTime?: boolean; + + /** + * Text style of disappearing items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text style of disappearing items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + disappearTextStyle?: PickerTextStyle; + + /** + * Text style of normal items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text style of normal items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle?: PickerTextStyle; + + /** + * Style of accept button. + * + * @type { ?PickerDialogButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + acceptButtonStyle?: PickerDialogButtonStyle; + + /** + * Style of cancel button. + * + * @type { ?PickerDialogButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cancelButtonStyle?: PickerDialogButtonStyle; + + /** + * Text style of selected items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text style of selected items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedTextStyle?: PickerTextStyle; + + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maskRect?: Rectangle; + + /** + * Defines the dialog alignment of the screen. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the dialog alignment of the screen. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + alignment?: DialogAlignment; + + /** + * Defines the dialog offset. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the dialog offset. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Offset; + + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + * @useinstead datePicker/DatePickerDialogOptions#onDateAccept + */ + onAccept?: (value: DatePickerResult) => void; + + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onCancel?: VoidCallback; + + /** + * This event is triggered when a DatePicker date or time is selected in dialog. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + * @useinstead datePicker/DatePickerDialogOptions#onDateChange + */ + onChange?: (value: DatePickerResult) => void; + + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDateAccept?: Callback; + + /** + * This event is triggered when a DatePicker date or time is selected in dialog. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This event is triggered when a DatePicker date or time is selected in dialog. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * This event is triggered when a DatePicker date or time is selected in dialog. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDateChange?: Callback; + + /** + * Defines the datePickerDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the datePickerDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Defines the datePickerDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the datePickerDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Callback function when the dialog appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Callback function when the dialog appears. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDidAppear?: VoidCallback; + + /** + * Callback function when the dialog disappears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Callback function when the dialog disappears. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDidDisappear?: VoidCallback; + + /** + * Callback function before the dialog openAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Callback function before the dialog openAnimation starts. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onWillAppear?: VoidCallback; + + /** + * Callback function before the dialog closeAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Callback function before the dialog closeAnimation starts. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onWillDisappear?: VoidCallback; + + /** + * Defines the dialog's shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Set time format + * + * @type { ?DateTimeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dateTimeOptions?: DateTimeOptions; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the dialog's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; +} + +/** + * Defines DatePickerDialog which uses show method to show DatePicker dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines DatePickerDialog which uses show method to show DatePicker dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines DatePickerDialog which uses show method to show DatePicker dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class DatePickerDialog { + /** + * Invoking method display. + * + * @param { DatePickerDialogOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Invoking method display. + * + * @param { DatePickerDialogOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoking method display. + * + * @param { DatePickerDialogOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + static show(options?: DatePickerDialogOptions); +} + +/** + * Defines DatePicker Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines DatePicker Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines DatePicker Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const DatePicker: DatePickerInterface; + +/** + * Defines DatePicker Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines DatePicker Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines DatePicker Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const DatePickerInstance: DatePickerAttribute; + + diff --git a/tests/arkts-sdk/ets/divider.d.ts b/tests/arkts-sdk/ets/divider.d.ts new file mode 100644 index 00000000..2ee8f097 --- /dev/null +++ b/tests/arkts-sdk/ets/divider.d.ts @@ -0,0 +1,355 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides a divider component to separate different content blocks/content elements. + * + * @interface DividerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides a divider component to separate different content blocks/content elements. + * + * @interface DividerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides a divider component to separate different content blocks/content elements. + * + * @interface DividerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides a divider component to separate different content blocks/content elements. + * + * @interface DividerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface DividerInterface { + /** + * Return Divider. + * + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Return Divider. + * + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Return Divider. + * + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Return Divider. + * + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (): DividerAttribute; +} + +/** + * Defines the Divider attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Divider attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Divider attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Divider attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class DividerAttribute extends CommonMethod { + /** + * Indicates whether to use a horizontal splitter or a vertical splitter. + * The options are as follows: false: horizontal splitter; true: vertical splitter. + * + * @param { boolean } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether to use a horizontal splitter or a vertical splitter. + * The options are as follows: false: horizontal splitter; true: vertical splitter. + * + * @param { boolean } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates whether to use a horizontal splitter or a vertical splitter. + * The options are as follows: false: horizontal splitter; true: vertical splitter. + * + * @param { boolean } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates whether to use a horizontal splitter or a vertical splitter. + * The options are as follows: false: horizontal splitter; true: vertical splitter. + * + * @param { boolean } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + vertical(value: boolean): DividerAttribute; + + /** + * Sets the color of the divider line. + * + * @param { ResourceColor } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the color of the divider line. + * + * @param { ResourceColor } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the color of the divider line. + * + * @param { ResourceColor } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the color of the divider line. + * + * @param { ResourceColor } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color(value: ResourceColor): DividerAttribute; + + /** + * Sets the width of the dividing line. + * + * @param { number | string } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the width of the dividing line. + * + * @param { number | string } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the width of the dividing line. + * + * @param { number | string } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the width of the dividing line. + * + * @param { number | string } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeWidth(value: number | string): DividerAttribute; + + /** + * Sets the end style of the split line. The default value is Butt. + * + * @param { LineCapStyle } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the end style of the split line. The default value is Butt. + * + * @param { LineCapStyle } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the end style of the split line. The default value is Butt. + * + * @param { LineCapStyle } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the end style of the split line. The default value is Butt. + * + * @param { LineCapStyle } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lineCap(value: LineCapStyle): DividerAttribute; +} + +/** + * Defines Divider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Divider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Divider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Divider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Divider: DividerInterface; + +/** + * Defines Divider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Divider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Divider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Divider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const DividerInstance: DividerAttribute; diff --git a/tests/arkts-subset/ets/flex.d.ts b/tests/arkts-sdk/ets/effect_component.d.ts similarity index 31% rename from tests/arkts-subset/ets/flex.d.ts rename to tests/arkts-sdk/ets/effect_component.d.ts index 66818f8d..daf057f9 100644 --- a/tests/arkts-subset/ets/flex.d.ts +++ b/tests/arkts-sdk/ets/effect_component.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 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 @@ -13,28 +13,56 @@ * limitations under the License. */ -declare interface FlexOptions { - direction?: FlexDirection; - wrap?: FlexWrap; - justifyContent?: FlexAlign; - alignItems?: ItemAlign; - alignContent?: FlexAlign; - space?: FlexSpaceOptions; -} - -declare interface FlexSpaceOptions { - main?: LengthMetrics; - cross?: LengthMetrics; -} +/** + * @file + * @kit ArkUI + */ -interface FlexInterface { - (value?: FlexOptions): FlexAttribute; +/** + * Provides an Effect Component, which is invisible, but setting properties on this component defines an effect template + * that child components can apply by setting useEffect(true). + * + * @interface EffectComponentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +interface EffectComponentInterface { + /** + * Return effectComponent. + * + * @returns { EffectComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + (): EffectComponentAttribute; } -declare class FlexAttribute extends CommonMethod { - pointLight(value: PointLightStyle): FlexAttribute; -} +/** + * Defines the Effect Component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare class EffectComponentAttribute extends CommonMethod {} -declare const Flex: FlexInterface; +/** + * Defines Effect Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare const EffectComponent: EffectComponentInterface; -declare const FlexInstance: FlexAttribute; +/** + * Defines Effect Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare const EffectComponentInstance: EffectComponentAttribute; diff --git a/tests/arkts-sdk/ets/ellipse.d.ts b/tests/arkts-sdk/ets/ellipse.d.ts new file mode 100644 index 00000000..e85a455c --- /dev/null +++ b/tests/arkts-sdk/ets/ellipse.d.ts @@ -0,0 +1,333 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Ellipse constructor options. + * + * @interface EllipseOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +interface EllipseOptions { + /** + * Set width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: string | number; + + /** + * Set height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: string | number; +} + +/** + * Ellipse drawing. + * + * @interface EllipseInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Ellipse drawing. + * + * @interface EllipseInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Ellipse drawing. + * + * @interface EllipseInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Ellipse drawing. + * + * @interface EllipseInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface EllipseInterface { + /** + * use new function to set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * use new function to set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * use new function to set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * use new function to set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * use new function to set the value. + * + * @param { EllipseOptions } [options] - ellipse options + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + new (options?: EllipseOptions): EllipseAttribute; + + /** + * Set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Set the value. + * + * @param { EllipseOptions } [options] - ellipse options + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options?: EllipseOptions): EllipseAttribute; +} + +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class EllipseAttribute extends CommonShapeMethod {} + +/** + * Defines Ellipse Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Ellipse Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Ellipse Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Ellipse Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Ellipse: EllipseInterface; + +/** + * Defines Ellipse Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Ellipse Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Ellipse Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Ellipse Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const EllipseInstance: EllipseAttribute; diff --git a/tests/arkts-sdk/ets/embedded_component.d.ts b/tests/arkts-sdk/ets/embedded_component.d.ts new file mode 100644 index 00000000..48a15bb0 --- /dev/null +++ b/tests/arkts-sdk/ets/embedded_component.d.ts @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + + +/** + * Provide an interface for the EmbeddedComponent, which is used + *
to render UI asynchronously + * + * @interface EmbeddedComponentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +interface EmbeddedComponentInterface { + /** + * Construct the EmbeddedComponent.
+ * Called when the EmbeddedComponent is used. + * + * @param { import('../api/@ohos.app.ability.Want').default } loader - indicates initialization parameter + * @param { EmbeddedType } type - indicates type of the EmbeddedComponent + * @returns { EmbeddedComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ( + loader: import('../api/@ohos.app.ability.Want').default, + type: EmbeddedType + ): EmbeddedComponentAttribute; +} + +/** + * Indicates the information when the provider of the embedded UI is terminated. + * + * @interface TerminationInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface TerminationInfo { + /** + * Defines the termination code. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + code: number; + + /** + * Defines the additional termination information. + * + * @type { ?import('../api/@ohos.app.ability.Want').default } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + want?: import('../api/@ohos.app.ability.Want').default; +} + +/** + * Define the attribute functions of EmbeddedComponent. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare class EmbeddedComponentAttribute extends CommonMethod { + /** + * Called when the provider of the embedded UI is terminated. + * + * @param { import('../api/@ohos.base').Callback } callback + * @returns { EmbeddedComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + onTerminated(callback: import('../api/@ohos.base').Callback): EmbeddedComponentAttribute; + + /** + * Called when some error occurred. + * + * @param { import('../api/@ohos.base').ErrorCallback } callback + * @returns { EmbeddedComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + onError(callback: import('../api/@ohos.base').ErrorCallback): EmbeddedComponentAttribute; +} + +/** + * Defines EmbeddedComponent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare const EmbeddedComponent: EmbeddedComponentInterface; + +/** + * Defines EmbeddedComponent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare const EmbeddedComponentInstance: EmbeddedComponentAttribute; diff --git a/tests/arkts-sdk/ets/enums.d.ts b/tests/arkts-sdk/ets/enums.d.ts new file mode 100644 index 00000000..db46717e --- /dev/null +++ b/tests/arkts-sdk/ets/enums.d.ts @@ -0,0 +1,9822 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * common enum of the checkbox shape + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * common enum of the checkbox shape + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum CheckBoxShape { + /** + * Circle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Circle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + CIRCLE = 0, + + /** + * Rounded Square. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Rounded Square. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + ROUNDED_SQUARE = 1, +} + +/** + * common enum of color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * common enum of color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * common enum of color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * common enum of color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Color { + /** + * White. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * White. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * White. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * White. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + White, + + /** + * Black. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Black. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Black. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Black. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Black, + + /** + * Blue. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Blue. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Blue. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Blue. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Blue, + + /** + * Brown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Brown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Brown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Brown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Brown, + + /** + * Gray. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Gray. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Gray. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Gray. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Gray, + + /** + * Green. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Green. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Green. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Green. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Green, + + /** + * Grey. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Grey. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grey. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grey. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Grey, + + /** + * Orange. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Orange. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Orange. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Orange. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Orange, + + /** + * color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Pink, + + /** + * Red. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Red. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Red. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Red. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Red, + + /** + * Yellow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Yellow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Yellow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Yellow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Yellow, + + /** + * Transparent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Transparent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Transparent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Transparent, +} + +/** + * Common enum of color strategy + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Common enum of color strategy + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ColoringStrategy { + /** + * Use the inverse color strategy. Gets the inverse of the background color. Only applies to foregroundColor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use the inverse color strategy. Gets the inverse of the background color. Only applies to foregroundColor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + INVERT = 'invert', + + /** + * Use the average color strategy. Get the average color of the background. Only applies to shadow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Use the average color strategy. Get the average color of the background. Only applies to shadow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + AVERAGE = 'average', + + /** + * Use the primary color strategy. Get the color that dominate the background color. Only applies to shadow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Use the primary color strategy. Get the color that dominate the background color. Only applies to shadow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PRIMARY = 'primary', +} + +/** + * Image display mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Image display mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Image display mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Image display mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ImageFit { + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Contain, + + /** + * Keep the aspect ratio to zoom out or zoom in so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Cover, + + /** + * Adaptive display + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adaptive display + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adaptive display + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adaptive display + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Auto, + + /** + * Zoom in or out without maintaining the aspect ratio so that the image fills the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Zoom in or out without maintaining the aspect ratio so that the image fills the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Zoom in or out without maintaining the aspect ratio so that the image fills the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Zoom in or out without maintaining the aspect ratio so that the image fills the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Fill, + + /** + * Keep the aspect ratio displayed, and the image zooms out or remains unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the aspect ratio displayed, and the image zooms out or remains unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the aspect ratio displayed, and the image zooms out or remains unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the aspect ratio displayed, and the image zooms out or remains unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + ScaleDown, + + /** + * Keep the original size and display it in the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the original size and display it in the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the original size and display it in the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the original size and display it in the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * Top Start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + TOP_START = 7, + + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + TOP = 8, + + /** + * Top tail end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + TOP_END = 9, + + /** + * The starting end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + START = 10, + + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + CENTER = 11, + + /** + * The tail end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + END = 12, + + /** + * Bottom starting end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + BOTTOM_START = 13, + + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + BOTTOM = 14, + + /** + * Bottom end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + BOTTOM_END = 15, +} + +/** + * Border Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Border Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Border Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Border Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum BorderStyle { + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Dotted, + + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Dashed, + + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Solid, +} + +/** + * Line Join Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Line Join Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Line Join Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Line Join Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum LineJoinStyle { + /** + * Connect path segments using bevels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Connect path segments using bevels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Connect path segments using bevels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Connect path segments using bevels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Miter, + + /** + * Connect path segments using sharp corners. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Connect path segments using sharp corners. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Connect path segments using sharp corners. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Connect path segments using sharp corners. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Round, + + /** + * Connect path segments using fillets. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Connect path segments using fillets. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Connect path segments using fillets. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Connect path segments using fillets. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bevel, +} + +/** + * Function Called by Touch + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Function Called by Touch + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Function Called by Touch + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum TouchType { + /** + * Triggered when the finger is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Triggered when the finger is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the finger is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Down, + + /** + * Triggered when the finger is raised. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Triggered when the finger is raised. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the finger is raised. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Up, + + /** + * Triggered when the finger presses on the screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Triggered when the finger presses on the screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the finger presses on the screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Move, + + /** + * Triggers when the touch event cancels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Triggers when the touch event cancels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggers when the touch event cancels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Cancel, +} + +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum MouseButton { + /** + * Mouse Left Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse Left Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse Left Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Left, + + /** + * Mouse Right Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse Right Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse Right Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Right, + + /** + * Mouse Middle Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse Middle Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse Middle Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Middle, + + /** + * Mouse Back Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse Back Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse Back Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Back, + + /** + * Mouse Forward Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse Forward Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse Forward Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Forward, + + /** + * Mouse None Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse None Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse None Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, +} + +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum MouseAction { + /** + * Triggered when the mouse is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Triggered when the mouse is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the mouse is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Press, + + /** + * Triggered when the mouse is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Triggered when the mouse is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the mouse is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Release, + + /** + * Triggered when the mouse is Moved. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Triggered when the mouse is Moved. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the mouse is Moved. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Move, + + /** + * Triggered when the mouse is Hovered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Triggered when the mouse is Hovered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the mouse is Hovered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Hover +} + +/** + * Animation status. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Animation status. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Animation status. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum AnimationStatus { + /** + * Initial state of the animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Initial state of the animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Initial state of the animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Initial, + + /** + * The animation is playing. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation is playing. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation is playing. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Running, + + /** + * The animation is paused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation is paused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation is paused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Paused, + + /** + * The animation is stopped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation is stopped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation is stopped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Stopped, +} + +/** + * Sets the animation playback mode. By default, the animation starts to play again after the playback is complete. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Sets the animation playback mode. By default, the animation starts to play again after the playback is complete. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Sets the animation playback mode. By default, the animation starts to play again after the playback is complete. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Sets the animation playback mode. By default, the animation starts to play again after the playback is complete. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Curve { + /** + * Indicates that the speed of the animation is the same from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates that the speed of the animation is the same from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates that the speed of the animation is the same from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates that the speed of the animation is the same from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Linear, + + /** + * Indicates that the animation starts at a low speed, then accelerates, and then slows down before it ends, CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates that the animation starts at a low speed, then accelerates, and then slows down before it ends, CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates that the animation starts at a low speed, then accelerates, and then slows down before it ends, CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates that the animation starts at a low speed, then accelerates, and then slows down before it ends, CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Ease, + + /** + * Indicates that the animation starts at a low speed, CubicBezier(0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates that the animation starts at a low speed, CubicBezier(0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates that the animation starts at a low speed, CubicBezier(0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates that the animation starts at a low speed, CubicBezier(0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + EaseIn, + + /** + * Indicates that the animation ends at a low speed, CubicBezier(0.0, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates that the animation ends at a low speed, CubicBezier(0.0, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates that the animation ends at a low speed, CubicBezier(0.0, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates that the animation ends at a low speed, CubicBezier(0.0, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + EaseOut, + + /** + * Indicates that the animation starts and ends at a slow speed, CubicBezier(0.42, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates that the animation starts and ends at a slow speed, CubicBezier(0.42, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates that the animation starts and ends at a slow speed, CubicBezier(0.42, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates that the animation starts and ends at a slow speed, CubicBezier(0.42, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + EaseInOut, + + /** + * Slow-in, fast-out + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Slow-in, fast-out + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Slow-in, fast-out + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Slow-in, fast-out + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + FastOutSlowIn, + + /** + * Linear Out Slow In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Linear Out Slow In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Linear Out Slow In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Linear Out Slow In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LinearOutSlowIn, + + /** + * Fast Out Linear In. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Fast Out Linear In. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Fast Out Linear In. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Fast Out Linear In. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + FastOutLinearIn, + + /** + * Extreme Deceleration. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Extreme Deceleration. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Extreme Deceleration. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Extreme Deceleration. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + ExtremeDeceleration, + + /** + * Sharp. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sharp. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sharp. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sharp. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Sharp, + + /** + * Rhythm. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rhythm. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rhythm. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rhythm. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Rhythm, + + /** + * Smooth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Smooth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Smooth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Smooth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Smooth, + + /** + * Damping curve, CubicBezier(0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Damping curve, CubicBezier(0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Damping curve, CubicBezier(0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Damping curve, CubicBezier(0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Friction, +} + +/** + * Sets the state before and after the animation starts. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Sets the state before and after the animation starts. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Sets the state before and after the animation starts. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FillMode { + /** + * Restores to the initial state after the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Restores to the initial state after the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Restores to the initial state after the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * Retains the state at the end of the animation when the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Retains the state at the end of the animation when the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Retains the state at the end of the animation when the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Forwards, + + /** + * Applies the start attribute value for the period specified by animation-delay before the animation is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Applies the start attribute value for the period specified by animation-delay before the animation is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Applies the start attribute value for the period specified by animation-delay before the animation is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Backwards, + + /** + * Both forward and backward fill modes are applied. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Both forward and backward fill modes are applied. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Both forward and backward fill modes are applied. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Both, +} + +/** + * Play Mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Play Mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Play Mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Play Mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum PlayMode { + /** + * The animation plays normally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation plays normally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The animation plays normally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation plays normally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Normal, + + /** + * The animation plays backwards. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation plays backwards. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The animation plays backwards. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation plays backwards. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Reverse, + + /** + * The animation plays forward on odd numbers (1, 3, 7...) and backward on even numbers (2, 4, 6...). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation plays forward on odd numbers (1, 3, 7...) and backward on even numbers (2, 4, 6...). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The animation plays forward on odd numbers (1, 3, 7...) and backward on even numbers (2, 4, 6...). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation plays forward on odd numbers (1, 3, 7...) and backward on even numbers (2, 4, 6...). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Alternate, + + /** + * The animation plays backwards on odd numbers (1, 3, 7...) and forwards on even numbers (2, 4, 6...).. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation plays backwards on odd numbers (1, 3, 7...) and forwards on even numbers (2, 4, 6...).. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The animation plays backwards on odd numbers (1, 3, 7...) and forwards on even numbers (2, 4, 6...).. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation plays backwards on odd numbers (1, 3, 7...) and forwards on even numbers (2, 4, 6...).. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + AlternateReverse, +} + +/** + * Type of a key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Type of a key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Type of a key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum KeyType { + /** + * Press the key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Press the key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Press the key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Down, + + /** + * The key is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The key is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The key is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Up, +} + +/** + * Type of the input device that triggers the current key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Type of the input device that triggers the current key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Type of the input device that triggers the current key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum KeySource { + /** + * The input device type is unknown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The input device type is unknown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The input device type is unknown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Unknown, + + /** + * Set Device Type to Keyboard. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set Device Type to Keyboard. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set Device Type to Keyboard. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Keyboard, +} + +/** + * Edge. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Edge. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Edge. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum Edge { + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Top, + + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Center, + + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * Cross axis direction text baseline alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Baseline, + + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Start, + + /** + * Middle + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Middle, + + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + End, +} + +/** + * Set Weekend + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Set Weekend + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Set Weekend + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum Week { + /** + * Monday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Monday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Monday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Mon, + + /** + * Tuesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Tuesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Tuesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Tue, + + /** + * Wednesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Wednesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Wednesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Wed, + + /** + * Thursday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Thursday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Thursday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Thur, + + /** + * Friday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Friday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Friday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Fri, + + /** + * Saturday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Saturday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Saturday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Sat, + + /** + * Sunday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sunday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sunday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Sun, +} + +/** + * Sets the horizontal layout of elements. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Sets the horizontal layout of elements. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Sets the horizontal layout of elements. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Sets the horizontal layout of elements. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Direction { + /** + * Elements are laid out from left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elements are laid out from left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elements are laid out from left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elements are laid out from left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Ltr, + + /** + * Elements are laid out from right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elements are laid out from right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elements are laid out from right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elements are laid out from right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Rtl, + + /** + * Use the default layout direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Use the default layout direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Use the default layout direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Use the default layout direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Auto, +} + +/** + * Used to set the status of the scroll bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Used to set the status of the scroll bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Used to set the status of the scroll bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Used to set the status of the scroll bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum BarState { + /** + * Not displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Not displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Not displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Not displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Off, + + /** + * On-demand display (displayed when you touch it and disappears after 2 seconds). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * On-demand display (displayed when you touch it and disappears after 2 seconds). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * On-demand display (displayed when you touch it and disappears after 2 seconds). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * On-demand display (displayed when you touch it and disappears after 2 seconds). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Auto, + + /** + * Resident display. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Resident display. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Resident display. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Resident display. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + On, +} + +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum EdgeEffect { + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Spring, + + /** + * Fade. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Fade. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Fade. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Fade. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Fade, + + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, +} + +/** + * Alignment enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Alignment enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Alignment enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Alignment enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Alignment { + /** + * Top Start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Top Start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Top Start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top Start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + TopStart, + + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Top, + + /** + * Top tail end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Top tail end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Top tail end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top tail end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + TopEnd, + + /** + * The starting end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The starting end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The starting end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The starting end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * The tail end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The tail end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The tail end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The tail end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, + + /** + * Bottom starting end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Bottom starting end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Bottom starting end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Bottom starting end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BottomStart, + + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * Bottom end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Bottom end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Bottom end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Bottom end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BottomEnd, +} + +/** + * TransitionType enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * TransitionType enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * TransitionType enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * TransitionType enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TransitionType { + /** + * Specifies that the current transition action takes effect in all change scenarios of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Specifies that the current transition action takes effect in all change scenarios of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies that the current transition action takes effect in all change scenarios of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies that the current transition action takes effect in all change scenarios of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + All, + + /** + * Specifies the insertion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Specifies the insertion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies the insertion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies the insertion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Insert, + + /** + * Specifies the deletion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Specifies the deletion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies the deletion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies the deletion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Delete, +} + +/** + * RelateType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * RelateType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * RelateType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum RelateType { + /** + * Scales the current component to fill the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Scales the current component to fill the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scales the current component to fill the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + FILL, + + /** + * Scales the current component to fit the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Scales the current component to fit the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scales the current component to fit the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + FIT, +} + +/** + * Controls the display or hide of the current component + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Controls the display or hide of the current component + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Controls the display or hide of the current component + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Controls the display or hide of the current component + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Visibility { + /** + * Show + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Show + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Show + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Show + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Visible, + + /** + * Hide, but participate in layout for placeholder. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Hide, but participate in layout for placeholder. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Hide, but participate in layout for placeholder. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Hide, but participate in layout for placeholder. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Hidden, + + /** + * Hides but does not participate in layout and does not take place. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Hides but does not participate in layout and does not take place. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Hides but does not participate in layout and does not take place. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Hides but does not participate in layout and does not take place. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, +} + +/** + * LineCapStyle enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * LineCapStyle enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * LineCapStyle enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * LineCapStyle enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum LineCapStyle { + /** + * The two ends of the dividing line are parallel lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The two ends of the dividing line are parallel lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The two ends of the dividing line are parallel lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The two ends of the dividing line are parallel lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Butt, + + /** + * The two ends of the dividing line are semicircles. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The two ends of the dividing line are semicircles. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The two ends of the dividing line are semicircles. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The two ends of the dividing line are semicircles. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Round, + + /** + * Extends half a circle at the end of the path with a width equal to half the line width and a height equal to the line width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Extends half a circle at the end of the path with a width equal to half the line width and a height equal to the line width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Extends half a circle at the end of the path with a width equal to half the line width and a height equal to the line width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Extends half a circle at the end of the path with a width equal to half the line width and a height equal to the line width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Square, +} + +/** + * Axis enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Axis enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Axis enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Axis enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Axis { + /** + * Longitudinal arrangement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Longitudinal arrangement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Longitudinal arrangement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Longitudinal arrangement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Vertical, + + /** + * Horizontal arrangement. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Horizontal arrangement. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Horizontal arrangement. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Horizontal arrangement. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Horizontal, +} + +/** + * HorizontalAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * HorizontalAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * HorizontalAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * HorizontalAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum HorizontalAlign { + /** + * Aligns the start end in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Aligns the start end in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Aligns the start end in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Aligns the start end in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * Aligns the ends in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Aligns the ends in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Aligns the ends in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Aligns the ends in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, +} + +/** + * FlexAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * FlexAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * FlexAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * FlexAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FlexAlign { + /** + * The element is aligned at the head of the principal axis, + * the first element is aligned with the head of the row, and subsequent elements are aligned with the previous one. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The element is aligned at the head of the principal axis, + * the first element is aligned with the head of the row, and subsequent elements are aligned with the previous one. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The element is aligned at the head of the principal axis, + * the first element is aligned with the head of the row, and subsequent elements are aligned with the previous one. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The element is aligned at the head of the principal axis, + * the first element is aligned with the head of the row, and subsequent elements are aligned with the previous one. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * The elements are centered in the direction of the principal axis, + * and the first element is the same distance from the beginning of the row as the last element is from the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The elements are centered in the direction of the principal axis, + * and the first element is the same distance from the beginning of the row as the last element is from the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The elements are centered in the direction of the principal axis, + * and the first element is the same distance from the beginning of the row as the last element is from the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The elements are centered in the direction of the principal axis, + * and the first element is the same distance from the beginning of the row as the last element is from the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * The element is aligned at the tail of the principal axis, + * the last element is aligned at the end of the row, and the other elements are aligned with the next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The element is aligned at the tail of the principal axis, + * the last element is aligned at the end of the row, and the other elements are aligned with the next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The element is aligned at the tail of the principal axis, + * the last element is aligned at the end of the row, and the other elements are aligned with the next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The element is aligned at the tail of the principal axis, + * the last element is aligned at the end of the row, and the other elements are aligned with the next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, + + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. + * The first element aligns with the beginning of the line, and the last element aligns with the end of the line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. + * The first element aligns with the beginning of the line, and the last element aligns with the end of the line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. + * The first element aligns with the beginning of the line, and the last element aligns with the end of the line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. + * The first element aligns with the beginning of the line, and the last element aligns with the end of the line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + SpaceBetween, + + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. Half the distance between adjacent elements as the distance between + * the first element and the distance between the last element and the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. Half the distance between adjacent elements as the distance between + * the first element and the distance between the last element and the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. Half the distance between adjacent elements as the distance between + * the first element and the distance between the last element and the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. Half the distance between adjacent elements as the distance between + * the first element and the distance between the last element and the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + SpaceAround, + + /** + * Elements in the Flex axis direction are evenly spaced. + * The spacing between adjacent elements, the spacing between the first element and the beginning of the row, + * and the spacing between the last element and the end of the row are the same. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elements in the Flex axis direction are evenly spaced. + * The spacing between adjacent elements, the spacing between the first element and the beginning of the row, + * and the spacing between the last element and the end of the row are the same. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elements in the Flex axis direction are evenly spaced. + * The spacing between adjacent elements, the spacing between the first element and the beginning of the row, + * and the spacing between the last element and the end of the row are the same. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elements in the Flex axis direction are evenly spaced. + * The spacing between adjacent elements, the spacing between the first element and the beginning of the row, + * and the spacing between the last element and the end of the row are the same. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + SpaceEvenly, +} + +/** + * ItemAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * ItemAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * ItemAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * ItemAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ItemAlign { + /** + * Use the default configuration in the Flex container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Use the default configuration in the Flex container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Use the default configuration in the Flex container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Use the default configuration in the Flex container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Auto, + + /** + * The element is in the Flex container with the cross-axis direction head aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The element is in the Flex container with the cross-axis direction head aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The element is in the Flex container with the cross-axis direction head aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The element is in the Flex container with the cross-axis direction head aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * The element is centered in the Flex container with the cross axis direction aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The element is centered in the Flex container with the cross axis direction aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The element is centered in the Flex container with the cross axis direction aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The element is centered in the Flex container with the cross axis direction aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * The element is bottom aligned in the Flex container with the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The element is bottom aligned in the Flex container with the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The element is bottom aligned in the Flex container with the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The element is bottom aligned in the Flex container with the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, + + /** + * Element In the Flex container, the cross-axis direction text baseline is aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Element In the Flex container, the cross-axis direction text baseline is aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Element In the Flex container, the cross-axis direction text baseline is aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Element In the Flex container, the cross-axis direction text baseline is aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Baseline, + + /** + * Element In a Flex container, the fill is stretched across the axis and, when no dimension is set, to the container size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Element In a Flex container, the fill is stretched across the axis and, when no dimension is set, to the container size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Element In a Flex container, the fill is stretched across the axis and, when no dimension is set, to the container size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Element In a Flex container, the fill is stretched across the axis and, when no dimension is set, to the container size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Stretch, +} + +/** + * FlexDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * FlexDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * FlexDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * FlexDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FlexDirection { + /** + * The main axis is consistent with the row direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The main axis is consistent with the row direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The main axis is consistent with the row direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The main axis is consistent with the row direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Row, + + /** + * The main axis is consistent with the column direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The main axis is consistent with the column direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The main axis is consistent with the column direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The main axis is consistent with the column direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Column, + + /** + * The layout is in the opposite direction to the Row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The layout is in the opposite direction to the Row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The layout is in the opposite direction to the Row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The layout is in the opposite direction to the Row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + RowReverse, + + /** + * Layout in the opposite direction to the column. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Layout in the opposite direction to the column. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Layout in the opposite direction to the column. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Layout in the opposite direction to the column. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + ColumnReverse, +} + +/** + * Pixel Round Direction + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum PixelRoundCalcPolicy { + /** + * No Force round the component boundary coordinates to integer pixel. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + NO_FORCE_ROUND = 0, + /** + * Force ceil the component boundary coordinates to integer pixel. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + FORCE_CEIL = 1, + /** + * Force floor the component boundary coordinates to integer pixel. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + FORCE_FLOOR = 2, +} + +/** + * FlexWrap enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * FlexWrap enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * FlexWrap enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * FlexWrap enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FlexWrap { + /** + * The Flex container has a single row/column layout of elements, and children are allowed to go beyond the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Flex container has a single row/column layout of elements, and children are allowed to go beyond the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The Flex container has a single row/column layout of elements, and children are allowed to go beyond the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The Flex container has a single row/column layout of elements, and children are allowed to go beyond the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + NoWrap, + + /** + * The elements of the Flex container are arranged in multiple rows or columns, and the sub-items are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The elements of the Flex container are arranged in multiple rows or columns, and the sub-items are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The elements of the Flex container are arranged in multiple rows or columns, and the sub-items are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The elements of the Flex container are arranged in multiple rows or columns, and the sub-items are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Wrap, + + /** + * The elements of the Flex container are arranged in reverse multiple rows/columns, and children are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The elements of the Flex container are arranged in reverse multiple rows/columns, and children are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The elements of the Flex container are arranged in reverse multiple rows/columns, and children are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The elements of the Flex container are arranged in reverse multiple rows/columns, and children are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + WrapReverse, +} + +/** + * VerticalAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * VerticalAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * VerticalAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * VerticalAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum VerticalAlign { + /** + * Top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Top, + + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * Bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bottom, +} + +/** + * ImageRepeat enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * ImageRepeat enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * ImageRepeat enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * ImageRepeat enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ImageRepeat { + /** + * Do not draw the picture again. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Do not draw the picture again. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Do not draw the picture again. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Do not draw the picture again. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + NoRepeat, + + /** + * Repeat the drawing only on the horizontal axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Repeat the drawing only on the horizontal axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Repeat the drawing only on the horizontal axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Repeat the drawing only on the horizontal axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + X, + + /** + * Repeat the drawing only on the vertical axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Repeat the drawing only on the vertical axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Repeat the drawing only on the vertical axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Repeat the drawing only on the vertical axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Y, + + /** + * Draw the picture repeatedly on both axes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Draw the picture repeatedly on both axes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draw the picture repeatedly on both axes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draw the picture repeatedly on both axes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + XY, +} + +/** + * ImageSize enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * ImageSize enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * ImageSize enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * ImageSize enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ImageSize { + /** + * Keep the scale of the original image unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the scale of the original image unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the scale of the original image unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the scale of the original image unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Auto, + + /** + * Default value. Keep the aspect ratio to zoom in or out the image so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Default value. Keep the aspect ratio to zoom in or out the image so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Default value. Keep the aspect ratio to zoom in or out the image so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Default value. Keep the aspect ratio to zoom in or out the image so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Cover, + + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Contain, + + /** + * Zoom in or out without maintaining the aspect ratio so that the image fills the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FILL = 3, +} + +/** + * GradientDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * GradientDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * GradientDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * GradientDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum GradientDirection { + /** + * Right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Left, + + /** + * From the bottom up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * From the bottom up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * From the bottom up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * From the bottom up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Top, + + /** + * From left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * From left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * From left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * From left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Right, + + /** + * From the top down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * From the top down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * From the top down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * From the top down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * Top Left + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Top Left + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Top Left + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top Left + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LeftTop, + + /** + * Left Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Left Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Left Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Left Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LeftBottom, + + /** + * Right Top + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Right Top + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Right Top + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Right Top + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + RightTop, + + /** + * Right Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Right Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Right Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Right Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + RightBottom, + + /** + * None + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * None + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * None + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * None + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, +} + +/** + * SharedTransitionEffectType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * SharedTransitionEffectType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * SharedTransitionEffectType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SharedTransitionEffectType { + /** + * The location of the destination page element remains unchanged, and you can configure the transparency animation. Currently, + * only the static effect configured for redirecting to the target page takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The location of the destination page element remains unchanged, and you can configure the transparency animation. Currently, + * only the static effect configured for redirecting to the target page takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The location of the destination page element remains unchanged, and you can configure the transparency animation. Currently, + * only the static effect configured for redirecting to the target page takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Static, + + /** + * Move the source page element to the destination page element location and scale it appropriately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Move the source page element to the destination page element location and scale it appropriately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Move the source page element to the destination page element location and scale it appropriately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Exchange, +} + +/** + * Text style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Text style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Text style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Text style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FontStyle { + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Normal, + + /** + * Italic style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Italic style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Italic style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Italic style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Italic, +} + +/** + * The font weight of the text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The font weight of the text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * The font weight of the text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * The font weight of the text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FontWeight { + /** + * Defines a lighter value than [Inherited Value].. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines a lighter value than [Inherited Value].. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines a lighter value than [Inherited Value].. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines a lighter value than [Inherited Value].. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Lighter, + + /** + * Normal font. Equivalent to a digital value of 400. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Normal font. Equivalent to a digital value of 400. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Normal font. Equivalent to a digital value of 400. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Normal font. Equivalent to a digital value of 400. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Normal, + + /** + * Defines a more general value than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines a more general value than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines a more general value than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines a more general value than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Regular, + + /** + * Defines a value that is more centered than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines a value that is more centered than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines a value that is more centered than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines a value that is more centered than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Medium, + + /** + * Bold. Equivalent to a numeric value of 700. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Bold. Equivalent to a numeric value of 700. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Bold. Equivalent to a numeric value of 700. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Bold. Equivalent to a numeric value of 700. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bold, + + /** + * Defines a value that is heavier than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines a value that is heavier than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines a value that is heavier than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines a value that is heavier than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bolder, +} + +/** + * Alignment of text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Alignment of text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Alignment of text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Alignment of text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TextAlign { + /** + * Center the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Center the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Center the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Center the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * The text is aligned in the same direction as the writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The text is aligned in the same direction as the writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The text is aligned in the same direction as the writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The text is aligned in the same direction as the writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * The text is aligned in the opposite direction of writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The text is aligned in the opposite direction of writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The text is aligned in the opposite direction of writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The text is aligned in the opposite direction of writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, + + /** + * Justify the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Justify the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + JUSTIFY, +} + +/** + * Declare how text overflows. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare how text overflows. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare how text overflows. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare how text overflows. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TextOverflow { + /** + * When the text overflows its dimensions, the text will not be cropped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * When the text overflows its dimensions, the text will not be cropped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * When the text overflows its dimensions, the text will not be cropped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * When the text overflows its dimensions, the text will not be cropped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * When the text overflows its dimensions, the text will be cropped and displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * When the text overflows its dimensions, the text will be cropped and displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * When the text overflows its dimensions, the text will be cropped and displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * When the text overflows its dimensions, the text will be cropped and displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Clip, + + /** + * If the text overflows its dimensions, the text that cannot be displayed shall be replaced by ellipsis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * If the text overflows its dimensions, the text that cannot be displayed shall be replaced by ellipsis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * If the text overflows its dimensions, the text that cannot be displayed shall be replaced by ellipsis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * If the text overflows its dimensions, the text that cannot be displayed shall be replaced by ellipsis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Ellipsis, + + /** + * When the text overflows its dimensions, the text will scroll for displaying. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * When the text overflows its dimensions, the text will scroll for displaying. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MARQUEE, +} + +/** + * Type of text modifier. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Type of text modifier. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Type of text modifier. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Type of text modifier. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TextDecorationType { + /** + * Do not use text decorative lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Do not use text decorative lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Do not use text decorative lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Do not use text decorative lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * Underline the words. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Underline the words. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Underline the words. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Underline the words. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Underline, + + /** + * Text is in all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text is in all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text is in all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text is in all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Overline, + + /** + * A modifier line that passes through the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * A modifier line that passes through the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * A modifier line that passes through the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * A modifier line that passes through the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LineThrough, +} + +/** + * Letter type in text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Letter type in text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Letter type in text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Letter type in text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TextCase { + /** + * The default is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The default is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The default is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The default is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Normal, + + /** + * The text is all lowercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The text is all lowercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The text is all lowercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The text is all lowercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LowerCase, + + /** + * The text is all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The text is all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The text is all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The text is all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + UpperCase, +} + +/** + * Enum of text height adaptation + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum of text height adaptation + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum TextHeightAdaptivePolicy { + /** + * Priority is given to using the maxLines attribute to adapt the text height. + * If the layout size using the maxLines attribute exceeds the layout constraint, try reducing the font size to + * display more text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Priority is given to using the maxLines attribute to adapt the text height. + * If the layout size using the maxLines attribute exceeds the layout constraint, try reducing the font size to + * display more text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MAX_LINES_FIRST, + + /** + * Priority is given to using the minFontSize attribute to adapt the text height. + * If the text can be layout in a single line using the minFontSize property, try increasing the font size and using + * the maximum possible font size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Priority is given to using the minFontSize attribute to adapt the text height. + * If the text can be layout in a single line using the minFontSize property, try increasing the font size and using + * the maximum possible font size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MIN_FONT_SIZE_FIRST, + + /** + * Priority is given to using the layout constraint to adapt the text height. + * If the layout size exceeds the layout constraint, try reducing the font size. If the layout size still exceeds + * the layout constraint after reducing the font size to minFontSize, remove the lines that exceed the layout + * constraint. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Priority is given to using the layout constraint to adapt the text height. + * If the layout size exceeds the layout constraint, try reducing the font size. If the layout size still exceeds + * the layout constraint after reducing the font size to minFontSize, remove the lines that exceed the layout + * constraint. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LAYOUT_CONSTRAINT_FIRST, +} + +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ResponseType { + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RightClick, + + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LongPress, +} + +/** + * HoverEffect enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * HoverEffect enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * HoverEffect enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum HoverEffect { + /** + * Default effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Default effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Auto, + + /** + * Zoom in and out effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Zoom in and out effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Zoom in and out effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Scale, + + /** + * Highlight effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Highlight effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Highlight effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Highlight, + + /** + * None effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * None effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * None effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, +} + +/** + * Placement enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Placement enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Placement enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum Placement { + /** + * Left placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Left placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Left placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Left, + + /** + * Right placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Right placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Right placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Right, + + /** + * Top placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Top placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Top placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Top, + + /** + * Bottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Bottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * TopLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * TopLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * TopLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TopLeft, + + /** + * TopRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * TopRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * TopRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TopRight, + + /** + * BottomLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * BottomLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * BottomLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BottomLeft, + + /** + * BottomRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * BottomRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * BottomRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BottomRight, + + /** + * LeftTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * LeftTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * LeftTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LeftTop, + + /** + * LeftBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * LeftBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * LeftBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LeftBottom, + + /** + * RightTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * RightTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * RightTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RightTop, + + /** + * RightBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * RightBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * RightBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RightBottom, +} + +/** + * ArrowPointPosition enumeration description + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * ArrowPointPosition enumeration description + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum ArrowPointPosition { + /** + * Target start position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Target start position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + START = 'Start', + + /** + * Target center position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Target center position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CENTER = 'Center', + + /** + * Target end position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Target end position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + END = 'End', +} + +/** + * Indicates the share option. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Indicates the share option. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Indicates the share option. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum CopyOptions { + /** + * Not allow share. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Not allow share. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Not allow share. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None = 0, + + /** + * Share in app. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Share in app. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Share in app. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + InApp = 1, + + /** + * Share in local device. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Share in local device. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Share in local device. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LocalDevice = 2, + + /** + * Share in cross Device + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + * @deprecated since 12 + */ + CROSS_DEVICE = 3, +} + +/** + * Defines the hit test mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the hit test mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the hit test mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum HitTestMode { + /** + * Both self and children nodes respond to the hit test for touch events, + * but block hit test of the other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Both self and children nodes respond to the hit test for touch events, + * but block hit test of the other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Both self and children nodes respond to the hit test for touch events, + * but block hit test of the other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Default, + + /** + * Self respond to the hit test for touch events, + * but block hit test of children and other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Self respond to the hit test for touch events, + * but block hit test of children and other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Self respond to the hit test for touch events, + * but block hit test of children and other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Block, + + /** + * Self and children respond to the hit test for touch events, + * and allow hit test of other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Self and children respond to the hit test for touch events, + * and allow hit test of other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Self and children respond to the hit test for touch events, + * and allow hit test of other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Transparent, + + /** + * Self not respond to the hit test for touch events, + * but children respond to the hit test for touch events. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Self not respond to the hit test for touch events, + * but children respond to the hit test for touch events. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Self not respond to the hit test for touch events, + * but children respond to the hit test for touch events. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, +} + +/** + * Title height. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Title height. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Title height. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum TitleHeight { + /** + * Title height when only main title is available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Title height when only main title is available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Title height when only main title is available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MainOnly, + + /** + * Title height when main title and subtitle are both available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Title height when main title and subtitle are both available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Title height when main title and subtitle are both available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MainWithSub, +} + +/** + * Modifier key for hot key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Modifier key for hot key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ModifierKey { + /** + * ctrl. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * ctrl. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CTRL, + + /** + * shift. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * shift. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SHIFT, + + /** + * alt. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * alt. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ALT, +} + +/** + * Function key for hot key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Function key for hot key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum FunctionKey { + /** + * Escape key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Escape key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ESC, + + /** + * F1 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F1 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F1, + + /** + * F2 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F2 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F2, + + /** + * F3 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F3 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F3, + + /** + * F4 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F4 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F4, + + /** + * F5 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F5 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F5, + + /** + * F6 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F6 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F6, + + /** + * F7 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F7 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F7, + + /** + * F8 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F8 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F8, + + /** + * F9 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F9 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F9, + + /** + * F10 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F10 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F10, + + /** + * F11 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F11 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F11, + + /** + * F12 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F12 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F12, + + /** + * Tab key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TAB, + + /** + * Up arrow key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DPAD_UP, + + /** + * Down arrow key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DPAD_DOWN, + + /** + * Left arrow key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DPAD_LEFT, + + /** + * Right arrow key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DPAD_RIGHT, +} + +/** + * The alignment of ImageSpan + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The alignment of ImageSpan + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ImageSpanAlignment { + /** + * Indicating that the bottom of the ImageSpan should be aligned with the baseline of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicating that the bottom of the ImageSpan should be aligned with the baseline of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BASELINE, + + /** + * Indicating that the bottom of the ImageSpan should be aligned with the bottom of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicating that the bottom of the ImageSpan should be aligned with the bottom of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOTTOM, + + /** + * Indicating that the center of the ImageSpan should be aligned with the center of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicating that the center of the ImageSpan should be aligned with the center of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CENTER, + + /** + * Indicating that the top of the ImageSpan should be aligned with the top of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicating that the top of the ImageSpan should be aligned with the top of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TOP, +} + +/** + * ObscuredReasons. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * ObscuredReasons. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ObscuredReasons { + /** + * Displayed data should appear as generic placeholders. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Displayed data should appear as generic placeholders. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + PLACEHOLDER = 0, +} + +/** + * Text content style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Text content style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum TextContentStyle { + /** + * Text content default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text content default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DEFAULT, + + /** + * Text content inline style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text content inline style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + INLINE +} + +/** + * Enum of click effect level. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum of click effect level. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ClickEffectLevel { + /** + * Click effect level1. + * The default scale number of this click effect level1 is 0.90. + * The animation type is interpolatingSpring, velocity:10, mass:1, stiffness:410, damping:38. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Click effect level1. + * The default scale number of this click effect level1 is 0.90. + * The animation type is interpolatingSpring, velocity:10, mass:1, stiffness:410, damping:38. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LIGHT, + + /** + * Click effect level2. + * The default scale number of this click effect level2 is 0.95. + * The animation type is interpolatingSpring, velocity:10, mass:1, stiffness:350, damping:35. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Click effect level2. + * The default scale number of this click effect level2 is 0.95. + * The animation type is interpolatingSpring, velocity:10, mass:1, stiffness:350, damping:35. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MIDDLE, + + /** + * Click effect level3. + * The default scale number of this click effect level3 is 0.95. + * The animation type is interpolatingSpring, velocity:0, mass:1, stiffness:240, damping:28. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Click effect level3. + * The default scale number of this click effect level3 is 0.95. + * The animation type is interpolatingSpring, velocity:0, mass:1, stiffness:240, damping:28. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + HEAVY, +} + +/** + * The type of XComponent + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * The type of XComponent + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +/** + * The type of XComponent + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum XComponentType { + /** + * Surface type. The default type is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Surface type. The default type is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Surface type. The default type is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SURFACE, + + /** + * Component type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Component type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + COMPONENT, + + /** + * Texture type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Texture type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + TEXTURE, + + /** + * Node type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + NODE, +} + +/** + * Nested scroll nested mode + + * @enum { number } NestedScrollMode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Nested scroll nested mode + + * @enum { number } NestedScrollMode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum NestedScrollMode { + /** + * Only Self response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Only Self response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SELF_ONLY, + + /** + * Self priority response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Self priority response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SELF_FIRST, + + /** + * Parent scrollable component priority response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Parent scrollable component priority response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + PARENT_FIRST, + + /** + * Both self and parent scrollable component response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Both self and parent scrollable component response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + PARALLEL, +} + +/** + * The possible source of scroll event + * @enum { number } ScrollSource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum ScrollSource { + /** + * Drag events. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DRAG = 0, + + /** + * Fling after the drag has ended with velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FLING, + + /** + * Over scroll with EdgeEffect.Spring. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + EDGE_EFFECT, + + /** + * Other user input except drag, such as mouse wheel, key event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + OTHER_USER_INPUT, + + /** + * Drag events of scroll bar. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SCROLL_BAR, + + /** + * Fling after the drag on scroll bar has ended with velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SCROLL_BAR_FLING, + + /** + * Member methods of Scroller without animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SCROLLER, + + /** + * Member methods of Scroller with animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SCROLLER_ANIMATION, +} + +/** + * Enum of RenderFit + * + * @enum { number } RenderFit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum of RenderFit + * + * @enum { number } RenderFit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum RenderFit { + /** + * Without scaling the content area, the content area is drawn in the center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CENTER = 0, + /** + * Without scaling the content area, the content area is drawn in the top center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the top center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TOP = 1, + /** + * Without scaling the content area, the content area is drawn in the bottom center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the bottom center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOTTOM = 2, + /** + * Without scaling the content area, the content area is drawn in the left center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the left center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LEFT = 3, + /** + * Without scaling the content area, the content area is drawn in the right center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the right center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RIGHT = 4, + /** + * Without scaling the content area, the content area is drawn in the top left of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the top left of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TOP_LEFT = 5, + /** + * Without scaling the content area, the content area is drawn in the top right of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the top right of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TOP_RIGHT = 6, + /** + * Without scaling the content area, the content area is drawn in the bottom left of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the bottom left of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOTTOM_LEFT = 7, + /** + * Without scaling the content area, the content area is drawn in the bottom right of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the bottom right of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOTTOM_RIGHT = 8, + /** + * Scale the length and width of the content area to the node size to fill the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length and width of the content area to the node size to fill the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_FILL = 9, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node, and the content after scaling + * is centered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node, and the content after scaling + * is centered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_CONTAIN = 10, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node. If the height of the scaled content + * is less than or equal to the height of the node, the scaled content area is displayed at the top; otherwise, + * the width of the scaled content is less than or equal to the width of the node, the scaled content area is + * displayed at the left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node. If the height of the scaled content + * is less than or equal to the height of the node, the scaled content area is displayed at the top; otherwise, + * the width of the scaled content is less than or equal to the width of the node, the scaled content area is + * displayed at the left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_CONTAIN_TOP_LEFT = 11, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node. If the height of the scaled content + * is less than or equal to the height of the node, the scaled content area is displayed at the bottom; otherwise, + * the width of the scaled content is less than or equal to the width of the node, the scaled content area is + * displayed at the right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node. If the height of the scaled content + * is less than or equal to the height of the node, the scaled content area is displayed at the bottom; otherwise, + * the width of the scaled content is less than or equal to the width of the node, the scaled content area is + * displayed at the right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_CONTAIN_BOTTOM_RIGHT = 12, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node, and the content after scaling + * displays the center area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node, and the content after scaling + * displays the center area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_COVER = 13, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node. If the height of the scaled content + * is greater than or equal to the height of the node, the scaled content area displays the top area; otherwise, + * the width of the scaled content is greater than or equal to the width of the node, the scaled content area + * displays the left area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node. If the height of the scaled content + * is greater than or equal to the height of the node, the scaled content area displays the top area; otherwise, + * the width of the scaled content is greater than or equal to the width of the node, the scaled content area + * displays the left area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_COVER_TOP_LEFT = 14, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node. If the height of the scaled content + * is greater than or equal to the height of the node, the scaled content area displays the bottom area; otherwise, + * the width of the scaled content is greater than or equal to the width of the node, the scaled content area + * displays the right area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node. If the height of the scaled content + * is greater than or equal to the height of the node, the scaled content area displays the bottom area; otherwise, + * the width of the scaled content is greater than or equal to the width of the node, the scaled content area + * displays the right area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_COVER_BOTTOM_RIGHT = 15, +} + +/** + * The Button Style of dialog, + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The Button Style of dialog, + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum DialogButtonStyle { + /** + * Default Style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default Style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DEFAULT = 0, + + /** + * Highlight Style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Highlight Style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + HIGHLIGHT = 1 +} + +/** + * Enum of word break + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum WordBreak { + /** + * By default, CJK text can be wrapped between any 2 characters, and non-CJK text can only be wrapped in spaces. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NORMAL = 0, + + /** + * Non-CJK text be wrapped at any character + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BREAK_ALL = 1, + + /** + * Non-CJK text can be wrapped at any character + * and if a complete word can be preserved in space breaks, the word must be kept on the line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BREAK_WORD = 2, +} + +/** + * Enum of line break strategy + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum LineBreakStrategy { + /** + * By default. Display as many characters as possible on each line until no more characters + * can be displayed on that line, and do not automatically add hyphens under this strategy + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + GREEDY = 0, + + /** + * High quality folding. Optimize the layout of the entire text's line breaks and automatically + * add hyphens if necessary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HIGH_QUALITY = 1, + + /** + * Balanced folding. We will try our best to ensure that the width of each line in a paragraph + * is the same, and if necessary, we will add conjunction + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BALANCED = 2, +} + +/** + * Enum of ellipsisMode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Enum of ellipsisMode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum EllipsisMode { + /** + * The ellipsis is in the head. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The ellipsis is in the head. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + START = 0, + + /** + * The ellipsis is in the middle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The ellipsis is in the middle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CENTER = 1, + + /** + * The ellipsis is at the end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The ellipsis is at the end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + END = 2, +} + +/** + * A type which can be undefined + * + * @typedef { T | undefined } Nullable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * A type which can be undefined + * + * @typedef { T | undefined } Nullable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type Nullable = T | undefined; + + +/** + * Decide whether the width of select menu fit the trigger or content + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Decide whether the width of select menu fit the trigger or content + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum OptionWidthMode { + /** + * The menu width fit the content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The menu width fit the content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FIT_CONTENT = 'fit_content', + + /** + * The menu width fit the trigger. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The menu width fit the trigger. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FIT_TRIGGER = 'fit_trigger', +} + +/** + * Enum of Illuminated type + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ +declare enum IlluminatedType { + /** + * Component is not illuminated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + NONE = 0, + /** + * Border is illuminated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + BORDER = 1, + /** + * Content is illuminated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + CONTENT = 2, + /** + * Border and Content is illuminated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + BORDER_CONTENT = 3, + /** + * Border is illuminated, and the border have a bloom effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + BLOOM_BORDER = 4, + /** + * Border and Content is illuminated, and the border have a bloom effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + BLOOM_BORDER_CONTENT = 5 +} + +/** + * Enumerates the fold status. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Enumerates the fold status. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum FoldStatus { + /** + * Fold Status Unknown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Fold Status Unknown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLD_STATUS_UNKNOWN = 0, + /** + * Fold Status Expanded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Fold Status Expanded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLD_STATUS_EXPANDED = 1, + /** + * Fold Status Folded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Fold Status Folded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLD_STATUS_FOLDED = 2, + /** + * Fold Status Half Folded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Fold Status Half Folded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLD_STATUS_HALF_FOLDED = 3, +} + +/** + * Enumerates the app rotation. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum AppRotation { + + /** + * App does not rotate to display vertically. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ROTATION_0 = 0, + + /** + * App rotates 90 degrees clockwise to display horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ROTATION_90 = 1, + + /** + * App rotates 180 degrees clockwise to display vertically in reverse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ROTATION_180 = 2, + + /** + * App rotates 270 degrees clockwise to display horizontally in reverse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ROTATION_270 = 3 +} + +/** + * Enum of EmbeddedType + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum EmbeddedType { + /** + * The EmbeddedComponent show the UI in EmbeddedUIExtensionAbility. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + EMBEDDED_UI_EXTENSION = 0, +} + +/** + * Marquee scrolling strategy after text update + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum MarqueeUpdateStrategy { + /** + * Reset scroll position and restart scroll. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DEFAULT = 0, + + /** + * Preserve scroll position, just change to new text + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PRESERVE_POSITION = 1 +} + +/** + * Type of text decoration line style. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum TextDecorationStyle { + /** + * Solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SOLID = 0, + + /** + * Double lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DOUBLE = 1, + + /** + * Dotted line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DOTTED = 2, + + /** + * Dashed line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DASHED = 3, + + /** + * Wavy line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + WAVY = 4, +} + +/** + * Type of text selectable. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum TextSelectableMode { + /** + * set text selectable and unfocusable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SELECTABLE_UNFOCUSABLE = 0, + + /** + * set text selectable and focusable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SELECTABLE_FOCUSABLE = 1, + + /** + * set text unselectable and unfocusable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + UNSELECTABLE = 2, +} + +/** + * Type of accessibility hover event. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum AccessibilityHoverType { + /** + * Hover enter type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HOVER_ENTER = 0, + + /** + * Hover move type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HOVER_MOVE = 1, + + /** + * Hover exit type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HOVER_EXIT = 2, + + /** + * Hover cancel type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HOVER_CANCEL = 3, +} + +/** + * Type of window width breakpoint. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +declare enum WidthBreakpoint { + /** + * Window width < 320vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_XS = 0, + + /** + * Window width >= 320vp and < 600vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_SM = 1, + + /** + * Window width >= 600vp and < 840vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_MD = 2, + + /** + * Window width >= 840vp and < 1440vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_LG = 3, + + /** + * Window width >= 1440vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_XL = 4, +} + +/** + * Type of window height breakpoint. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +declare enum HeightBreakpoint { + /** + * Window aspectRatio < 0.8 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_SM = 0, + + /** + * Window aspectRatio >= 0.8 and < 1.2 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_MD = 1, + + /** + * Window aspectRatio >= 1.2 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_LG = 2, +} \ No newline at end of file diff --git a/tests/arkts-sdk/ets/flex.d.ts b/tests/arkts-sdk/ets/flex.d.ts new file mode 100644 index 00000000..9fd5c1b9 --- /dev/null +++ b/tests/arkts-sdk/ets/flex.d.ts @@ -0,0 +1,469 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the options of Flex. + * + * @interface FlexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of Flex. + * + * @interface FlexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of Flex. + * + * @interface FlexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of Flex. + * + * @interface FlexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface FlexOptions { + /** + * Sets the horizontal layout of elements. + * + * @type { ?FlexDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the horizontal layout of elements. + * + * @type { ?FlexDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the horizontal layout of elements. + * + * @type { ?FlexDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the horizontal layout of elements. + * + * @type { ?FlexDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + direction?: FlexDirection; + + /** + * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. + * + * @type { ?FlexWrap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. + * + * @type { ?FlexWrap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. + * + * @type { ?FlexWrap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. + * + * @type { ?FlexWrap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + wrap?: FlexWrap; + + /** + * The alignment format of the subassembly on the Flex container spindle. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The alignment format of the subassembly on the Flex container spindle. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The alignment format of the subassembly on the Flex container spindle. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The alignment format of the subassembly on the Flex container spindle. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + justifyContent?: FlexAlign; + + /** + * Alignment Format for Subassembly on Flex Container Cross Axis. + * + * @type { ?ItemAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Alignment Format for Subassembly on Flex Container Cross Axis. + * + * @type { ?ItemAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Alignment Format for Subassembly on Flex Container Cross Axis. + * + * @type { ?ItemAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Alignment Format for Subassembly on Flex Container Cross Axis. + * + * @type { ?ItemAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignItems?: ItemAlign; + + /** + * The alignment of multiple lines of content when there is extra space in the cross axis. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The alignment of multiple lines of content when there is extra space in the cross axis. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The alignment of multiple lines of content when there is extra space in the cross axis. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The alignment of multiple lines of content when there is extra space in the cross axis. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignContent?: FlexAlign; + + /** + * The space to be inserted, either horizontally or vertically, + * between two adjacent components in the Flex container. + * + * @type { ?FlexSpaceOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + space?: FlexSpaceOptions; +} + +/** + * The space to be inserted, either horizontally or vertically, + * between two adjacent components in the Flex container. + * + * @interface FlexSpaceOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + +declare interface FlexSpaceOptions { + /** + * Defines the main space property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + main?: LengthMetrics; + + /** + * Defines the cross space property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cross?: LengthMetrics; +} + +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @interface FlexInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @interface FlexInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @interface FlexInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @interface FlexInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface FlexInterface { + /** + * Defines the constructor of Flex. + * + * @param { FlexOptions } value + * @returns { FlexAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the constructor of Flex. + * + * @param { FlexOptions } value + * @returns { FlexAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the constructor of Flex. + * + * @param { FlexOptions } value + * @returns { FlexAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the constructor of Flex. + * + * @param { FlexOptions } value + * @returns { FlexAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (value?: FlexOptions): FlexAttribute; +} + +/** + * Defines the Flex attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Flex attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Flex attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Flex attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class FlexAttribute extends CommonMethod { + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { FlexAttribute } The attribute of the flex. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): FlexAttribute; +} + +/** + * Defines Flex Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Flex Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Flex Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Flex Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Flex: FlexInterface; + +/** + * Defines Flex Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Flex Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Flex Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Flex Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const FlexInstance: FlexAttribute; diff --git a/tests/arkts-sdk/ets/flow_item.d.ts b/tests/arkts-sdk/ets/flow_item.d.ts new file mode 100644 index 00000000..83656920 --- /dev/null +++ b/tests/arkts-sdk/ets/flow_item.d.ts @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2022-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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Mesh container for static fixed-size layout scenarios. + * + * @interface FlowItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Mesh container for static fixed-size layout scenarios. + * + * @interface FlowItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Mesh container for static fixed-size layout scenarios. + * + * @interface FlowItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface FlowItemInterface { + /** + * Construct the flow item. + * + * @returns { FlowItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Construct the flow item. + * + * @returns { FlowItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Construct the flow item. + * + * @returns { FlowItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (): FlowItemAttribute; +} + +/** + * Defines the water flow item attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the water flow item attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the water flow item attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class FlowItemAttribute extends CommonMethod {} + +/** + * Defines FlowItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines FlowItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines FlowItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const FlowItem: FlowItemInterface + +/** + * Defines FlowItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines FlowItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines FlowItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const FlowItemInstance: FlowItemAttribute; diff --git a/tests/arkts-sdk/ets/focus.d.ts b/tests/arkts-sdk/ets/focus.d.ts new file mode 100644 index 00000000..2d58b4b4 --- /dev/null +++ b/tests/arkts-sdk/ets/focus.d.ts @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file Provide some common interface for focus. + * @kit ArkUI + */ + +/** + * Focus box style. + * + * @interface FocusBoxStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface FocusBoxStyle { + /** + * Describes the focus-box margin. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + margin?: LengthMetrics; + /** + * Describes the focus-box color. + * + * @type { ?ColorMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + strokeColor?: ColorMetrics; + /** + * Describes the focus-box stroke width. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + strokeWidth?: LengthMetrics; +} + +/** + * Focus Priority + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum FocusPriority { + /** + * Default priority. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + AUTO = 0, + + /** + * Prior priority. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PRIOR = 2000, + + /** + * Previous focus priority. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PREVIOUS = 3000, +} \ No newline at end of file diff --git a/tests/arkts-sdk/ets/folder_stack.d.ts b/tests/arkts-sdk/ets/folder_stack.d.ts new file mode 100644 index 00000000..51fa4139 --- /dev/null +++ b/tests/arkts-sdk/ets/folder_stack.d.ts @@ -0,0 +1,377 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Import the WindowStatusType type object for onHoverStatusChange. + * + * @typedef {import('../api/@ohos.window').default.WindowStatusType} WindowStatusType + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare type WindowStatusType = import('../api/@ohos.window').default.WindowStatusType; + +/** + * FolderStack constructor options. + * + * @interface FolderStackOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +interface FolderStackOptions { + /** + * Define the IDs of the sub component that will be moved to the upper half screen when hovering. + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the IDs of the sub component that will be moved to the upper half screen when hovering. + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + upperItems?: Array; +} + +/** + * Provides ports for stacking containers. + * + * @interface FolderStackInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Provides ports for stacking containers. + * + * @interface FolderStackInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + +interface FolderStackInterface { + /** + * Defines the constructor of folderStack. + * + * @param { object } value - id of children need to be show in upperItem + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the constructor of folderStack. + * + * @param { object } value - id of children need to be show in upperItem + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Defines the constructor of folderStack. + * + * @param { FolderStackOptions } [options] - id of children need to be show in upperItem + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + (options?: FolderStackOptions): FolderStackAttribute; +} + +/** + * Information when onFolderStateChange. + * + * @interface OnFoldStatusChangeInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +interface OnFoldStatusChangeInfo { + /** + * Folder state. + * + * @type { FoldStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Folder state. + * + * @type { FoldStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + foldStatus: FoldStatus +} + +/** + * Callback when onStateChangeCallback. + * + * @typedef { function } OnFoldStatusChangeCallback + * @param { OnFoldStatusChangeInfo } event - the folding information of the current device + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type OnFoldStatusChangeCallback = (event: OnFoldStatusChangeInfo) => void; + +/** + * Callback when onHoverStatusChange. + * + * @typedef { function } OnHoverStatusChangeCallback + * @param { HoverEventParam } param - hover event param + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +declare type OnHoverStatusChangeCallback = (param: HoverEventParam) => void; + +/** +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class FolderStackAttribute extends CommonMethod { + /** + * Set the alignment of folderStack. + * + * @param { Alignment } value - align of children + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the alignment of folderStack. + * + * @param { Alignment } value - align of children + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + alignContent(value: Alignment): FolderStackAttribute; + + /** + * Callback folderState when the folderState changes + * + * @param { function } callback - executed when folderStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Callback folderState when the folderState changes + * + * @param { function } callback - executed when folderStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Callback folderState when the folderState changes + * + * @param { OnFoldStatusChangeCallback } callback - executed when folderStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onFolderStateChange(callback: OnFoldStatusChangeCallback): FolderStackAttribute; + + + /** + * Callback hoverStatus|folderStatus|rotation|windowMode when the hoverStatus changes + * + * @param { function } handler - executed when hoverStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + /** + * Callback hoverStatus|folderStatus|rotation|windowMode when the hoverStatus changes + * + * @param { OnHoverStatusChangeCallback } handler - executed when hoverStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + onHoverStatusChange(handler: OnHoverStatusChangeCallback): FolderStackAttribute; + + /** + * Enable the animation of folderStack. + * + * @param { boolean } value - enable the animation of folderStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Enable the animation of folderStack. + * + * @param { boolean } value - enable the animation of folderStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableAnimation(value: boolean): FolderStackAttribute; + + /** + * Enable auto halfFolder when orientation. + * + * @param { boolean } value - enable auto halfFold + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Enable auto halfFolder when orientation. + * + * @param { boolean } value - enable auto halfFold + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + autoHalfFold(value: boolean): FolderStackAttribute; +} + +/** + * Defines the Embed Data info. + * + * @interface HoverEventParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface HoverEventParam { + /** + * Folder state. + * + * @type { FoldStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + foldStatus: FoldStatus + + /** + * Is hover mode + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + isHoverMode: boolean + + /** + * App rotation + * + * @type { AppRotation } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + appRotation: AppRotation + + /** + * Window status type + * + * @type { WindowStatusType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + windowStatusType: WindowStatusType +} +/** + * Defines FolderStack Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines FolderStack Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const FolderStack: FolderStackInterface; + +/** + * Defines FolderStack Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines FolderStack Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const FolderStackInstance: FolderStackAttribute; diff --git a/tests/arkts-sdk/ets/for_each.d.ts b/tests/arkts-sdk/ets/for_each.d.ts new file mode 100644 index 00000000..d5644b11 --- /dev/null +++ b/tests/arkts-sdk/ets/for_each.d.ts @@ -0,0 +1,165 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * declare ForEachAttribute + * + * @extends DynamicNode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class ForEachAttribute extends DynamicNode { +} + +/** + * looping function. + * + * @interface ForEachInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * looping function. + * + * @interface ForEachInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * looping function. + * + * @interface ForEachInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * looping function. + * + * @interface ForEachInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ForEachInterface { + /** + * Set the value, array, and key. + * + * @param { Array } arr + * @param { function } itemGenerator + * @param { function } keyGenerator + * @returns { ForEachInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value, array, and key. + * + * @param { Array } arr + * @param { function } itemGenerator + * @param { function } keyGenerator + * @returns { ForEachInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the value, array, and key. + * + * @param { Array } arr + * @param { function } itemGenerator + * @param { function } keyGenerator + * @returns { ForEachInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the value, array, and key. + * + * @param { Array } arr + * @param { function } itemGenerator + * @param { function } keyGenerator + * @returns { ForEachInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Set the value, array, and key. + * + * @param { Array } arr + * @param { function } itemGenerator + * @param { function } keyGenerator + * @returns { ForEachAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + ( + arr: Array, + itemGenerator: (item: any, index: number) => void, + keyGenerator?: (item: any, index: number) => string, + ): ForEachAttribute; +} + +/** + * Defines ForEach Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines ForEach Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines ForEach Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines ForEach Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ForEach: ForEachInterface; diff --git a/tests/arkts-sdk/ets/form_component.d.ts b/tests/arkts-sdk/ets/form_component.d.ts new file mode 100644 index 00000000..718d5cfb --- /dev/null +++ b/tests/arkts-sdk/ets/form_component.d.ts @@ -0,0 +1,521 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the FormDimension enum. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare enum FormDimension { + /** + * 1 x 2 cards + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + Dimension_1_2, + + /** + * 2 x 2 cards + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + Dimension_2_2, + + /** + * 2 x 4 cards + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + Dimension_2_4, + + /** + * 4 x 4 cards + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + Dimension_4_4, + + /** + * 2 x 1 cards + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + Dimension_2_1, + + /** + * 1 x 1 cards + * The default value is 6 + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + DIMENSION_1_1 = 6, + + /** + * 6 x 4 cards + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + DIMENSION_6_4, + + /** + * 2 x 3 cards used for wearable devices + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + DIMENSION_2_3 = 8, + + /** + * 3 x 3 cards used for wearable devices + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + DIMENSION_3_3 = 9, +} + +/** + * Defines the FormRenderingMode enum. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ +declare enum FormRenderingMode { + + /** + * Full color mode, this is default value + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + FULL_COLOR, + + /** + * single color mode + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + SINGLE_COLOR, +} + +/** + * Defines the FormShape enum. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare enum FormShape { + /** + * The rect shape. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + RECT = 1, + + /** + * The circle shape. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + CIRCLE, +} + +/** + * Defines the FormInfo. + * + * @interface FormInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare interface FormInfo { + /** + * The id the form. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + id: number | string; + + /** + * The name of the form. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + name: string; + + /** + * The bundle of the form. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + bundle: string; + + /** + * The ability of the form. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + ability: string; + + /** + * The module of the form. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + module: string; + + /** + * The dimension of the form. + * + * @type { ?FormDimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + dimension?: FormDimension; + + /** + * Whether the form is temporary. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + temporary?: boolean; + + /** + * The want of the form. + * + * @type { ?import('../api/@ohos.app.ability.Want').default } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + want?: import('../api/@ohos.app.ability.Want').default; + + /** + * The renderingMode of the form. + * + * @type { ?FormRenderingMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + renderingMode?: FormRenderingMode; + + /** + * The shape of the form. + * + * @type { ?FormShape } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + shape?: FormShape; +} + +/** + * Defines the FormComponent. + * + * @interface FormComponentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +interface FormComponentInterface { + /** + * Set a new value. + * + * @param { { + * id: number; + * name: string; + * bundle: string; + * ability: string; + * module: string; + * dimension?: FormDimension; + * temporary?: boolean; + * want?: import('../api/@ohos.app.ability.Want').default; + * } } value + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Set a new value. + * + * @param { object } value + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + /** + * Set a new value. + * + * @param { object } value + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + /** + * Set a new value of form info. + * + * @param { FormInfo } value + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + (value: FormInfo): FormComponentAttribute; +} + +/** + * Defines the FormCallbackInfo. + * + * @interface FormCallbackInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +interface FormCallbackInfo { + /** + * The id of the form. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + id: number; + + /** + * The string id of the form. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + idString: string; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare class FormComponentAttribute extends CommonMethod { + /** + * Sets the display area size of the card. + * + * @param { object } value + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + size(value: { width: number; height: number }): FormComponentAttribute; + + /** + * Card module name. + * + * @param { string } value + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + moduleName(value: string): FormComponentAttribute; + + /** + * Set the card size. + * + * @param { FormDimension } value + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + dimension(value: FormDimension): FormComponentAttribute; + + /** + * Indicates whether to allow card update. + * + * @param { boolean } value + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + allowUpdate(value: boolean): FormComponentAttribute; + + /** + * Whether the card is visible. + * + * @param { Visibility } value + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + visibility(value: Visibility): FormComponentAttribute; + + /** + * This function is triggered after card information is obtained. + * For details about the form information, see the definition of the original capability subsystem. + * + * @param { function } callback + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * This function is triggered after card information is obtained. + * For details about the form information, see the definition of the original capability subsystem. + * + * @param { Callback } callback + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + onAcquired(callback: Callback): FormComponentAttribute; + + /** + * Card loading error. + * + * @param { function } callback + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + onError(callback: (info: { errcode: number; msg: string }) => void): FormComponentAttribute; + + /** + * Card to be redirected. + * + * @param { function } callback + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + onRouter(callback: (info: any) => void): FormComponentAttribute; + + /** + * Uninstall Card. + * + * @param { function } callback + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Uninstall Card. + * + * @param { Callback } callback + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + onUninstall(callback: Callback): FormComponentAttribute; + + /** + * Card to be loaded. + * + * @param { function } callback + * @returns { FormComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + onLoad(callback: () => void): FormComponentAttribute; +} + +/** + * Defines FormComponent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare const FormComponent: FormComponentInterface; + +/** + * Defines FormComponent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare const FormComponentInstance: FormComponentAttribute; diff --git a/tests/arkts-sdk/ets/form_link.d.ts b/tests/arkts-sdk/ets/form_link.d.ts new file mode 100644 index 00000000..86479323 --- /dev/null +++ b/tests/arkts-sdk/ets/form_link.d.ts @@ -0,0 +1,238 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the FormLink options. + * + * @interface FormLinkOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 +*/ +/** + * Defines the FormLink options. + * + * @interface FormLinkOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 +*/ +declare interface FormLinkOptions { + /** + * Action types: "router" and "message". + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * Action types: "router" and "message". + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + action: string; + + /** + * Module name of destination UIAbility. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * Module name of destination UIAbility. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + moduleName?: string; + + /** + * Bundle name of destination UIAbility. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * Bundle name of destination UIAbility. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + bundleName?: string; + + /** + * Name of destination UIAbility. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * Name of destination UIAbility. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + abilityName?: string; + + /** + * uri of destination UIAbility. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + uri?: string; + + /** + * The additional parameters, use JSON format key value pairs for content. + * + * @type { ?Object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * The additional parameters, use JSON format key value pairs for content. + * + * @type { ?Object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + params?: Object; +} + +/** + * Defines the FormLink interface. + * + * @interface FormLinkInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ +/** + * Defines the FormLink interface. + * + * @interface FormLinkInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ +interface FormLinkInterface { + /** + * Init FormLink component with options. + * + * @param { FormLinkOptions } options + * @returns { FormLinkAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * Init FormLink component with options. + * + * @param { FormLinkOptions } options + * @returns { FormLinkAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + (options: FormLinkOptions): FormLinkAttribute; +} + +/** + * Defines the FormLink attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ +/** + * Defines the FormLink attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ +declare class FormLinkAttribute extends CommonMethod { +} + +/** + * Defines FormLink component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ +/** + * Defines FormLink component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ +declare const FormLink: FormLinkInterface; + +/** + * Defines FormLink component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ +/** + * Defines FormLink component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ +declare const FormLinkInstance: FormLinkAttribute; diff --git a/tests/arkts-sdk/ets/gauge.d.ts b/tests/arkts-sdk/ets/gauge.d.ts new file mode 100644 index 00000000..a0205617 --- /dev/null +++ b/tests/arkts-sdk/ets/gauge.d.ts @@ -0,0 +1,740 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines Gauge constructor options. + * + * @interface GaugeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +interface GaugeOptions { + /** + * Set current data value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set current data value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set current data value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set current data value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + value: number; + + /** + * Set current segment minimum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set current segment minimum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set current segment minimum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set current segment minimum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + min?: number; + + /** + * Set current segment maximum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set current segment maximum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set current segment maximum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set current segment maximum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + max?: number; +} + +/** + * Defines the Gauge component. + * + * @interface GaugeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the Gauge component. + * + * @interface GaugeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Gauge component. + * + * @interface GaugeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Gauge component. + * + * @interface GaugeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface GaugeInterface { + /** + * value:Current data value. + * min: Current Segment Minimum Value + * max: Current Segment Maximum Value + * + * @param { object } options + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * value:Current data value. + * min: Current Segment Minimum Value + * max: Current Segment Maximum Value + * + * @param { object } options + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * value:Current data value. + * min: Current Segment Minimum Value + * max: Current Segment Maximum Value + * + * @param { object } options + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * value:Current data value. + * min: Current Segment Minimum Value + * max: Current Segment Maximum Value + * + * @param { object } options + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the gauge component is used. + * + * @param { GaugeOptions } options - Gauge options. + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options: GaugeOptions): GaugeAttribute; +} + +/** + * Defines the options of gauge track shadow. + * + * @interface GaugeShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the options of gauge track shadow. + * + * @interface GaugeShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GaugeShadowOptions extends MultiShadowOptions {} + +/** + * Defines the options of gauge indicator. + * + * @interface GaugeIndicatorOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the options of gauge indicator. + * + * @interface GaugeIndicatorOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GaugeIndicatorOptions { + + /** + * Current indicator icon path. + * + * @type { ?ResourceStr } option type - the current option type. + * @default system style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Current indicator icon path. + * + * @type { ?ResourceStr } option type - the current option type. + * @default system style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + icon?: ResourceStr; + + /** + * Current indicator space. + * + * @type { ?Dimension } indicator space - the current indicator space. + * @default 8 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Current indicator space. + * + * @type { ?Dimension } indicator space - the current indicator space. + * @default 8 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + space?: Dimension; +} + +/** + * GaugeConfiguration used by content modifier + * + * @interface GaugeConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GaugeConfiguration extends CommonConfiguration { + /** + * Current data value. + * + * @type { number } data value - the current data value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value: number; + + /** + * Current Segment Minimum Value. + * + * @type { number } segment minimum value - the current segment minimum value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + min: number; + + /** + * Current Segment Maximum Value. + * + * @type { number } segment maximum value - the current segment maximum value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + max: number; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class GaugeAttribute extends CommonMethod { + /** + * Sets the value for the current profile. + * + * @param { number } value + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the value for the current profile. + * + * @param { number } value + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the value for the current profile. + * + * @param { number } value + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the value for the current profile. + * + * @param { number } value + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + value(value: number): GaugeAttribute; + + /** + * Set the start angle. Clock 0 is 0 degrees and clockwise is positive. + * + * @param { number } angle + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the start angle. Clock 0 is 0 degrees and clockwise is positive. + * + * @param { number } angle + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the start angle. Clock 0 is 0 degrees and clockwise is positive. + * + * @param { number } angle + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the start angle. Clock 0 is 0 degrees and clockwise is positive. + * + * @param { number } angle + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + startAngle(angle: number): GaugeAttribute; + + /** + * Sets the end angle position. Clock 0 is 0 degrees and clockwise is positive. + * + * @param { number } angle + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the end angle position. Clock 0 is 0 degrees and clockwise is positive. + * + * @param { number } angle + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the end angle position. Clock 0 is 0 degrees and clockwise is positive. + * + * @param { number } angle + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the end angle position. Clock 0 is 0 degrees and clockwise is positive. + * + * @param { number } angle + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + endAngle(angle: number): GaugeAttribute; + + /** + * Set the color of the chart. You can set the solid color and segmented gradient color. + * + * @param { Array } colors + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the color of the chart. You can set the solid color and segmented gradient color. + * + * @param { Array } colors + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the color of the chart. You can set the solid color and segmented gradient color. + * + * @param { Array<[ResourceColor, number]> } colors - section colors of gauge drawing. + * @returns { GaugeAttribute } returns the instance of the GaugeAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the color of the chart. You can set the solid color and segmented gradient color. + * + * @param { ResourceColor | LinearGradient | Array<[ResourceColor | LinearGradient, number]> } colors - section colors of gauge drawing. + * @returns { GaugeAttribute } returns the instance of the GaugeAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + colors(colors: ResourceColor | LinearGradient | Array<[ResourceColor | LinearGradient, number]>): GaugeAttribute; + + /** + * Sets the thickness of the ring chart. + * + * @param { Length } length + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the thickness of the ring chart. + * + * @param { Length } length + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the thickness of the ring chart. + * + * @param { Length } length + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the thickness of the ring chart. + * + * @param { Length } length + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeWidth(length: Length): GaugeAttribute; + + /** + * Sets description content of the ring chart. + * + * @param { CustomBuilder } value - description content builder of the gauge drawing. + * @returns { GaugeAttribute } returns the instance of the GaugeAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets description content of the ring chart. + * + * @param { CustomBuilder } value - description content builder of the gauge drawing. + * @returns { GaugeAttribute } returns the instance of the GaugeAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + description(value: CustomBuilder): GaugeAttribute; + + /** + * Sets track shadow of the ring chart. + * + * @param { GaugeShadowOptions } value - track shadow options of the gauge drawing. + * @returns { GaugeAttribute } returns the instance of the GaugeAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets track shadow of the ring chart. + * + * @param { GaugeShadowOptions } value - track shadow options of the gauge drawing. + * @returns { GaugeAttribute } returns the instance of the GaugeAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + trackShadow(value: GaugeShadowOptions): GaugeAttribute; + + /** + * Sets indicator options of the ring chart. + * + * @param { GaugeIndicatorOptions } value - indicator options of the gauge drawing. + * @returns { GaugeAttribute } returns the instance of the GaugeAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets indicator options of the ring chart. + * + * @param { GaugeIndicatorOptions } value - indicator options of the gauge drawing. + * @returns { GaugeAttribute } returns the instance of the GaugeAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + indicator(value: GaugeIndicatorOptions): GaugeAttribute; + + /** + * Sets if mark to privacy sensitive. + * + * @param { Optional } isPrivacySensitiveMode - indicates if mark to privacy sensitive . + * @returns { GaugeAttribute } returns the instance of the GaugeAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + privacySensitive(isPrivacySensitiveMode: Optional): GaugeAttribute; + + /** + * Set the content modifier of gauge. + * + * @param { ContentModifier } modifier - The content modifier of gauge. + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): GaugeAttribute; +} + +/** + * Defines Gauge Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Gauge Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Gauge Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Gauge Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Gauge: GaugeInterface; + +/** + * Defines Gauge Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Gauge Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Gauge Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Gauge Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const GaugeInstance: GaugeAttribute; + diff --git a/tests/arkts-sdk/ets/gesture.d.ts b/tests/arkts-sdk/ets/gesture.d.ts new file mode 100644 index 00000000..f62fc0d9 --- /dev/null +++ b/tests/arkts-sdk/ets/gesture.d.ts @@ -0,0 +1,4003 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum PanDirection { + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, + + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Horizontal, + + /** + * Sliding left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Left, + + /** + * Sliding right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Right, + + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Vertical, + + /** + * Sliding up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Up, + + /** + * Sliding Down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding Down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding Down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Down, + + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + All, +} + +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SwipeDirection { + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, + + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Horizontal, + + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Vertical, + + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + All, +} + +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum GestureMode { + /** + * Sequential gesture recognition is performed in sequence according to the gesture registration sequence. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sequential gesture recognition is performed in sequence according to the gesture registration sequence. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sequential gesture recognition is performed in sequence according to the gesture registration sequence. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Sequence, + + /** + * Simultaneous recognition. Registration gestures participate in recognition. Everything can be triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Simultaneous recognition. Registration gestures participate in recognition. Everything can be triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Simultaneous recognition. Registration gestures participate in recognition. Everything can be triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Parallel, + + /** + * Mutually exclusive recognition. Only one gesture is successfully recognized. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Mutually exclusive recognition. Only one gesture is successfully recognized. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mutually exclusive recognition. Only one gesture is successfully recognized. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Exclusive, +} + +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Normal, + + /** + * Ignore internal gestures and recognize the current gesture first. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Ignore internal gestures and recognize the current gesture first. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Ignore internal gestures and recognize the current gesture first. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + IgnoreInternal, +} + +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum GestureJudgeResult { + /** + * The system gesture determination is not affected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The system gesture determination is not affected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CONTINUE = 0, + + /** + * The user-defined gesture determination result of the current component is fail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The user-defined gesture determination result of the current component is fail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + REJECT = 1, +} + +/** + * Creating an Object + * + * @namespace GestureControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Creating an Object + * + * @namespace GestureControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare namespace GestureControl { + /** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enum GestureType { + /** + * TapGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * TapGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TAP_GESTURE = 0, + + /** + * LongPressGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * LongPressGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LONG_PRESS_GESTURE = 1, + + /** + * PanGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * PanGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PAN_GESTURE = 2, + + /** + * PinchGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * PinchGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PINCH_GESTURE = 3, + + /** + * SwipeGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * SwipeGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SWIPE_GESTURE = 4, + + /** + * RotationGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * RotationGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ROTATION_GESTURE = 5, + + /** + * Drag. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Drag. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DRAG = 6, + + /** + * Click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CLICK = 7, + } +} + +/** + * The description of gesture information. + * + * @interface GestureInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * The description of gesture information. + * + * @interface GestureInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GestureInfo { + /** + * The tag of gesture. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The tag of gesture. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + tag?: string; + + /** + * The type of gesture. + * + * @type { GestureControl.GestureType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The type of gesture. + * + * @type { GestureControl.GestureType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: GestureControl.GestureType; + + /** + * The flag whether it is a system gesture. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The flag whether it is a system gesture. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isSystemGesture: boolean; +} + +/** + * Type of the finger information. + * + * @interface FingerInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Type of the finger information. + * + * @interface FingerInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Type of the finger information. + * + * @interface FingerInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface FingerInfo { + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + id: number; + + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + globalX: number; + + /** + * The Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + globalY: number; + + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + localX: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + localY: number; + + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + displayX: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + displayY: number; +} + +/** + * Defines the Gesture Type. + * + * @typedef { TapGestureInterface | LongPressGestureInterface | PanGestureInterface | PinchGestureInterface | SwipeGestureInterface | RotationGestureInterface | GestureGroupInterface } PointerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Gesture Type. + * + * @typedef { TapGestureInterface | LongPressGestureInterface | PanGestureInterface | PinchGestureInterface | SwipeGestureInterface | RotationGestureInterface | GestureGroupInterface } PointerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the Gesture Type. + * + * @typedef { TapGestureInterface | LongPressGestureInterface | PanGestureInterface | PinchGestureInterface | SwipeGestureInterface | RotationGestureInterface | GestureGroupInterface } PointerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type GestureType = + TapGestureInterface + | LongPressGestureInterface + | PanGestureInterface + | PinchGestureInterface + | SwipeGestureInterface + | RotationGestureInterface + | GestureGroupInterface; + +/** + * Defines the gesture base event. + * + * @interface BaseGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the gesture base event. + * + * @interface BaseGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface BaseGestureEvent extends BaseEvent { + /** + * All finger information. + * + * @type { FingerInfo[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * All finger information. + * + * @type { FingerInfo[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingerList: FingerInfo[]; +} + +/** + * Defines event info for tap gesture. + * + * @interface TapGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for tap gesture. + * + * @interface TapGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface TapGestureEvent extends BaseGestureEvent { +} + +/** + * Defines event info for long press gesture. + * + * @interface LongPressGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for long press gesture. + * + * @interface LongPressGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface LongPressGestureEvent extends BaseGestureEvent { + /** + * Indicates whether an event is triggered repeatedly. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Indicates whether an event is triggered repeatedly. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + repeat: boolean; +} + +/** + * Defines event info for pan gesture. + * + * @interface PanGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for pan gesture. + * + * @interface PanGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PanGestureEvent extends BaseGestureEvent { + /** + * Gesture event offset X. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gesture event offset X. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offsetX: number; + + /** + * Gesture event offset Y. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gesture event offset Y. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offsetY: number; + + /** + * X-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * X-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + velocityX: number; + + /** + * Y-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Y-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + velocityY: number; + + /** + * velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + velocity: number; +} + +/** + * Defines event info for pinch gesture. + * + * @interface PinchGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for pinch gesture. + * + * @interface PinchGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PinchGestureEvent extends BaseGestureEvent { + /** + * Scaling ratio. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Scaling ratio. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scale: number; + + /** + * X-axis coordinate of the kneading center point. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * X-axis coordinate of the kneading center point. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pinchCenterX: number; + + /** + * Y-axis coordinate of the kneading center point. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Y-axis coordinate of the kneading center point. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pinchCenterY: number; +} + +/** + * Defines event info for rotation gesture. + * + * @interface RotationGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for rotation gesture. + * + * @interface RotationGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface RotationGestureEvent extends BaseGestureEvent { + /** + * Gesture event direction angle. + * The unit is deg. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gesture event direction angle. + * The unit is deg. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + angle: number; +} + +/** + * Defines event info for swipe gesture. + * + * @interface SwipeGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for swipe gesture. + * + * @interface SwipeGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 112 + */ +interface SwipeGestureEvent extends BaseGestureEvent { + /** + * Gesture event direction angle. + * The unit is deg. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gesture event direction angle. + * The unit is deg. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + angle: number; + + /** + * Gesture event slide speed. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gesture event slide speed. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + speed: number; +} + +/** + * Defines event info for gesture. + * + * @interface GestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines event info for gesture. + * + * @interface GestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines event info for gesture. + * + * @interface GestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface GestureEvent extends BaseEvent { + /** + * Indicates whether an event is triggered repeatedly. + * Used in LongPressGesture. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether an event is triggered repeatedly. + * Used in LongPressGesture. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates whether an event is triggered repeatedly. + * Used in LongPressGesture. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + repeat: boolean; + + /** + * All finger information. + * Used in LongPressGesture and TapGesture. + * + * @type { FingerInfo[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * All finger information. + * Used in LongPressGesture and TapGesture. + * + * @type { FingerInfo[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * All finger information. + * Used in LongPressGesture and TapGesture. + * + * @type { FingerInfo[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fingerList: FingerInfo[]; + + /** + * Gesture event offset X. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Gesture event offset X. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Gesture event offset X. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetX: number; + + /** + * Gesture event offset Y. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Gesture event offset Y. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Gesture event offset Y. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetY: number; + + /** + * Gesture event direction angle. + * The unit is deg. + * Used in RotationGesture and SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Gesture event direction angle. + * The unit is deg. + * Used in RotationGesture and SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Gesture event direction angle. + * The unit is deg. + * Used in RotationGesture and SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + angle: number; + + /** + * Gesture event slide speed. + * The unit is vp. + * Used in SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Gesture event slide speed. + * The unit is vp. + * Used in SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Gesture event slide speed. + * The unit is vp. + * Used in SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + speed: number; + + /** + * Scaling ratio. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Scaling ratio. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scaling ratio. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scale: number; + + /** + * X-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * X-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pinchCenterX: number; + + /** + * Y-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Y-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pinchCenterY: number; + + /** + * X-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + velocityX: number; + + /** + * Y-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + velocityY: number; + + /** + * velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + velocity: number; +} + +/** + * Defines Gesture interface. + * + * @interface GestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface GestureInterface { + /** + * Set gesture's tag. + * + * @param { string } tag + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + tag(tag: string): T; + + /** + * Input source type for gesture response. + * + * @param { Array } types - indicate the allowed input source for gesture to response + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + allowedTypes(types: Array): T; +} + +/** + * Defines TapGesture parameters. + * + * @interface TapGestureParameters + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TapGestureParameters { + /** + * Number of consecutive clicks recognized. If the value is less than 1, the default value is used. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + count?: number; + /** + * The hand index that triggers the click. If the value is less than 1, the default value is used. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fingers?: number; + /** + * The limited move distance of click. If the value is less than 0, the default value is used. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + distanceThreshold?: number; +} + +/** + * Defines TapGesture interface. + * + * @interface TapGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TapGesture interface. + * + * @interface TapGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TapGesture interface extends GestureInterface. + * + * @interface TapGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface TapGestureInterface extends GestureInterface { + /** + * 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. + * + * @param { object } value + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @param { object } value + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 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. + * + * @param { object } value + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Set the value. + * TapGestureParameters: The parameters of the tapGesture. + * + * @param { TapGestureParameters } value + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (value?: TapGestureParameters): TapGestureInterface; + + /** + * Tap gesture recognition success callback. + * + * @param { function } event + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Tap gesture recognition success callback. + * + * @param { function } event + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Tap gesture recognition success callback. + * + * @param { function } event + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAction(event: (event: GestureEvent) => void): TapGestureInterface; +} + +/** + * Defines LongPressGesture interface. + * + * @interface LongPressGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines LongPressGesture interface. + * + * @interface LongPressGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines LongPressGesture interface extends GestureInterface. + * + * @interface LongPressGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface LongPressGestureInterface extends GestureInterface { + /** + * Set the value. + * 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. + * + * @param { object } value + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * 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. + * + * @param { object } value + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * 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. + * + * @param { object } value + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { fingers?: number; repeat?: boolean; duration?: number }): LongPressGestureInterface; + + /** + * LongPress gesture recognition success callback. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * LongPress gesture recognition success callback. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * LongPress gesture recognition success callback. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAction(event: (event: GestureEvent) => void): LongPressGestureInterface; + + /** + * The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionEnd(event: (event: GestureEvent) => void): LongPressGestureInterface; + + /** + * The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionCancel(event: () => void): LongPressGestureInterface; +} + +/** + * Defines the PanGesture options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the PanGesture options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the PanGesture options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class PanGestureOptions { + /** + * Constructor parameters. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Constructor parameters. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Constructor parameters. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(value?: { fingers?: number; direction?: PanDirection; distance?: number }); + + /** + * Sets the direction attribute. + * + * @param { PanDirection } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the direction attribute. + * + * @param { PanDirection } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the direction attribute. + * + * @param { PanDirection } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setDirection(value: PanDirection); + + /** + * Sets the setDistance attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the setDistance attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the setDistance attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setDistance(value: number); + + /** + * Sets the setFingers attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the setFingers attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the setFingers attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setFingers(value: number); + + /** + * Get the pan direction attribute. + * + * @returns { PanDirection } - Pan gesture direction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getDirection(): PanDirection; +} + +/** + * Defines the PanGesture interface. + * + * @interface PanGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the PanGesture interface. + * + * @interface PanGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PanGesture interface extends GestureInterface. + * + * @interface PanGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface PanGestureInterface extends GestureInterface { + /** + * Set the value. + * + * @param { { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions } value + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * + * @param { { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions } value + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * + * @param { { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions } value + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions): PanGestureInterface; + + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionStart(event: (event: GestureEvent) => void): PanGestureInterface; + + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionUpdate(event: (event: GestureEvent) => void): PanGestureInterface; + + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionEnd(event: (event: GestureEvent) => void): PanGestureInterface; + + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionCancel(event: () => void): PanGestureInterface; +} + +/** + * Defines the SwipeGesture interface. + * + * @interface SwipeGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the SwipeGesture interface. + * + * @interface SwipeGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines SwipeGesture interface extends GestureInterface. + * + * @interface SwipeGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface SwipeGestureInterface extends GestureInterface { + /** + * Set the value. + * + * @param { object } value + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { fingers?: number; direction?: SwipeDirection; speed?: number }): SwipeGestureInterface; + + /** + * Slide gesture recognition success callback. + * + * @param { function } event + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Slide gesture recognition success callback. + * + * @param { function } event + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Slide gesture recognition success callback. + * + * @param { function } event + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAction(event: (event: GestureEvent) => void): SwipeGestureInterface; +} + +/** + * Defines the PinchGesture interface. + * + * @interface PinchGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the PinchGesture interface. + * + * @interface PinchGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PinchGesture interface extends GestureInterface. + * + * @interface PinchGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface PinchGestureInterface extends GestureInterface { + /** + * Set the value. + * + * @param { object } value + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { fingers?: number; distance?: number }): PinchGestureInterface; + + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionStart(event: (event: GestureEvent) => void): PinchGestureInterface; + + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionUpdate(event: (event: GestureEvent) => void): PinchGestureInterface; + + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionEnd(event: (event: GestureEvent) => void): PinchGestureInterface; + + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionCancel(event: () => void): PinchGestureInterface; +} + +/** + * Defines the RotationGesture interface. + * + * @interface RotationGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the RotationGesture interface. + * + * @interface RotationGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines RotationGesture interface extends GestureInterface. + * + * @interface RotationGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface RotationGestureInterface extends GestureInterface { + /** + * Set the value. + * + * @param { object } value + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { fingers?: number; angle?: number }): RotationGestureInterface; + + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionStart(event: (event: GestureEvent) => void): RotationGestureInterface; + + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionUpdate(event: (event: GestureEvent) => void): RotationGestureInterface; + + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionEnd(event: (event: GestureEvent) => void): RotationGestureInterface; + + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionCancel(event: () => void): RotationGestureInterface; +} + +/** + * Defines the GestureGroup interface. + * + * @interface GestureGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the GestureGroup interface. + * + * @interface GestureGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the GestureGroup interface. + * + * @interface GestureGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface GestureGroupInterface { + /** + * Return to Obtain GestureGroup. + * + * @param { GestureMode } mode + * @param { GestureType[] } gesture + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Return to Obtain GestureGroup. + * + * @param { GestureMode } mode + * @param { GestureType[] } gesture + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Return to Obtain GestureGroup. + * + * @param { GestureMode } mode + * @param { GestureType[] } gesture + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (mode: GestureMode, ...gesture: GestureType[]): GestureGroupInterface; + + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onCancel(event: () => void): GestureGroupInterface; +} + +/** + * Defines TapGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TapGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TapGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TapGesture: TapGestureInterface; + +/** + * Defines LongPressGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines LongPressGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines LongPressGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const LongPressGesture: LongPressGestureInterface; + +/** + * Defines PanGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines PanGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PanGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const PanGesture: PanGestureInterface; + +/** + * Defines SwipeGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines SwipeGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines SwipeGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const SwipeGesture: SwipeGestureInterface; + +/** + * Defines PinchGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines PinchGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PinchGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const PinchGesture: PinchGestureInterface; + +/** + * Defines RotationGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines RotationGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines RotationGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const RotationGesture: RotationGestureInterface; + +/** + * Defines GestureGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines GestureGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines GestureGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const GestureGroup: GestureGroupInterface; + +/** + * Defines the gesture handler. + * + * @implements GestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class GestureHandler implements GestureInterface { + /** + * Set the GestureHandler's tag. + * + * @param { string } tag + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + tag(tag: string): T; + + /** + * Input source type for gesture response. + * + * @param { Array } types - indicate the allowed input source for gesture to response + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + allowedTypes(types: Array): T; +} + +/** + * Defines the TapGestureHandler options. + * + * @interface TapGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface TapGestureHandlerOptions { + /** + * Indicates the number of consecutive clicks recognized. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + count?: number; + /** + * Indicates the hand index that triggers the click. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; +} + +/** + * Defines the TapGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TapGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { TapGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: TapGestureHandlerOptions); + /** + * Tap gesture recognition success callback. + * + * @param { Callback } event + * @returns { TapGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAction(event: Callback): TapGestureHandler; +} + +/** + * Defines the LongPressGestureHandler options. + * + * @interface LongPressGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface LongPressGestureHandlerOptions { + /** + * Indicates the hand index that triggers the long press. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; + /** + * Indicates whether an event is triggered repeatedly. + * The default value is false. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + repeat?: boolean; + /** + * Indicates minimum press and hold time, in milliseconds. + * The default value is 500ms. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + duration?: number; +} + +/** + * Defines the LongPressGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class LongPressGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { LongPressGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: LongPressGestureHandlerOptions); + /** + * LongPress gesture recognition success callback. + * + * @param { Callback } event + * @returns { LongPressGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAction(event: Callback): LongPressGestureHandler; + /** + * The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { Callback } event + * @returns { LongPressGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionEnd(event: Callback): LongPressGestureHandler; + /** + * The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { Callback } event + * @returns { LongPressGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionCancel(event: Callback): LongPressGestureHandler; +} + +/** + * Defines the PanGestureHandler options. + * + * @interface PanGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PanGestureHandlerOptions { + /** + * Indicates the hand index that triggers the pan. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; + /** + * Indicates the move direction of the pan gesture. + * The default value is PanDirection.All. + * + * @type { ?PanDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + direction?: PanDirection; + /** + * Indicates minimum move distance. + * The default value is 5vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + distance?: number; +} + +/** + * Defines the PanGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class PanGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { PanGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: PanGestureHandlerOptions); + /** + * Pan gesture recognition success callback. + * + * @param { Callback } event + * @returns { PanGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionStart(event: Callback): PanGestureHandler; + /** + * Callback when the Pan gesture is moving. + * + * @param { Callback } event + * @returns { PanGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionUpdate(event: Callback): PanGestureHandler; + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { Callback } event + * @returns { PanGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionEnd(event: Callback): PanGestureHandler; + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { Callback } event + * @returns { PanGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionCancel(event: Callback): PanGestureHandler; +} + +/** + * Defines the SwipeGestureHandler options. + * + * @interface SwipeGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface SwipeGestureHandlerOptions { + /** + * Indicates the hand index that triggers the swipe. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; + /** + * Indicates the move direction of the swipe gesture. + * The default value is SwipeDirection.All. + * + * @type { ?SwipeDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + direction?: SwipeDirection; + /** + * Indicates minimum move speed. + * The default value is 100vp/s. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + speed?: number; +} + +/** + * Defines the SwipeGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class SwipeGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { SwipeGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: SwipeGestureHandlerOptions); + /** + * Swipe gesture recognition success callback. + * + * @param { Callback } event + * @returns { SwipeGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAction(event: Callback): SwipeGestureHandler; +} + +/** + * Defines the PinchGestureHandler options. + * + * @interface PinchGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PinchGestureHandlerOptions { + /** + * Indicates the hand index that triggers the pinch. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; + /** + * Indicates minimum pinch move distance. + * The default value is 5vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + distance?: number; +} + +/** + * Defines the PinchGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class PinchGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { PinchGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: PinchGestureHandlerOptions); + /** + * Pinch gesture recognition success callback. + * + * @param { Callback } event + * @returns { PinchGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionStart(event: Callback): PinchGestureHandler; + /** + * Callback when the Pinch gesture is moving. + * + * @param { Callback } event + * @returns { PinchGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionUpdate(event: Callback): PinchGestureHandler; + /** + * The Pinch gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { Callback } event + * @returns { PinchGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionEnd(event: Callback): PinchGestureHandler; + /** + * The Pinch gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { Callback } event + * @returns { PinchGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionCancel(event: Callback): PinchGestureHandler; +} + +/** + * Defines the RotationGestureHandler options. + * + * @interface RotationGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface RotationGestureHandlerOptions { + /** + * Indicates the hand index that triggers the rotation. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; + /** + * Indicates minimum rotate angle. + * The default value is 1deg. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + angle?: number; +} + +/** + * Defines the RotationGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class RotationGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { RotationGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: RotationGestureHandlerOptions); + /** + * Rotation gesture recognition success callback. + * + * @param { Callback } event + * @returns { RotationGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionStart(event: Callback): RotationGestureHandler; + /** + * Callback when the Rotation gesture is moving. + * + * @param { Callback } event + * @returns { RotationGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionUpdate(event: Callback): RotationGestureHandler; + /** + * The Rotation gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { Callback } event + * @returns { RotationGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionEnd(event: Callback): RotationGestureHandler; + /** + * The Rotation gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { Callback } event + * @returns { RotationGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionCancel(event: Callback): RotationGestureHandler; +} + +/** + * Defines the GestureGroupGestureHandler options. + * + * @interface GestureGroupGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface GestureGroupGestureHandlerOptions { + /** + * Indicates the mode of gesture group. + * + * @type { GestureMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + mode: GestureMode; + /** + * Indicates the gestures included in the gesture group. + * + * @type { GestureHandler[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + gestures: GestureHandler[]; +} + +/** + * Defines the GestureGroup handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class GestureGroupHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { GestureGroupGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: GestureGroupGestureHandlerOptions); + /** + * The GestureGroup gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { Callback } event + * @returns { GestureGroupHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onCancel(event: Callback): GestureGroupHandler; +} + +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum GesturePriority { + /** + * The normal gesture priority. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NORMAL = 0, + /** + * The high gesture priority. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PRIORITY = 1, +} + +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum GestureRecognizerState { + /** + * Ready state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + READY = 0, + /** + * Detecting state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DETECTING = 1, + /** + * Pending state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PENDING = 2, + /** + * Blocked state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BLOCKED = 3, + /** + * Successful state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SUCCESSFUL = 4, + /** + * Failed state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FAILED = 5, +} + +/** + * Defines the scrollable target information. + * + * @extends EventTargetInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ScrollableTargetInfo extends EventTargetInfo { + /** + * Returns whether the scrollable component is at begin. + * + * @returns { boolean } - true is at begin, false is not at begin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isBegin(): boolean; + /** + * Returns whether the scrollable component is at end. + * + * @returns { boolean } - true is at end, false is not at end + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isEnd(): boolean; +} + +/** + * Defines the event target information. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class EventTargetInfo { + /** + * Returns the component's inspector id. + * + * @returns { string } - the inspector id of the component + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getId(): string; +} + +/** + * Defines the gesture recognizer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class GestureRecognizer { + /** + * Returns the gesture's tag. + * + * @returns { string } - the gesture's tag + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getTag(): string; + /** + * Returns the gesture's type. + * + * @returns { GestureControl.GestureType } - the gesture's type + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getType(): GestureControl.GestureType; + /** + * Returns whether the gesture recognizer is built in recognizer. + * + * @returns { boolean } - true is built in recognizer, false is not built in recognizer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isBuiltIn(): boolean; + /** + * set the enabled state of the gesture recognizer. + * + * @param { boolean } isEnabled - Indicates the enabled state. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setEnabled(isEnabled: boolean): void; + /** + * Returns whether the gesture recognizer is enabled. + * + * @returns { boolean } - true is enabled, false is not enabled + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isEnabled(): boolean; + /** + * Returns the gesture recognizer's state. + * + * @returns { GestureRecognizerState } - the gesture recognizer's state + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getState(): GestureRecognizerState; + /** + * Returns the event target information of the component. + * + * @returns { EventTargetInfo } - the event target information of the component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getEventTargetInfo(): EventTargetInfo; + /** + * Returns whether the gesture recognizer is valid. + * + * @returns { boolean } - true is valid, false is invalid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + isValid(): boolean; +} + +/** + * Defines the gesture recognizer. + * + * @extends GestureRecognizer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class PanRecognizer extends GestureRecognizer { + /** + * Returns the the pan gesture options of the recognizer. + * + * @returns { PanGestureOptions } - Pan gesture options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getPanGestureOptions(): PanGestureOptions; +} + diff --git a/tests/arkts-sdk/ets/grid.d.ts b/tests/arkts-sdk/ets/grid.d.ts new file mode 100644 index 00000000..96e929ec --- /dev/null +++ b/tests/arkts-sdk/ets/grid.d.ts @@ -0,0 +1,1346 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * The options to help grid layout + * + * @interface GridLayoutOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The options to help grid layout + * + * @interface GridLayoutOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface GridLayoutOptions { + /** + * The size of most grid items, in [rows, columns], generally [1, 1] + * + * @type { [number, number] } regularSize + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The size of most grid items, in [rows, columns], generally [1, 1] + * + * @type { [number, number] } regularSize + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + regularSize: [number, number]; + + /** + * The indexes of grid items with irregular size. + * + * @type { ?number[] } irregularIndexes + * @default number[] no irregular grid item + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The indexes of grid items with irregular size. + * + * @type { ?number[] } irregularIndexes + * @default number[] no irregular grid item + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + irregularIndexes?: number[]; + + /** + * Called to return the size of the irregular grid items with the specified index in [rows, columns]. + * + * @type { ?function } onGetIrregularSizeByIndex, + * all irregular grid items will occupy an entire line if not set + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called to return the size of the irregular grid items with the specified index in [rows, columns]. + * + * @type { ?function } onGetIrregularSizeByIndex, + * all irregular grid items will occupy an entire line if not set + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onGetIrregularSizeByIndex?: (index: number) => [number, number] + + /** + * Called to return the size of the grid items with the specified index in + * [rowStart, columnStart, rowSpan, columnSpan]. + * + * @type { ?function } onGetRectByIndex + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called to return the size of the grid items with the specified index in + * [rowStart, columnStart, rowSpan, columnSpan]. + * + * @type { ?function } onGetRectByIndex + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onGetRectByIndex?: (index: number) => [number, number, number, number] +} + +/** + * Defines the grid interface. + * + * @interface GridInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the grid interface. + * + * @interface GridInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the grid interface. + * + * @interface GridInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface GridInterface { + /** + * Grid is returned when the parameter is transferred. + * + * @param { Scroller } scroller + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Grid is returned when the parameter is transferred. + * + * @param { Scroller } scroller - Controller bound to the grid + * @param { GridLayoutOptions } layoutOptions - The options to help grid layout + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Grid is returned when the parameter is transferred. + * + * @param { Scroller } scroller - Controller bound to the grid + * @param { GridLayoutOptions } layoutOptions - The options to help grid layout + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (scroller?: Scroller, layoutOptions?: GridLayoutOptions): GridAttribute; +} + +/** + * The enum of property layoutDirection + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The enum of property layoutDirection + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The enum of property layoutDirection + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum GridDirection { + /** + * The row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Row, + + /** + * The column direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The column direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The column direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Column, + + /** + * The row reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The row reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The row reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RowReverse, + + /** + * The column reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The column reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The column reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ColumnReverse, +} + +/** + * Declare grid item alignment status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum GridItemAlignment { + + /** + * Use the default alignment of the Grid. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DEFAULT = 0, + + /** + * The height of the tallest grid item in the current line + * will be used as the height for the other items in the same line + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + STRETCH = 1, +} + +/** + * The attribute of scrollbar to compute scrollbar position and height. + * + * @interface ComputedBarAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The attribute of scrollbar to compute scrollbar position and height. + * + * @interface ComputedBarAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ComputedBarAttribute { + /** + * The offset of the grid. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The offset of the grid. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + totalOffset: number; + + /** + * The range of the grid. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The range of the grid. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + totalLength: number; +} + +/** + * Defines the grid attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the grid attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the grid attribute functions. + * + * @extends ScrollableCommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class GridAttribute extends ScrollableCommonMethod { + /** + * This parameter specifies the number of columns in the current grid layout. + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This parameter specifies the number of columns in the current grid layout. + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This parameter specifies the number of columns in the current grid layout. + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + columnsTemplate(value: string): GridAttribute; + + /** + * Lets you set the number of rows in the current grid layout, + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Lets you set the number of rows in the current grid layout, + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Lets you set the number of rows in the current grid layout, + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + rowsTemplate(value: string): GridAttribute; + + /** + * Allows you to set the spacing between columns. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Allows you to set the spacing between columns. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Allows you to set the spacing between columns. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + columnsGap(value: Length): GridAttribute; + + /** + * Lets you set the spacing between rows. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Lets you set the spacing between rows. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Lets you set the spacing between rows. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + rowsGap(value: Length): GridAttribute; + + /** + * This parameter specifies the width of the scroll bar. + * + * @param { number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This parameter specifies the width of the scroll bar. + * + * @param { number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This parameter specifies the width of the scroll bar. + * + * @param { number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarWidth(value: number | string): GridAttribute; + + /** + * Sets the color of the scroll bar. + * + * @param { Color | number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the color of the scroll bar. + * + * @param { Color | number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the color of the scroll bar. + * + * @param { Color | number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarColor(value: Color | number | string): GridAttribute; + + /** + * Lets you set the spacing between rows. + * + * @param { BarState } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Lets you set the spacing between rows. + * + * @param { BarState } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Lets you set the spacing between rows. + * + * @param { BarState } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBar(value: BarState): GridAttribute; + + /** + * Set scrollbar position. + * + * @param { function } event - callback of grid scroll, + * index is the current first displayed item, offset is the grid offset, + * return ComputedBarAttribute to update scrollbar position and height. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set scrollbar position. + * + * @param { function } event - callback of grid scroll, + * index is the current first displayed item, offset is the grid offset, + * return ComputedBarAttribute to update scrollbar position and height. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollBarUpdate(event: (index: number, offset: number) => ComputedBarAttribute): GridAttribute; + + /** + * Called when the first item displayed in the grid changes. + * + * @param { function } event - of grid scroll, + * first is the index of the first item of the grid. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the first or last item displayed in the grid changes. + * + * @param { function } event - of grid scroll, + * first is the index of the first item displayed in the grid, + * last is the index of the last item displayed in the grid. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the first or last item displayed in the grid changes. + * + * @param { function } event - of grid scroll, + * first is the index of the first item displayed in the grid, + * last is the index of the last item displayed in the grid. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollIndex(event: (first: number, last: number) => void): GridAttribute; + + /** + * cached Count + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * cached Count + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * cached Count + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + cachedCount(value: number): GridAttribute; + + /** + * Called to set number of GridItems to be preloaded (cached) in LazyForEach / Repeat. + * @param { number } count - number of GridItems to be preloaded (cached). + * @param { boolean } show - if true, cached items are displayed when clip is disabled. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + cachedCount(count: number, show: boolean): GridAttribute; + + /** + * editMode + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * editMode + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * editMode + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + editMode(value: boolean): GridAttribute; + + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + multiSelectable(value: boolean): GridAttribute; + + /** + * maxCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * maxCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * maxCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxCount(value: number): GridAttribute; + + /** + * minCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * minCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * minCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + minCount(value: number): GridAttribute; + + /** + * cellLength + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * cellLength + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * cellLength + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + cellLength(value: number): GridAttribute; + + /** + * Control GridDirection of the grid. + * + * @param { GridDirection } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Control GridDirection of the grid. + * + * @param { GridDirection } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Control GridDirection of the grid. + * + * @param { GridDirection } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + layoutDirection(value: GridDirection): GridAttribute; + + /** + * Control if the grid supports animation. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Control if the grid supports animation. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Control if the grid supports animation. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + supportAnimation(value: boolean): GridAttribute; + + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragStart(event: (event: ItemDragInfo, itemIndex: number) => (() => any) | void): GridAttribute; + + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragEnter(event: (event: ItemDragInfo) => void): GridAttribute; + + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragMove(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number) => void): GridAttribute; + + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragLeave(event: (event: ItemDragInfo, itemIndex: number) => void): GridAttribute; + + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDrop( + event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void, + ): GridAttribute; + + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value - Scroll effect. For details, see EdgeEffect. + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value + * @param { EdgeEffectOptions } options + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + edgeEffect(value: EdgeEffect, options?: EdgeEffectOptions): GridAttribute; + + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { GridAttribute } the attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { GridAttribute } the attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: NestedScrollOptions): GridAttribute; + + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableScrollInteraction(value: boolean): GridAttribute; + + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { GridAttribute } the attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { GridAttribute } the attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + friction(value: number | Resource): GridAttribute; + + /** + * Set the alignment of grid items. + * + * @param { Optional } alignment - Items alignment + * @returns { GridAttribute } The attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + alignItems(alignment: Optional): GridAttribute; + + /** + * Called When sliding the grid. + * + * @param { function } event - callback of grid scroll, + * scrollOffset is offset per frame scrolling, ScrollState is current sliding state. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called When sliding the grid. + * + * @param { function } event - callback of grid scroll, + * scrollOffset is offset per frame scrolling, ScrollState is current sliding state. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead common.ScrollableCommonMethod#onDidScroll + */ + onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void): GridAttribute; + + /** + * Called when the grid begins to arrive. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the grid begins to arrive. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReachStart(event: () => void): GridAttribute; + + /** + * Called when the grid reaches the end. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the grid reaches the end. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReachEnd(event: () => void): GridAttribute; + + /** + * Called when the slider start. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the slider start. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollStart(event: () => void): GridAttribute; + + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollStop(event: () => void): GridAttribute; + + /** + * Called when scrolling begin each frame. + * + * @param { function } event - callback of grid scroll, + * offset is the amount of sliding that is about to occur, state is current sliding state, + * return number to actual sliding offset. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event - callback of grid scroll, + * offset is the amount of sliding that is about to occur, state is current sliding state, + * return number to actual sliding offset. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollFrameBegin(event: (offset: number, state: ScrollState) => { offsetRemain: number }): GridAttribute; +} + +/** + * Defines Grid Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Grid Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Grid Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Grid: GridInterface; + +/** + * Defines Grid Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Grid Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Grid Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const GridInstance: GridAttribute; diff --git a/tests/arkts-sdk/ets/gridItem.d.ts b/tests/arkts-sdk/ets/gridItem.d.ts new file mode 100644 index 00000000..3f6b51c3 --- /dev/null +++ b/tests/arkts-sdk/ets/gridItem.d.ts @@ -0,0 +1,437 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the grid item style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the grid item style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum GridItemStyle { + /** + * Show none style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Show none style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NONE = 0, + + /** + * Show plain style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Show plain style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PLAIN = 1, +} + +/** + * Defines the grid item options. + * + * @interface GridItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the grid item options. + * + * @interface GridItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GridItemOptions { + /** + * Describes the GridItem style. + * + * @type { ?GridItemStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Describes the GridItem style. + * + * @type { ?GridItemStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: GridItemStyle; +} + +/** + * Mesh container for static fixed-size layout scenarios. + * + * @interface GridItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Mesh container for static fixed-size layout scenarios. + * + * @interface GridItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Mesh container for static fixed-size layout scenarios. + * + * @interface GridItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface GridItemInterface { + /** + * Return to get GridItem. + * + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Return to get GridItem. + * + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Return to get GridItem. + * + * @param { GridItemOptions } value - Defines the grid item options. + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: GridItemOptions): GridItemAttribute; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class GridItemAttribute extends CommonMethod { + /** + * This parameter specifies the start line number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This parameter specifies the start line number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This parameter specifies the start line number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + rowStart(value: number): GridItemAttribute; + + /** + * Specifies the end line number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Specifies the end line number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specifies the end line number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + rowEnd(value: number): GridItemAttribute; + + /** + * This parameter specifies the start column number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This parameter specifies the start column number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This parameter specifies the start column number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + columnStart(value: number): GridItemAttribute; + + /** + * This parameter specifies the end column number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This parameter specifies the end column number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This parameter specifies the end column number of the current element. + * + * @param { number } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + columnEnd(value: number): GridItemAttribute; + + /** + * This parameter specifies whether to recreate the node when the component build is triggered. + * + * @param { boolean } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + forceRebuild(value: boolean): GridItemAttribute; + + /** + * Called when judging whether it is selectable. + * + * @param { boolean } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when judging whether it is selectable. + * + * @param { boolean } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether it is selectable. + * + * @param { boolean } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectable(value: boolean): GridItemAttribute; + + /** + * Called when judging whether it is selected. + * This parameter supports $$ for two-way binding of variables. + * + * @param { boolean } value - if the gridItem is selected. + * @returns { GridItemAttribute } the attribute of the gridItem. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether it is selected. + * This parameter supports $$ for two-way binding of variables. + * + * @param { boolean } value - if the gridItem is selected. + * @returns { GridItemAttribute } the attribute of the gridItem. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selected(value: boolean): GridItemAttribute; + + /** + * Called when the gridItem is selected. + * + * @param { function } event + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the gridItem is selected. + * + * @param { function } event + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the gridItem is selected. + * + * @param { function } event + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onSelect(event: (isSelected: boolean) => void): GridItemAttribute; +} + +/** + * Defines GridItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines GridItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines GridItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const GridItem: GridItemInterface + +/** + * Defines GridItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines GridItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines GridItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const GridItemInstance: GridItemAttribute; diff --git a/tests/arkts-sdk/ets/grid_col.d.ts b/tests/arkts-sdk/ets/grid_col.d.ts new file mode 100644 index 00000000..14740141 --- /dev/null +++ b/tests/arkts-sdk/ets/grid_col.d.ts @@ -0,0 +1,576 @@ +/* + * Copyright (c) 2022-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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the option in number unit of grid-container child component. + * + * @interface GridColColumnOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the option in number unit of grid-container child component. + * + * @interface GridColColumnOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the option in number unit of grid-container child component. + * + * @interface GridColColumnOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface GridColColumnOption { + /** + * Grid Col Column Option xs + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Col Column Option xs + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Col Column Option xs + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + xs?: number, + + /** + * Grid Col Column Option sm + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Col Column Option sm + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Col Column Option sm + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + sm?: number, + + /** + * Grid Col Column Option md + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Col Column Option md + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Col Column Option md + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + md?: number, + + /** + * Grid Col Column Option lg + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Col Column Option lg + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Col Column Option lg + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lg?: number, + + /** + * Grid Col Column Option xl + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Col Column Option xl + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Col Column Option xl + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + xl?: number, + + /** + * Grid Col Column Option xxl + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Col Column Option xxl + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Col Column Option xxl + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + xxl?: number, +} + +/** + * Defines the options of grid-container child component. + * + * @interface GridColOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of grid-container child component. + * + * @interface GridColOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of grid-container child component. + * + * @interface GridColOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface GridColOptions { + /** + * Sets the span of current gird-container item. + * + * @type { ?(number | GridColColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the span of current gird-container item. + * + * @type { ?(number | GridColColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the span of current gird-container item. + * + * @type { ?(number | GridColColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + span?: number | GridColColumnOption; + + /** + * Sets the offset of current gird-container item. + * + * @type { ?(number | GridColColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the offset of current gird-container item. + * + * @type { ?(number | GridColColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the offset of current gird-container item. + * + * @type { ?(number | GridColColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + offset?: number | GridColColumnOption; + + /** + * Sets the order of current gird-container item. + * + * @type { ?(number | GridColColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the order of current gird-container item. + * + * @type { ?(number | GridColColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the order of current gird-container item. + * + * @type { ?(number | GridColColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + order?: number | GridColColumnOption; +} + +/** + * Defines the the new version of grid-container child component. + * + * @interface GridColInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the the new version of grid-container child component. + * + * @interface GridColInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the the new version of grid-container child component. + * + * @interface GridColInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface GridColInterface { + /** + * Defines the constructor of GridContainer. + * + * @param { GridColOptions } option + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the constructor of GridContainer. + * + * @param { GridColOptions } option + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the constructor of GridContainer. + * + * @param { GridColOptions } option + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (option?: GridColOptions): GridColAttribute; +} + +/** + * Defines the GridContainer attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the GridContainer attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the GridContainer attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class GridColAttribute extends CommonMethod { + /** + * Sets the span of current gird-container item. + * + * @param { number | GridColColumnOption } value + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the span of current gird-container item. + * + * @param { number | GridColColumnOption } value + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the span of current gird-container item. + * + * @param { number | GridColColumnOption } value + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + span(value: number | GridColColumnOption): GridColAttribute; + + /** + * Sets the offset of current gird-container item. + * + * @param { number | GridColColumnOption } value + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the offset of current gird-container item. + * + * @param { number | GridColColumnOption } value + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the offset of current gird-container item. + * + * @param { number | GridColColumnOption } value + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + gridColOffset(value: number | GridColColumnOption): GridColAttribute; + + /** + * Sets the order of current gird-container item. + * + * @param { number | GridColColumnOption } value + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the order of current gird-container item. + * + * @param { number | GridColColumnOption } value + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the order of current gird-container item. + * + * @param { number | GridColColumnOption } value + * @returns { GridColAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + order(value: number | GridColColumnOption): GridColAttribute; +} + +/** + * Defines GridCol Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines GridCol Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines GridCol Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const GridCol: GridColInterface + +/** + * Defines GridCol Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines GridCol Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines GridCol Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const GridColInstance: GridColAttribute; diff --git a/tests/arkts-subset/ets/grid_container.d.ts b/tests/arkts-sdk/ets/grid_container.d.ts similarity index 100% rename from tests/arkts-subset/ets/grid_container.d.ts rename to tests/arkts-sdk/ets/grid_container.d.ts diff --git a/tests/arkts-sdk/ets/grid_row.d.ts b/tests/arkts-sdk/ets/grid_row.d.ts new file mode 100644 index 00000000..711a4477 --- /dev/null +++ b/tests/arkts-sdk/ets/grid_row.d.ts @@ -0,0 +1,1103 @@ +/* + * Copyright (c) 2022-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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the option in length unit of grid-row component. + * + * @interface GridRowSizeOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the option in length unit of grid-row component. + * + * @interface GridRowSizeOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the option in length unit of grid-row component. + * + * @interface GridRowSizeOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface GridRowSizeOption { + /** + * Grid Row Size Option xs, select xs gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Size Option xs, select xs gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Size Option xs, select xs gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + xs?: Length, + + /** + * Grid Row Size Option sm, select sm gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Size Option sm, select sm gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Size Option sm, select sm gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + sm?: Length, + + /** + * Grid Row Size Option md, select md gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Size Option md, select md gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Size Option md, select md gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + md?: Length, + + /** + * Grid Row Size Option lg, select lg gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Size Option lg, select lg gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Size Option lg, select lg gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lg?: Length, + + /** + * Grid Row Size Option xl, select xl gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Size Option xl, select xl gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Size Option xl, select xl gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + xl?: Length, + + /** + * Grid Row Size Option xxl, select xxl gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Size Option xxl, select xxl gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Size Option xxl, select xxl gutter size based on gridRow current breakpoint + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + xxl?: Length, +} + +/** + * Defines the option in number unit of grid-container component. + * + * @interface GridRowColumnOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the option in number unit of grid-container component. + * + * @interface GridRowColumnOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the option in number unit of grid-container component. + * + * @interface GridRowColumnOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface GridRowColumnOption { + /** + * Grid Row Column Option xs, select xs column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Column Option xs, select xs column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Column Option xs, select xs column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + xs?: number, + + /** + * Grid Row Column Option sm, select sm column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Column Option sm, select sm column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Column Option sm, select sm column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + sm?: number, + + /** + * Grid Row Column Option md, select md column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Column Option md, select md column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Column Option md, select md column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + md?: number, + + /** + * Grid Row Column Option lg, select lg column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Column Option lg, select lg column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Column Option lg, select lg column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lg?: number, + + /** + * Grid Row Column Option xl, select xl column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Column Option xl, select xl column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Column Option xl, select xl column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + xl?: number, + + /** + * Grid Row Column Option xxl, select xxl column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grid Row Column Option xxl, select xxl column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grid Row Column Option xxl, select xxl column num based on gridRow current breakpoint + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + xxl?: number, +} + +/** + * Defines the gutter of grid-row component. + * + * @interface GutterOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the gutter of grid-row component. + * + * @interface GutterOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the gutter of grid-row component. + * + * @interface GutterOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface GutterOption { + /** + * Define x in GutterOption + * + * @type { ?(Length | GridRowSizeOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define x in GutterOption + * + * @type { ?(Length | GridRowSizeOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Define x in GutterOption + * + * @type { ?(Length | GridRowSizeOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: Length | GridRowSizeOption, + + /** + * Define y in GutterOption + * + * @type { ?(Length | GridRowSizeOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define y in GutterOption + * + * @type { ?(Length | GridRowSizeOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Define y in GutterOption + * + * @type { ?(Length | GridRowSizeOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: Length | GridRowSizeOption +} + +/** + * Defines the breakpoint reference of grid-container component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the breakpoint reference of grid-container component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the breakpoint reference of grid-container component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum BreakpointsReference { + /** + * Respond to breakpoint changes according to window width + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Respond to breakpoint changes according to window width + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Respond to breakpoint changes according to window width + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + WindowSize, + + /** + * Respond to breakpoint changes according to component width + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Respond to breakpoint changes according to component width + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Respond to breakpoint changes according to component width + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + ComponentSize, +} + +/** + * Defines the direction of grid-container component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the direction of grid-container component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the direction of grid-container component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum GridRowDirection { + /** + * The elements in the grid component are arranged in rows + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The elements in the grid component are arranged in rows + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The elements in the grid component are arranged in rows + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Row, + + /** + * The elements in the grid component are arranged in reverse order of rows + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The elements in the grid component are arranged in reverse order of rows + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The elements in the grid component are arranged in reverse order of rows + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + RowReverse, +} + +/** + * Defines the breakpoints of grid-row component. + * + * @interface BreakPoints + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the breakpoints of grid-row component. + * + * @interface BreakPoints + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the breakpoints of grid-row component. + * + * @interface BreakPoints + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface BreakPoints { + /** + * Breakpoint array + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Breakpoint array + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Breakpoint array + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + value?: Array, + + /** + * Set breakpoint reference + * + * @type { ?BreakpointsReference } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set breakpoint reference + * + * @type { ?BreakpointsReference } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set breakpoint reference + * + * @type { ?BreakpointsReference } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + reference?: BreakpointsReference, +} + +/** + * Defines the options of grid-row component. + * + * @interface GridRowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of grid-row component. + * + * @interface GridRowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of grid-row component. + * + * @interface GridRowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface GridRowOptions { + /** + * layout spacing between sub-components + * + * @type { ?(Length | GutterOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * layout spacing between sub-components + * + * @type { ?(Length | GutterOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * layout spacing between sub-components + * + * @type { ?(Length | GutterOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + gutter?: Length | GutterOption; + + /** + * Sets the total number of columns in the current layout. + * + * @type { ?(number | GridRowColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the total number of columns in the current layout. + * + * @type { ?(number | GridRowColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the total number of columns in the current layout. + * + * @type { ?(number | GridRowColumnOption) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + columns?: number | GridRowColumnOption; + + /** + * grid-row layout breakpoints. + * + * @type { ?BreakPoints } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * grid-row layout breakpoints. + * + * @type { ?BreakPoints } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * grid-row layout breakpoints. + * + * @type { ?BreakPoints } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + breakpoints?: BreakPoints; + + /** + * grid-row layout direction. + * + * @type { ?GridRowDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * grid-row layout direction. + * + * @type { ?GridRowDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * grid-row layout direction. + * + * @type { ?GridRowDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + direction?: GridRowDirection; +} + +/** + * Defines the the new version of grid-container component. + * + * @interface GridRowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the the new version of grid-container component. + * + * @interface GridRowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the the new version of grid-container component. + * + * @interface GridRowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface GridRowInterface { + /** + * Defines the constructor of GridRow. + * + * @param { GridRowOptions } option + * @returns { GridRowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the constructor of GridRow. + * + * @param { GridRowOptions } option + * @returns { GridRowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the constructor of GridRow. + * + * @param { GridRowOptions } option + * @returns { GridRowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (option?: GridRowOptions): GridRowAttribute; +} + +/** + * Defines the GridRow attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the GridRow attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the GridRow attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class GridRowAttribute extends CommonMethod { + /** + * Callback triggered when the breakpoint changes, breakpoints value can be xs, sm, md, lg, xl, xxl + * + * @param { function } callback + * @returns { GridRowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Callback triggered when the breakpoint changes, breakpoints value can be xs, sm, md, lg, xl, xxl + * + * @param { function } callback + * @returns { GridRowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Callback triggered when the breakpoint changes, breakpoints value can be xs, sm, md, lg, xl, xxl + * + * @param { function } callback + * @returns { GridRowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onBreakpointChange(callback: (breakpoints: string) => void): GridRowAttribute; + + /** + * Cross axis alignment of each line in GridRow. + * + * @param { ItemAlign } value - element alignment + * @returns { GridRowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Cross axis alignment of each line in GridRow. + * + * @param { ItemAlign } value - element alignment + * @returns { GridRowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignItems(value: ItemAlign): GridRowAttribute; +} + +/** + * Defines GridRow Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines GridRow Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines GridRow Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const GridRow: GridRowInterface; + +/** + * Defines GridRow Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines GridRow Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines GridRow Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const GridRowInstance: GridRowAttribute; diff --git a/tests/arkts-sdk/ets/hyperlink.d.ts b/tests/arkts-sdk/ets/hyperlink.d.ts new file mode 100644 index 00000000..b419b0f2 --- /dev/null +++ b/tests/arkts-sdk/ets/hyperlink.d.ts @@ -0,0 +1,127 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the hyperlink interface. + * + * @interface HyperlinkInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the hyperlink interface. + * + * @interface HyperlinkInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +interface HyperlinkInterface { + /** + * Return to get Hyperlink. + * adress: Web page redirected by the hyperlink component. + * content: Hyperlinks in the hyperlink component display text. + * + * @param { string | Resource } address + * @param { string | Resource } content + * @returns { HyperlinkAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Return to get Hyperlink. + * adress: Web page redirected by the hyperlink component. + * content: Hyperlinks in the hyperlink component display text. + * + * @param { string | Resource } address + * @param { string | Resource } content + * @returns { HyperlinkAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + (address: string | Resource, content?: string | Resource): HyperlinkAttribute; +} + +/** + * Defines the hyperlink attribute functions + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the hyperlink attribute functions + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare class HyperlinkAttribute extends CommonMethod { + /** + * Set Color + * + * @param { Color | number | string | Resource } value + * @returns { HyperlinkAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set Color + * + * @param { Color | number | string | Resource } value + * @returns { HyperlinkAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + color(value: Color | number | string | Resource): HyperlinkAttribute; +} + +/** + * Defines Hyperlink Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Hyperlink Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare const Hyperlink: HyperlinkInterface; + +/** + * Defines Hyperlink Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Hyperlink Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare const HyperlinkInterface: HyperlinkAttribute; diff --git a/tests/arkts-sdk/ets/image.d.ts b/tests/arkts-sdk/ets/image.d.ts new file mode 100644 index 00000000..4f95ee0d --- /dev/null +++ b/tests/arkts-sdk/ets/image.d.ts @@ -0,0 +1,1954 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Use the DrawableDescriptor class to get drawable image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Use the DrawableDescriptor class to get drawable image. + * + * @typedef { import ('../api/@ohos.arkui.drawableDescriptor').DrawableDescriptor } DrawableDescriptor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type DrawableDescriptor = import ('../api/@ohos.arkui.drawableDescriptor').DrawableDescriptor; + +/** + * Import the DrawingColorFilter type object for image color filter setting. + * + * @typedef DrawingColorFilter + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type DrawingColorFilter = import('../api/@ohos.graphics.drawing').default.ColorFilter; + +/** + * Enumerates all the levels available for the image resolution quality. + * + * @typedef {import('../api/@ohos.multimedia.image').default.ResolutionQuality} ResolutionQuality + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare type ResolutionQuality = import('../api/@ohos.multimedia.image').default.ResolutionQuality; + +/** + * Lattice for dividing an image into grids. + * + * @typedef { import('../api/@ohos.graphics.drawing').default.Lattice } Lattice + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type DrawingLattice = import('../api/@ohos.graphics.drawing').default.Lattice; + +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ImageRenderMode { + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Original, + + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Template, +} + +/** + * Specify image's content. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum ImageContent { + /** + * Make image empty. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + EMPTY = 0, +} + +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum DynamicRangeMode { + /** + * Allow image content to use an unrestricted extended range. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + HIGH = 0, + + /** + * Allow image content to use some extended range. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + CONSTRAINT = 1, + + /** + * Restrict the image content dynamic range to the standard range. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + STANDARD = 2, +} + +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ImageInterpolation { + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Low, + + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Medium, + + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + High, +} + +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare enum ImageRotateOrientation { + /** + * Rotate according to the image rotation + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + AUTO = 0, + + /** + * Ignore the rotation of the image + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + UP = 1, + + /** + * Based on image rotation, rotate clockwise 90 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + RIGHT = 2, + + /** + * Based on image rotation, rotate clockwise 180 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + DOWN = 3, + + /** + * Based on image rotation, rotate clockwise 270 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + LEFT = 4, +} + +/** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ImageInterface { + /** + * Set src to obtain images. + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (src: PixelMap | ResourceStr | DrawableDescriptor): ImageAttribute; + + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor | ImageContent } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + (src: PixelMap | ResourceStr | DrawableDescriptor | ImageContent): ImageAttribute; + + /** + * Set src and ai options to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @param { ImageAIOptions } imageAIOptions + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + (src: PixelMap | ResourceStr | DrawableDescriptor, imageAIOptions: ImageAIOptions): ImageAttribute; +} + +/** + * Defines source size of image. + * + * @interface ImageSourceSize + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + +interface ImageSourceSize { + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width: number; + + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height: number; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ImageAttribute extends CommonMethod { + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource | PixelMap } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + alt(value: string | Resource | PixelMap): ImageAttribute; + + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + matchTextDirection(value: boolean): ImageAttribute; + + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fitOriginalSize(value: boolean): ImageAttribute; + + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fillColor(value: ResourceColor): ImageAttribute; + + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + objectFit(value: ImageFit): ImageAttribute; + + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + objectRepeat(value: ImageRepeat): ImageAttribute; + + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + autoResize(value: boolean): ImageAttribute; + + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + renderMode(value: ImageRenderMode): ImageAttribute; + + /** + * Set dynamic range mode of image. + * + * @param { DynamicRangeMode } value - Indicates the resizable options. + * @returns { ImageAttribute } Returns the instance of the ImageAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + dynamicRangeMode(value: DynamicRangeMode): ImageAttribute; + + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + interpolation(value: ImageInterpolation): ImageAttribute; + + /** + * 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. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * 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. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * 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. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * 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. + * + * @param { ImageSourceSize } value - Image source size. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + sourceSize(value: ImageSourceSize): ImageAttribute; + + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + syncLoad(value: boolean): ImageAttribute; + + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter | DrawingColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + colorFilter(value: ColorFilter | DrawingColorFilter): ImageAttribute; + + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + copyOption(value: CopyOptions): ImageAttribute; + + /** + * Enable image dragging. + * Default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Enable image dragging. + * Default value is true. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + draggable(value: boolean): ImageAttribute; + + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { ImageAttribute } The attribute of the image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): ImageAttribute; + + /** + * SVG anti-aliasing. + * The range of the parameter values is (0.333, 1.333]. + * Default value is 0.0. + * + * @param { number } value - The degree of anti-aliasing. + * @returns { ImageAttribute } The attribute of the image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + edgeAntialiasing(value: number): ImageAttribute; + + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onComplete( + callback: (event?: { + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + width: number; + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + height: number; + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + componentWidth: number; + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + componentHeight: number; + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + loadingStatus: number; + /** + * The width of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The width of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentWidth: number; + /** + * The height of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The height of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentHeight: number; + /** + * The actual draw is offset from the x-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The actual draw is offset from the x-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentOffsetX: number; + /** + * The actual draw is offset from the y-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The actual draw is offset from the y-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentOffsetY: number; + }) => void, + ): ImageAttribute; + + /** + * This callback is triggered when an exception occurs during image loading. + * The field of "message" carries the detailed information of failed image loading. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * This callback is triggered when an exception occurs during image loading. + * The field of "message" carries the detailed information of failed image loading. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * This callback is triggered when an exception occurs during image loading. + * The field of "message" carries the detailed information of failed image loading. + * + * @param { ImageErrorCallback } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onError(callback: ImageErrorCallback): ImageAttribute; + + /** + * 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. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * 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. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * 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. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onFinish(event: () => void): ImageAttribute; + + /** + * Enable image analyzer. + * + * @param { boolean} enable + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Enable image analyzer. + * + * @param { boolean} enable + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableAnalyzer(enable: boolean): ImageAttribute; + + /** + * Set image analyzer with config. + * + * @param { ImageAnalyzerConfig } config + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + analyzerConfig(config: ImageAnalyzerConfig): ImageAttribute; + + /** + * Set image resizable options. + * + * @param { ResizableOptions } value - Indicates the resizable options. + * @returns { ImageAttribute } Returns the instance of the ImageAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set image resizable options. + * + * @param { ResizableOptions } value - Indicates the resizable options. + * @returns { ImageAttribute } Returns the instance of the ImageAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + resizable(value: ResizableOptions): ImageAttribute; + + /** + * Whether to support sensitive privacy information + * + * @param { boolean } supported - Whether to support sensitive privacy information. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 12 + */ + privacySensitive(supported: boolean): ImageAttribute; + + /** + * Set the quality enhancement level of image. + * + * @param { ResolutionQuality } imageQuality + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + enhancedImageQuality(imageQuality: ResolutionQuality): ImageAttribute; + + /** + * Set the rotation angle of image. + * + * @param { ImageRotateOrientation } orientation + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + orientation(orientation: ImageRotateOrientation) : ImageAttribute; +} + +/** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Image: ImageInterface; + +/** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ImageInstance: ImageAttribute; + +/** + * @type ImageErrorCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @type ImageErrorCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @typedef { function } ImageErrorCallback + * @param { ImageError } error + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +type ImageErrorCallback = (error: ImageError) => void; + +/** + * @interface ImageError + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @interface ImageError + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @interface ImageError + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ImageError { + /** + * Component width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Component width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Component width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + componentWidth: number; + + /** + * Component height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Component height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Component height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + componentHeight: number; + + /** + * Message. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Message. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + message: string +} + +/** + * Image resizable options + * + * @interface ResizableOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Image resizable options + * + * @interface ResizableOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ResizableOptions { + /** + * Image slice widths. + * + * @type { ?EdgeWidths } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Image slice widths. + * + * @type { ?EdgeWidths } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + slice?: EdgeWidths; + + /** + * Image lattice. + * + * @type { ?DrawingLattice } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lattice?: DrawingLattice; +} diff --git a/tests/arkts-sdk/ets/image_animator.d.ts b/tests/arkts-sdk/ets/image_animator.d.ts new file mode 100644 index 00000000..f3b3db54 --- /dev/null +++ b/tests/arkts-sdk/ets/image_animator.d.ts @@ -0,0 +1,738 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the ImageAnimator Interface. + * + * @interface ImageAnimatorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the ImageAnimator Interface. + * + * @interface ImageAnimatorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the ImageAnimator Interface. + * + * @interface ImageAnimatorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ImageAnimatorInterface { + /** + * ImageAnimator is returned. + * + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * ImageAnimator is returned. + * + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * ImageAnimator is returned. + * + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (): ImageAnimatorAttribute; +} + +/** + * Defines the ImageFrameInfo Interface. + * + * @interface ImageFrameInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the ImageFrameInfo Interface. + * + * @interface ImageFrameInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the ImageFrameInfo Interface. + * + * @interface ImageFrameInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ImageFrameInfo { + /** + * Image path + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Image path + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Image path + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Image path + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Image path + * + * @type { string | Resource | PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + src: string | Resource | PixelMap; + /** + * Image width + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Image width + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Image width + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: number | string; + /** + * Image height + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Image height + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Image height + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: number | string; + /** + * Vertical coordinate of the image relative to the upper left corner of the component + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical coordinate of the image relative to the upper left corner of the component + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Vertical coordinate of the image relative to the upper left corner of the component + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + top?: number | string; + /** + * Horizontal coordinate of the image relative to the upper left corner of the component + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Horizontal coordinate of the image relative to the upper left corner of the component + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Horizontal coordinate of the image relative to the upper left corner of the component + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + left?: number | string; + /** + * Playback duration of this image frame, in milliseconds. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Playback duration of this image frame, in milliseconds. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Playback duration of this image frame, in milliseconds. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + duration?: number; +} + +/** + * inheritance CommonMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * inheritance CommonMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * inheritance CommonMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ImageAnimatorAttribute extends CommonMethod { + /** + * list images + * + * @param { Array } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * list images + * + * @param { Array } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * list images + * + * @param { Array } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + images(value: Array): ImageAnimatorAttribute; + + /** + * The default value is the initial state, which is used to control the playback status. + * + * @param { AnimationStatus } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The default value is the initial state, which is used to control the playback status. + * + * @param { AnimationStatus } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The default value is the initial state, which is used to control the playback status. + * + * @param { AnimationStatus } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + state(value: AnimationStatus): ImageAnimatorAttribute; + + /** + * The unit is millisecond. + * + * @param { number } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The unit is millisecond. + * + * @param { number } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The unit is millisecond. + * + * @param { number } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + duration(value: number): ImageAnimatorAttribute; + + /** + * Set the playback sequence. + * + * @param { boolean } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the playback sequence. + * + * @param { boolean } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the playback sequence. + * + * @param { boolean } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + reverse(value: boolean): ImageAnimatorAttribute; + + /** + * Sets whether the image size is fixed to the component size. + * + * @param { boolean } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets whether the image size is fixed to the component size. + * + * @param { boolean } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets whether the image size is fixed to the component size. + * + * @param { boolean } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fixedSize(value: boolean): ImageAnimatorAttribute; + + /** + * Indicates whether to enable pre-decoding. + * + * @param { number } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + preDecode(value: number): ImageAnimatorAttribute; + + /** + * Sets the state before and after the animation starts + * + * @param { FillMode } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the state before and after the animation starts + * + * @param { FillMode } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the state before and after the animation starts + * + * @param { FillMode } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fillMode(value: FillMode): ImageAnimatorAttribute; + + /** + * Played once by default + * + * @param { number } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Played once by default + * + * @param { number } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Played once by default + * + * @param { number } value + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + iterations(value: number): ImageAnimatorAttribute; + + /** + * Status callback, which is triggered when the animation starts to play. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Status callback, which is triggered when the animation starts to play. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Status callback, which is triggered when the animation starts to play. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onStart(event: () => void): ImageAnimatorAttribute; + + /** + * Status callback, which is triggered when the animation pauses. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Status callback, which is triggered when the animation pauses. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Status callback, which is triggered when the animation pauses. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onPause(event: () => void): ImageAnimatorAttribute; + + /** + * Status callback, triggered when the animation is replayed + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Status callback, triggered when the animation is replayed + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Status callback, triggered when the animation is replayed + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onRepeat(event: () => void): ImageAnimatorAttribute; + + /** + * Status callback, which is triggered when the animation is canceled. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Status callback, which is triggered when the animation is canceled. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Status callback, which is triggered when the animation is canceled. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onCancel(event: () => void): ImageAnimatorAttribute; + + /** + * Status callback, which is triggered when the animation playback is complete. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Status callback, which is triggered when the animation playback is complete. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Status callback, which is triggered when the animation playback is complete. + * + * @param { function } event + * @returns { ImageAnimatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onFinish(event: () => void): ImageAnimatorAttribute; +} + +/** + * Defines ImageAnimator Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines ImageAnimator Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines ImageAnimator Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ImageAnimator: ImageAnimatorInterface; + +/** + * Defines ImageAnimator Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines ImageAnimator Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines ImageAnimator Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ImageAnimatorInstance: ImageAnimatorAttribute; diff --git a/tests/arkts-sdk/ets/image_common.d.ts b/tests/arkts-sdk/ets/image_common.d.ts new file mode 100644 index 00000000..ad4c5d95 --- /dev/null +++ b/tests/arkts-sdk/ets/image_common.d.ts @@ -0,0 +1,134 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the image analyze type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum ImageAnalyzerType { + /** + * Image analyze type subject. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + SUBJECT = 0, + + /** + * Image analyze type text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + TEXT, + + /** + * Image analyze type object lookup. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + OBJECT_LOOKUP, +} + +/** + * Image analyzer controller. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare class ImageAnalyzerController { + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + constructor(); + + /** + * Get image analyzer support types. + * + * @returns { ImageAnalyzerType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + getImageAnalyzerSupportTypes(): ImageAnalyzerType[]; +} + +/** + * Image analyzer config. + * + * @interface ImageAnalyzerConfig + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface ImageAnalyzerConfig { + /** + * Image analyze types. + * + * @type { ImageAnalyzerType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + types: ImageAnalyzerType[]; +} + +/** + * Image ai options. + * + * @interface ImageAIOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface ImageAIOptions { + /** + * Image analyze types. + * + * @type { ?ImageAnalyzerType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + types?: ImageAnalyzerType[]; + + /** + * Image analyze types. + * + * @type { ?ImageAnalyzerController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + aiController?: ImageAnalyzerController; +} \ No newline at end of file diff --git a/tests/arkts-sdk/ets/image_span.d.ts b/tests/arkts-sdk/ets/image_span.d.ts new file mode 100644 index 00000000..40109b35 --- /dev/null +++ b/tests/arkts-sdk/ets/image_span.d.ts @@ -0,0 +1,319 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provide image decoration in the text component. + * + * @interface ImageSpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provide image decoration in the text component. + * + * @interface ImageSpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface ImageSpanInterface { + /** + * Called when image is entered in span. + * + * @param { ResourceStr | PixelMap } value - The image resource. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when image is entered in span. + * + * @param { ResourceStr | PixelMap } value - The image resource. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value: ResourceStr | PixelMap): ImageSpanAttribute; +} + +/** + * Define the ImageSpan attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define the ImageSpan attribute functions. + * + * @extends BaseSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class ImageSpanAttribute extends BaseSpan { + /** + * Called when the alignment of image span is set. + * + * @param { ImageSpanAlignment } value - The alignment type of image span. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the alignment of image span is set. + * + * @param { ImageSpanAlignment } value - The alignment type of image span. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + verticalAlign(value: ImageSpanAlignment): ImageSpanAttribute; + + /** + * Sets the color filter effect on the image span. + * + * @param { ColorFilter | DrawingColorFilter } filter ColorFilter object. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + colorFilter(filter: ColorFilter | DrawingColorFilter): ImageSpanAttribute; + + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value - Image display mode. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value - Image display mode. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + objectFit(value: ImageFit): ImageSpanAttribute; + + /** + * Sets a callback which is triggered when the image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { ImageCompleteCallback } callback - Triggered when the image is successfully loaded. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onComplete(callback: ImageCompleteCallback): ImageSpanAttribute; + + /** + * Sets a callback which is triggered when an exception occurs during image loading. + * The field of "message" returned in the callback carries the detailed information of failed image loading. + * + * @param { ImageErrorCallback } callback - Triggered when an exception occurs during image loading. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onError(callback: ImageErrorCallback): ImageSpanAttribute; + + /** + * Placeholder displayed on load + * + * @param { PixelMap } value + * @returns { ImageSpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + alt(value: PixelMap): ImageSpanAttribute; +} + +/** + * Defines ImageSpan Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines ImageSpan Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const ImageSpan: ImageSpanInterface; + +/** + * Defines ImageSpan Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines ImageSpan Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const ImageSpanInstance: ImageSpanAttribute; + +/** + * Callback function triggered when the image is successfully loaded. + * + * @typedef { function } ImageCompleteCallback + * @param { ImageLoadResult } result - the information about the successfully loaded image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +type ImageCompleteCallback = (result: ImageLoadResult) => void; + +/** + * The information about the successfully loaded image. + * + * @interface ImageLoadResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ImageLoadResult { + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width: number; + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + height: number; + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + componentWidth: number; + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + componentHeight: number; + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + loadingStatus: number; + /** + * The width of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentWidth: number; + /** + * The height of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentHeight: number; + /** + * The offset between image content and image component on the X-axis. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentOffsetX: number; + /** + * The offset between image content and image component on the Y-axis. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentOffsetY: number; +} diff --git a/tests/arkts-sdk/ets/index-full.d.ts b/tests/arkts-sdk/ets/index-full.d.ts new file mode 100644 index 00000000..e658a44c --- /dev/null +++ b/tests/arkts-sdk/ets/index-full.d.ts @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2021-2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// \ No newline at end of file diff --git a/tests/arkts-sdk/ets/indicatorcomponent.d.ts b/tests/arkts-sdk/ets/indicatorcomponent.d.ts new file mode 100644 index 00000000..7f91999b --- /dev/null +++ b/tests/arkts-sdk/ets/indicatorcomponent.d.ts @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides methods for switching components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +declare class IndicatorComponentController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + constructor(); + + /** + * Called when the next child component is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + showNext():void; + + /** + * Called when the previous subcomponent is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + showPrevious():void; + + /** + * Controlling IndicatorComponent to change to the specified subcomponent. + * + * @param { number } index - The index of item to be redirected. + * @param { boolean } [useAnimation] - If true, swipe to index item with animation. If false, swipe to index item without animation. + * The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + changeIndex(index: number, useAnimation?: boolean):void; +} + +/** + * Provides an interface for indicator. + * + * @interface IndicatorComponentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +interface IndicatorComponentInterface { + + /** + * Called when a indicator is set. + * + * @param { IndicatorComponentController } controller - indicator component controller. + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + (controller?: IndicatorComponentController): IndicatorComponentAttribute; +} + +/** + * Defines the IndicatorComponent attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +declare class IndicatorComponentAttribute extends CommonMethod { + /** + * Called when the index value of the displayed subcomponent is set in the container. + * + * @param { number } index + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + initialIndex(index: number): IndicatorComponentAttribute; + + /** + * Sets the total number of indicator. + * + * @param { number } totalCount + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + count(totalCount: number): IndicatorComponentAttribute; + + /** + * Sets the indicator style. + * + * @param { DotIndicator | DigitIndicator } indicatorStyle - the style value + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + style(indicatorStyle: DotIndicator | DigitIndicator): IndicatorComponentAttribute; + + /** + * Called when setting whether to turn on cyclic sliding. + * + * @param { boolean } isLoop + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + loop(isLoop: boolean): IndicatorComponentAttribute; + + /** + * Called when setting whether to slide vertically. + * + * @param { boolean } isVertical + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + vertical(isVertical: boolean): IndicatorComponentAttribute; + + /** + * Called when the index value changes. + * + * @param { Callback } event + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + onChange(event: Callback): IndicatorComponentAttribute; +} + +/** + * Defines IndicatorComponent. + * + * @constant + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +declare const IndicatorComponent: IndicatorComponentInterface; + +/** + * Defines IndicatorComponent instance. + * + * @constant + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +declare const IndicatorComponentInstance: IndicatorComponentAttribute; diff --git a/tests/arkts-sdk/ets/inspector.d.ts b/tests/arkts-sdk/ets/inspector.d.ts new file mode 100644 index 00000000..aa2ba50e --- /dev/null +++ b/tests/arkts-sdk/ets/inspector.d.ts @@ -0,0 +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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Get inspector node infos. + * + * @returns { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + * @deprecated since 9 + * @useinstead getInspectorTree + */ +declare function getInspectorNodes(): object; + +/** + * Get inspector node info by node id. + * + * @param { number } id + * @returns { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + * @deprecated since 9 + * @useinstead getInspectorByKey + */ +declare function getInspectorNodeById(id: number): object; + +/** + * Profiler tools for inspectors. + * + * @namespace Profiler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 8 + * @test + */ +declare namespace Profiler { + /** + * Registers vsync callback for profiler. + * + * @param { function } callback - the callback info is json string with ui update info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 8 + * @test + */ + function registerVsyncCallback(callback: (info: string) => void): void; + + /** + * Unregisters vsync callback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 8 + * @test + */ + function unregisterVsyncCallback(): void; +} + +/** + * Set app background color. + * + * @param { string } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 8 + * @test + */ +declare function setAppBgColor(value: string): void; diff --git a/tests/arkts-sdk/ets/isolated_component.d.ts b/tests/arkts-sdk/ets/isolated_component.d.ts new file mode 100644 index 00000000..b32ad143 --- /dev/null +++ b/tests/arkts-sdk/ets/isolated_component.d.ts @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file Defines the isolated component + * @kit ArkUI + */ + +/** + * Indicates restricted worker for run abc. + * + * @typedef { import('../api/@ohos.worker').default.RestrictedWorker } RestrictedWorker + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare type RestrictedWorker = import('../api/@ohos.worker').default.RestrictedWorker; + +/** + * Indicates error callback. + * + * @typedef { import('../api/@ohos.base').ErrorCallback } ErrorCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare type ErrorCallback = import('../api/@ohos.base').ErrorCallback; + +/** + * Indicates want. + * + * @typedef { import('../api/@ohos.app.ability.Want').default } Want + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare type Want = import('../api/@ohos.app.ability.Want').default; + +/** + * This interface is used to set the options for IsolatedComponentAttribute during construction + * + * @interface IsolatedOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare interface IsolatedOptions { + /** + * Indicates want of the IsolatedOptions. + * @type { Want } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + want: Want; + /** + * Indicates restricted worker for run abc. + * @type { RestrictedWorker } worker - worker which run abc + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + worker: RestrictedWorker; +} + +/** + * Provide an interface for the IsolatedComponent, which is used to render UI of other ABC + * + * @typedef { function } IsolatedComponentInterface + * @param { IsolatedOptions } options - Construction configuration of IsolatedComponentAttribute + * @returns { IsolatedComponentAttribute } Attribute of IsolatedComponent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare type IsolatedComponentInterface = (options: IsolatedOptions) => IsolatedComponentAttribute; + +/** + * Define the attribute functions of IsolatedComponent. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare class IsolatedComponentAttribute extends CommonMethod { + /** + * @param { ErrorCallback } callback + * - called when some error occurred except disconnected from IsolatedAbility. + * @returns { IsolatedComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + onError( + callback: ErrorCallback + ): IsolatedComponentAttribute; +} + +/** + * Defines IsolatedComponent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare const IsolatedComponent: IsolatedComponentInterface; + +/** + * Defines IsolatedComponent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare const IsolatedComponentInstance: IsolatedComponentAttribute; diff --git a/tests/arkts-sdk/ets/lazy_for_each.d.ts b/tests/arkts-sdk/ets/lazy_for_each.d.ts new file mode 100644 index 00000000..eb884c41 --- /dev/null +++ b/tests/arkts-sdk/ets/lazy_for_each.d.ts @@ -0,0 +1,911 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines type to operation data source. + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum DataOperationType { + /** + * Add data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ADD = 'add', + + /** + * Delete data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DELETE = 'delete', + + /** + * Exchange data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + EXCHANGE = 'exchange', + + /** + * Move data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + MOVE = 'move', + + /** + * Change data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CHANGE = 'change', + + /** + * Reload data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + RELOAD = 'reload' +} + +/** + * Defines add operation. + * + * @interface DataAddOperation + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface DataAddOperation { + /** + * How to operate added data. + * + * @type { DataOperationType.ADD } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: DataOperationType.ADD, + + /** + * Index of added data. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: number, + + /** + * Count of added data in one operation + * Only validate for ADD and DELETE. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + count?: number, + + /** + * Key of added data. + * + * @type { ?(string | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + key?: string | Array +} + +/** + * Defines delete operation. + * + * @interface DataDeleteOperation + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface DataDeleteOperation { + /** + * How to operate deleted data. + * + * @type { DataOperationType.DELETE } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: DataOperationType.DELETE, + + /** + * Index of deleted data. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: number, + + /** + * Count of deleted data in one operation + * Only validate for ADD and DELETE. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + count?: number +} + +/** + * Defines change operation. + * + * @interface DataChangeOperation + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface DataChangeOperation { + /** + * How to operate changed data. + * + * @type { DataOperationType.CHANGE } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: DataOperationType.CHANGE, + + /** + * Index of changed data. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: number, + + /** + * Key of changed data. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + key?: string +} + +/** + * Defines position of moved data. + * + * @interface MoveIndex + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface MoveIndex { + /** + * Index of moved data. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + from: number; + /** + * Destination of moved data. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + to: number; +} + +/** + * Defines position of exchange data. + * + * @interface ExchangeIndex + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface ExchangeIndex { + /** + * Index of the first exchange data. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start: number; + /** + * Index of the second exchange data. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + end: number; +} + +/** + * Defines new key of exchange data. + * + * @interface ExchangeKey + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface ExchangeKey { + /** + * Key of the first exchange data. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start: string; + /** + * Key of the second exchange data. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + end: string; +} + +/** + * Defines move&exchange operation. + * + * @interface DataMoveOperation + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface DataMoveOperation { + /** + * How to operate moved data. + * + * @type { DataOperationType.MOVE } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: DataOperationType.MOVE, + + /** + * Index of moved data. + * + * @type { MoveIndex } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: MoveIndex, + + /** + * Key of moved data. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + key?: string +} + +/** + * Defines exchange operation. + * + * @interface DataExchangeOperation + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + interface DataExchangeOperation { + /** + * How to operate exchange data. + * + * @type { DataOperationType.EXCHANGE } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: DataOperationType.EXCHANGE, + + /** + * Index of exchange data. + * + * @type { ExchangeIndex } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: ExchangeIndex, + + /** + * Key of exchange data. + * + * @type { ?ExchangeKey } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + key?: ExchangeKey +} + +/** + * Defines reload operation. + * + * @interface DataReloadOperation + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface DataReloadOperation { + /** + * How to operate reload data. + * + * @type { DataOperationType.RELOAD } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: DataOperationType.RELOAD +} + +/** + * All data operation type + * + * @typedef { DataAddOperation | DataDeleteOperation | DataChangeOperation |DataMoveOperation | DataExchangeOperation | DataReloadOperation } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type DataOperation = + DataAddOperation | DataDeleteOperation | DataChangeOperation | DataMoveOperation | DataExchangeOperation | DataReloadOperation + +/** + * Data Change Listener. + * + * @interface DataChangeListener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Data Change Listener. + * + * @interface DataChangeListener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Data Change Listener. + * + * @interface DataChangeListener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface DataChangeListener { + /** + * Data ready. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Data ready. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Data ready. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onDataReloaded(): void; + + /** + * Data added. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 8 + * @useinstead onDataAdd + */ + onDataAdded(index: number): void; + + /** + * Data added. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Data added. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Data added. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onDataAdd(index: number): void; + + /** + * Data moved. + * + * @param { number } from + * @param { number } to + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 8 + * @useinstead onDataMove + */ + onDataMoved(from: number, to: number): void; + + /** + * Data moved. + * + * @param { number } from + * @param { number } to + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Data moved. + * + * @param { number } from + * @param { number } to + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Data moved. + * + * @param { number } from + * @param { number } to + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onDataMove(from: number, to: number): void; + + /** + * Data deleted. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 8 + * @useinstead onDataDelete + */ + onDataDeleted(index: number): void; + + /** + * Data deleted. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Data deleted. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Data deleted. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onDataDelete(index: number): void; + + /** + * Call when has data change. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 8 + * @useinstead onDataChange + */ + onDataChanged(index: number): void; + + /** + * Call when has data change. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Call when has data change. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Call when has data change. + * + * @param { number } index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onDataChange(index: number): void; + + /** + * Call when multiple data change. + * + * @param { DataOperation[] } dataOperations + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDatasetChange(dataOperations: DataOperation[]): void; +} + +/** + * Developers need to implement this interface to provide data to LazyForEach component. + * + * @interface IDataSource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Developers need to implement this interface to provide data to LazyForEach component. + * + * @interface IDataSource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Developers need to implement this interface to provide data to LazyForEach component. + * + * @interface IDataSource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface IDataSource { + /** + * Total data count. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Total data count. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Total data count. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + totalCount(): number; + + /** + * Return the data of index. + * + * @param { number } index + * @returns { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Return the data of index. + * + * @param { number } index + * @returns { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Return the data of index. + * + * @param { number } index + * @returns { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getData(index: number): any; + + /** + * Register data change listener. + * + * @param { DataChangeListener } listener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Register data change listener. + * + * @param { DataChangeListener } listener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Register data change listener. + * + * @param { DataChangeListener } listener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + registerDataChangeListener(listener: DataChangeListener): void; + + /** + * Unregister data change listener. + * + * @param { DataChangeListener } listener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Unregister data change listener. + * + * @param { DataChangeListener } listener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Unregister data change listener. + * + * @param { DataChangeListener } listener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + unregisterDataChangeListener(listener: DataChangeListener): void; +} + +/** + * declare ForEachAttribute + * + * @extends DynamicNode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class LazyForEachAttribute extends DynamicNode { +} +/** + * Lazy loading. + * + * @interface LazyForEachInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Lazy loading. + * + * @interface LazyForEachInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Lazy loading. + * + * @interface LazyForEachInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface LazyForEachInterface { + /** + * Enter the value to obtain the LazyForEach. + * + * @param { IDataSource } dataSource + * @param { function } itemGenerator + * @param { function } keyGenerator + * @returns { LazyForEachInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Enter the value to obtain the LazyForEach. + * + * @param { IDataSource } dataSource + * @param { function } itemGenerator + * @param { function } keyGenerator + * @returns { LazyForEachInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Enter the value to obtain the LazyForEach. + * + * @param { IDataSource } dataSource + * @param { function } itemGenerator + * @param { function } keyGenerator + * @returns { LazyForEachInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Enter the value to obtain the LazyForEach. + * + * @param { IDataSource } dataSource + * @param { function } itemGenerator + * @param { function } keyGenerator + * @returns { LazyForEachAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ( + dataSource: IDataSource, + itemGenerator: (item: any, index: number) => void, + keyGenerator?: (item: any, index: number) => string, + ): LazyForEachAttribute; +} + +/** + * Defines LazyForEach Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines LazyForEach Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines LazyForEach Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const LazyForEach: LazyForEachInterface; diff --git a/tests/arkts-sdk/ets/line.d.ts b/tests/arkts-sdk/ets/line.d.ts new file mode 100644 index 00000000..9a0f5005 --- /dev/null +++ b/tests/arkts-sdk/ets/line.d.ts @@ -0,0 +1,437 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines Line constructor options. + * + * @interface LineOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +interface LineOptions { + /** + * Width of the rectangle where the line resides. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Width of the rectangle where the line resides. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Width of the rectangle where the line resides. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Width of the rectangle where the line resides. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: string | number; + + /** + * Height of the rectangle where the line resides. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Height of the rectangle where the line resides. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Height of the rectangle where the line resides. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Height of the rectangle where the line resides. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: string | number; +} + +/** + * Line drawing component. + * + * @interface LineInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Line drawing component. + * + * @interface LineInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Line drawing component. + * + * @interface LineInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Line drawing component. + * + * @interface LineInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface LineInterface { + /** + * Uses new to create the line. + * width: Width of the rectangle where the line resides.. + * height: Height of the rectangle where the line resides. + * + * @param { object } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Uses new to create the line. + * width: Width of the rectangle where the line resides.. + * height: Height of the rectangle where the line resides. + * + * @param { object } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Uses new to create the line. + * width: Width of the rectangle where the line resides.. + * height: Height of the rectangle where the line resides. + * + * @param { object } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Uses new to create the line. + * width: Width of the rectangle where the line resides.. + * height: Height of the rectangle where the line resides. + * + * @param { object } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Uses new to create the line. + * + * @param { LineOptions } [options] - Line options + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + new (options?: LineOptions): LineAttribute; + + /** + * 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. + * + * @param { object } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @param { object } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * 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. + * + * @param { object } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * 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. + * + * @param { object } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * The return value of the parameter is Line. + * + * @param { LineOptions } [options] - Line options + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options?: LineOptions): LineAttribute; +} + +/** + * inheritance CommonShapeMethod. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * inheritance CommonShapeMethod. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * inheritance CommonShapeMethod. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * inheritance CommonShapeMethod. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class LineAttribute extends CommonShapeMethod { + /** + * Coordinate of the start point of the line (relative coordinate). + * + * @param { Array } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Coordinate of the start point of the line (relative coordinate). + * + * @param { Array } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Coordinate of the start point of the line (relative coordinate). + * + * @param { Array } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Coordinate of the start point of the line (relative coordinate). + * + * @param { Array } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + startPoint(value: Array): LineAttribute; + + /** + * Line end coordinates (relative coordinates). + * + * @param { Array } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Line end coordinates (relative coordinates). + * + * @param { Array } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Line end coordinates (relative coordinates). + * + * @param { Array } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Line end coordinates (relative coordinates). + * + * @param { Array } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + endPoint(value: Array): LineAttribute; +} + +/** + * Defines Line Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Line Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Line Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Line Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Line: LineInterface; + +/** + * Defines Line Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Line Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Line Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Line Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const LineInstance: LineAttribute; diff --git a/tests/arkts-sdk/ets/linearindicator.d.ts b/tests/arkts-sdk/ets/linearindicator.d.ts new file mode 100644 index 00000000..dce0df8e --- /dev/null +++ b/tests/arkts-sdk/ets/linearindicator.d.ts @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the LinearIndicator Controller. + * + * @interface LinearIndicatorController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +declare class LinearIndicatorController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + constructor(); + + /** + * Sets the progress of indicator. + * + * @param { number } index - the index of current indicator, value range: [0, count - 1]. + * If index value is out of range, do nothing. + * @param { number } progress - current indicator progress value, value range: [0, 100]. + * If the progress value is out of range, do nothing. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + setProgress(index: number, progress: number): void; + + /** + * Start indicator auto play. + * + * @param { LinearIndicatorStartOptions } [options] - the options of indicator auto play. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + start(options?: LinearIndicatorStartOptions): void; + + /** + * Pause indicator auto play. + * Start auto play will be resumed from this paused position. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + pause(): void; + + /** + * Stop indicator auto play. + * Start auto play will restart from the very beginning. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + stop(): void; +} + +/** + * Provides options of indicator auto play. + * + * @interface LinearIndicatorAutoPlayOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +declare interface LinearIndicatorStartOptions { + /** + * The interval between twice auto play. The unit is ms. + * + * @type { ?number } + * @default The default value is 0. if value is less than 0, the value will be 0. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + interval?: number; + + /** + * The animation curve duration. The unit is ms. + * + * @type { ?number } + * @default 4000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + duration?: number; +} + +/** + * Provides linear indicator style. + * + * @interface LinearIndicatorStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +declare interface LinearIndicatorStyle { + /** + * The space of two linear indicator. + * + * @type { ?LengthMetrics } + * @default The default value is 4.0vp. if value is less than 0, the value will be 4.0vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + space?: LengthMetrics; + + /** + * Stroke width of the progress indicator. + * + * @type { ?LengthMetrics } + * @default The default value is 2.0vp. if value is less than 0, the value will be 2.0vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + strokeWidth?: LengthMetrics; + + /** + * The stroke radius of linear indicator. + * + * @type { ?LengthMetrics } + * @default The default value is 1.0vp. if value is more than strokeWidth/2, the value will be strokeWidth/2. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + strokeRadius?: LengthMetrics; + + /** + * The track background color of linear indicator. + * + * @type { ?ColorMetrics } + * @default comp_background_tertiary + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + trackBackgroundColor?: ColorMetrics; + + /** + * The track color of linear indicator. + * + * @type { ?ColorMetrics } + * @default comp_background_emphasize + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + trackColor?: ColorMetrics; +} + +/** + * Provides an interface for indicator. + * + * @interface LinearIndicatorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +interface LinearIndicatorInterface { + /** + * Constructor parameters + * + * @param { number } count - the number of progress in LinearIndicator. minimum value is 2(default is 5). + * if count is less than 2, the value will be 2. + * @param { LinearIndicatorController } controller - Controller of LinearIndicator. + * @returns { LinearIndicatorAttribute } return the instance of the LinearIndicatorAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + (count?: number, controller?: LinearIndicatorController): LinearIndicatorAttribute; +} + +/** + * Defines the Indicator attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +declare class LinearIndicatorAttribute extends CommonMethod { + /** + * Sets the indicator style. + * + * @param { Optional } style - the style of LinearIndicator + * @returns { LinearIndicatorAttribute } return the instance of the LinearIndicatorAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + indicatorStyle(style: Optional): LinearIndicatorAttribute; + + /** + * Sets whether indicator supports loop, default is true. + * + * @param { Optional } loop - indicate whether loop playback is supported + * @returns { LinearIndicatorAttribute } return the instance of the LinearIndicatorAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + indicatorLoop(loop: Optional): LinearIndicatorAttribute; + + /** + * Called when progress value update. + * + * @param { Optional } callback - callback of the progress change event. + * @returns { LinearIndicatorAttribute } return the instance of the LinearIndicatorAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ + onChange(callback: Optional): LinearIndicatorAttribute; +} + +/** + * Defines the callback type used in the indicator progress change event. + * + * @typedef { function } OnLinearIndicatorChangeCallback + * @param { number } index - index of current indicator. + * @param { number } progress - current indicator progress value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +declare type OnLinearIndicatorChangeCallback = (index: number, progress: number) => void; + +/** + * Defines Indicator Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +declare const LinearIndicator: LinearIndicatorInterface; + +/** + * Defines Indicator Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +declare const LinearIndicatorInstance: LinearIndicatorAttribute diff --git a/tests/arkts-sdk/ets/list.d.ts b/tests/arkts-sdk/ets/list.d.ts new file mode 100644 index 00000000..c8b91811 --- /dev/null +++ b/tests/arkts-sdk/ets/list.d.ts @@ -0,0 +1,2328 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Declare scroll status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare scroll status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare scroll status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare scroll status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ScrollState { + /** + * Not activated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Not activated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Not activated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Not activated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Idle, + + /** + * Scrolling status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Scrolling status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Scrolling status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Scrolling status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Scroll, + + /** + * Drag status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Drag status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Drag status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Drag status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Fling, +} + +/** + * Declare list item alignment status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare list item alignment status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare list item alignment status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ListItemAlign { + /** + * Start position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Start position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Start position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * Center position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Center position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Center position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * End position in the direction of cross axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * End position in the direction of cross axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * End position in the direction of cross axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, +} + +/** + * Declare list item group area + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum ListItemGroupArea { + /** + * List item group area is none + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NONE = 0, + + /** + * List item group area is list item + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IN_LIST_ITEM_AREA = 1, + + /** + * List item group area is header + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IN_HEADER_AREA = 2, + + /** + * List item group area is footer + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IN_FOOTER_AREA = 3, +} + +/** + * Declare item group sticky style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare item group sticky style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare item group sticky style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum StickyStyle { + /** + * The header and footer of each item group will not be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The header and footer of each item group will not be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The header and footer of each item group will not be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None = 0, + + /** + * The header of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The header of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The header of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Header = 1, + + /** + * The footer of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The footer of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The footer of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Footer = 2, +} + +/** + * Declare edge effect of chain animation. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare enum ChainEdgeEffect { + /** + * Default edge effect. Compress the space in the drag direction + * and stretch the space in the opposite drag direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + DEFAULT, + + /** + * Stretch all space. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + STRETCH, +} + +/** + * Declare limited position when scroll end. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Declare limited position when scroll end. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ScrollSnapAlign { + /** + * Default no item scroll snap alignment effect. When scroll end, + * list item will stop without limit. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Default no item scroll snap alignment effect. When scroll end, + * list item will stop without limit. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NONE, + + /** + * The first item in view will be aligned at the start of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The first item in view will be aligned at the start of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + START, + + /** + * The middle item in view will be aligned at the center of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The middle item in view will be aligned at the center of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CENTER, + + /** + * The last item in view will be aligned at the end of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The last item in view will be aligned at the end of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + END, +} + +/** + * Defines the chain animation options. + * + * @interface ChainAnimationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare interface ChainAnimationOptions { + /** + * Minimum space for chain animation. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + minSpace: Length; + + /** + * Maximum space for chain animation. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + maxSpace: Length; + + /** + * Conductivity of chain animation. + * + * @type { ?number } + * @default 0.7 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + conductivity?: number; + + /** + * Intensity of chain animation. + * + * @type { ?number } + * @default 0.3 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + intensity?: number; + + /** + * Edge effect of chain animation. + * + * @type { ?ChainEdgeEffect } + * @default ChainEdgeEffect.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + edgeEffect?: ChainEdgeEffect; + + /** + * Stiffness of chain spring. + * + * @type { ?number } + * @default 228 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + stiffness?: number; + + /** + * Damping of chain spring. + * + * @type { ?number } + * @default 30 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + damping?: number; +} + +/** + * Defines the close swipe action options. + * + * @interface CloseSwipeActionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the close swipe action options. + * + * @interface CloseSwipeActionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CloseSwipeActionOptions { + /** + * Called after collapse animation completed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called after collapse animation completed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onFinish?: ()=>void +} + +/** + * Defines the visible list content info. + * + * @interface VisibleListContentInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface VisibleListContentInfo { + /** + * Index number of a child in the list. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: number + + /** + * Area of the ListItemGroup. + * + * @type { ?ListItemGroupArea } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + itemGroupArea?: ListItemGroupArea + + /** + * Index number of a ListItem in ListItemGroup. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + itemIndexInGroup?: number +} + +/** + * Callback of scroll visible content, using in onScrollVisibleContentChange. + * + * @typedef {function} OnScrollVisibleContentChangeCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type OnScrollVisibleContentChangeCallback = (start: VisibleListContentInfo, end: VisibleListContentInfo) => void; + +/** + * @extends Scroller + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * @extends Scroller + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ListScroller extends Scroller { + /** + * Gets the size and position of a ListItem in a ListItemGroup. + * + * @param { number } index - Index of the ListItemGroup in List. + * @param { number } indexInGroup - Index of the ListItem in ListItemGroup. + * @returns { RectResult } Returns the size and position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gets the size and position of a ListItem in a ListItemGroup. + * + * @param { number } index - Index of the ListItemGroup in List. + * @param { number } indexInGroup - Index of the ListItem in ListItemGroup. + * @returns { RectResult } Returns the size and position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getItemRectInGroup(index: number, indexInGroup: number): RectResult; + + /** + * Called when sliding to the specified index in specified ListItemGroup. + * + * @param { number } index - Index of the ListItemGroup in List. + * @param { number } indexInGroup - Index of the ListItem in ListItemGroup. + * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } align - Sets the alignment mode of a specified index. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when sliding to the specified index in specified ListItemGroup. + * + * @param { number } index - Index of the ListItemGroup in List. + * @param { number } indexInGroup - Index of the ListItem in ListItemGroup. + * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } align - Sets the alignment mode of a specified index. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scrollToItemInGroup(index: number, indexInGroup:number, smooth?: boolean, align?: ScrollAlign): void; + + /** + * Collapse all listItem. + * + * @param { CloseSwipeActionOptions } options - Options of close Swipe items. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Collapse all listItem. + * + * @param { CloseSwipeActionOptions } options - Options of close Swipe items. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + closeAllSwipeActions(options?: CloseSwipeActionOptions): void; + + /** + * Get visible list content info by position. + * + * @param { number } x - X coordinate relative to the upper left corner of the list's original area, in vp. + * @param { number } y - Y coordinate relative to the upper left corner of the list's original area, in vp. + * @returns { VisibleListContentInfo } Visible list content info of the position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - The controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + getVisibleListContentInfo(x: number, y: number): VisibleListContentInfo; +} + +/** + * Defines List constructor options. + * + * @interface ListOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +interface ListOptions { + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + initialIndex?: number; + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + space?: number | string; + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scroller?: Scroller; +} + +/** + * The list interface is extended. + * + * @interface ListInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The list interface is extended. + * + * @interface ListInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * The list interface is extended. + * + * @interface ListInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * The list interface is extended. + * + * @interface ListInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ListInterface { + /** + * Called when interface data is called. + * + * @param { object } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when interface data is called. + * + * @param { object } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when interface data is called. + * + * @param { object } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when interface data is called. + * + * @param { object } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when interface data is called. + * + * @param { ListOptions } [options] - list options + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options?: ListOptions): ListAttribute; +} + +/** + * Defines List divider opotions. + * + * @interface ListDividerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface ListDividerOptions { + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeWidth: Length; + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + startMargin?: Length; + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + endMargin?: Length; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends ScrollableCommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ListAttribute extends ScrollableCommonMethod { + /** + * Called when need to decide how much lanes the list will show. + * + * @param { number | LengthConstrain } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when need to decide how much lanes the list will show. + * + * @param { number | LengthConstrain } value + * @param { Dimension } gutter + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when need to decide how much lanes the list will show. + * + * @param { number | LengthConstrain } value + * @param { Dimension } gutter + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lanes(value: number | LengthConstrain, gutter?: Dimension): ListAttribute; + + /** + * Called when need to decide how to align lanes in the direction of the cross axis. + * + * @param { ListItemAlign } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when need to decide how to align lanes in the direction of the cross axis. + * + * @param { ListItemAlign } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when need to decide how to align lanes in the direction of the cross axis. + * + * @param { ListItemAlign } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignListItem(value: ListItemAlign): ListAttribute; + + /** + * Called when the arrangement direction of the list component is set. + * + * @param { Axis } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the arrangement direction of the list component is set. + * + * @param { Axis } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the arrangement direction of the list component is set. + * + * @param { Axis } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the arrangement direction of the list component is set. + * + * @param { Axis } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + listDirection(value: Axis): ListAttribute; + + /** + * Called when the display mode of the side slider is set. + * + * @param { BarState } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the display mode of the side slider is set. + * + * @param { BarState } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the display mode of the side slider is set. + * + * @param { BarState } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the display mode of the side slider is set. + * + * @param { BarState } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scrollBar(value: BarState): ListAttribute; + + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value + * @param { EdgeEffectOptions } options + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + edgeEffect(value: EdgeEffect, options?: EdgeEffectOptions): ListAttribute; + + /** + * Called when need to decide contentStartOffset the list will show. + * @param { number } value - the value Of startOffset. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when need to decide contentStartOffset the list will show. + * @param { number } value - the value Of startOffset. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentStartOffset(value: number): ListAttribute; + + /** + * Called when need to decide contentEndOffset the list will show. + * @param { number } value - the value Of endOffset. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when need to decide contentEndOffset the list will show. + * @param { number } value - the value Of endOffset. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentEndOffset(value: number): ListAttribute; + + /** + * Called when the ListItem split line style is set. + * + * @param { object | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the ListItem split line style is set. + * + * @param { {strokeWidth: Length;color?: ResourceColor;startMargin?: Length;endMargin?: Length;} | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the ListItem split line style is set. + * + * @param { {strokeWidth: Length;color?: ResourceColor;startMargin?: Length;endMargin?: Length;} | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the ListItem split line style is set. + * + * @param { {strokeWidth: Length;color?: ResourceColor;startMargin?: Length;endMargin?: Length;} | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the ListItem split line style is set. + * + * @param { ListDividerOptions | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + divider( + value: ListDividerOptions | null, + ): ListAttribute; + + /** + * Called when judging whether it is in editable mode. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + editMode(value: boolean): ListAttribute; + + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + multiSelectable(value: boolean): ListAttribute; + + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + cachedCount(value: number): ListAttribute; + + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number } count - cached count. + * @param { boolean } show - whether to show the nodes in the cache. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + cachedCount(count: number, show: boolean): ListAttribute; + + /** + * Called when setting whether to enable chain linkage dynamic effect. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting whether to enable chain linkage dynamic effect. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when setting whether to enable chain linkage dynamic effect. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting whether to enable chain linkage dynamic effect. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + chainAnimation(value: boolean): ListAttribute; + + /** + * Called to setting chain linkage dynamic effect options. + * + * @param { ChainAnimationOptions } value - options of the chain animation. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + chainAnimationOptions(value: ChainAnimationOptions): ListAttribute; + + /** + * Called when header or footer of item group will be pinned. + * + * @param { StickyStyle } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when header or footer of item group will be pinned. + * + * @param { StickyStyle } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when header or footer of item group will be pinned. + * + * @param { StickyStyle } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + sticky(value: StickyStyle): ListAttribute; + + /** + * Called to set list item scroll end alignment effect. + * + * @param { ScrollSnapAlign } value - options of the list alignment effect. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to set list item scroll end alignment effect. + * + * @param { ScrollSnapAlign } value - options of the list alignment effect. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollSnapAlign(value: ScrollSnapAlign): ListAttribute; + + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: NestedScrollOptions): ListAttribute; + + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { ListAttribute } The attribute of the list + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { ListAttribute } The attribute of the list + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableScrollInteraction(value: boolean): ListAttribute; + + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + friction(value: number | Resource): ListAttribute; + + /** + * Set children main size for List. + * + * @param { ChildrenMainSize } value - children main size for List + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + childrenMainSize(value: ChildrenMainSize): ListAttribute; + + /** + * Set maintain visible content position List. + * + * @param { boolean } enabled - maintain visible content position. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maintainVisibleContentPosition(enabled: boolean): ListAttribute; + + /** + * Called when the offset and status callback of the slide are set. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the offset and status callback of the slide are set. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the offset and status callback of the slide are set. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the offset and status callback of the slide are set. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead common.ScrollableCommonMethod#onDidScroll + */ + onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void): ListAttribute; + + /** + * Called when the start and end positions of the display change. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the start and end positions of the display change. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the start and end positions of the display change. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the start and end positions of the display change. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onScrollIndex(event: (start: number, end: number, center: number) => void): ListAttribute; + + /** + * Called when the list visible content changes. + * + * @param { OnScrollVisibleContentChangeCallback } handler - Callback of Scroll Visible. + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onScrollVisibleContentChange(handler: OnScrollVisibleContentChangeCallback): ListAttribute; + + /** + * Called when the list begins to arrive. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the list begins to arrive. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the list begins to arrive. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the list begins to arrive. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onReachStart(event: () => void): ListAttribute; + + /** + * Called when the list reaches the end. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the list reaches the end. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the list reaches the end. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the list reaches the end. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onReachEnd(event: () => void): ListAttribute; + + /** + * Called when the slider start. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the slider start. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the slider start. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onScrollStart(event: () => void): ListAttribute; + + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onScrollStop(event: () => void): ListAttribute; + + /** + * Called when a list item is deleted. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + onItemDelete(event: (index: number) => boolean): ListAttribute; + + /** + * Called when a list item is moved. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a list item is moved. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when a list item is moved. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemMove(event: (from: number, to: number) => boolean): ListAttribute; + + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragStart(event: (event: ItemDragInfo, itemIndex: number) => ((() => any) | void)): ListAttribute; + + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragEnter(event: (event: ItemDragInfo) => void): ListAttribute; + + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragMove(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number) => void): ListAttribute; + + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragLeave(event: (event: ItemDragInfo, itemIndex: number) => void): ListAttribute; + + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDrop(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void): ListAttribute; + + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onScrollFrameBegin(event: (offset: number, state: ScrollState) => { offsetRemain: number }): ListAttribute; +} + +/** + * Defines List Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines List Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines List Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines List Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const List: ListInterface; + +/** + * Defines List Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines List Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines List Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines List Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ListInstance: ListAttribute; diff --git a/tests/arkts-sdk/ets/list_item.d.ts b/tests/arkts-sdk/ets/list_item.d.ts new file mode 100644 index 00000000..4b97f886 --- /dev/null +++ b/tests/arkts-sdk/ets/list_item.d.ts @@ -0,0 +1,906 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Declare item ceiling attribute. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead list/StickyStyle + */ +declare enum Sticky { + /** + * No sticky. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + None, + + /** + * Normal mode + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Normal, + + /** + * Set opacity. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Opacity, +} + +/** + * Declare whether the ListItem element is editable. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ +declare enum EditMode { + /** + * Unrestricted operations. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + None, + + /** + * Deletable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Deletable, + + /** + * Movable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Movable, +} + +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SwipeEdgeEffect { + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Spring, + + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, +} + +/** + * Declare enum SwipeActionState. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Declare enum SwipeActionState. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum SwipeActionState { + /** + * Collapsed type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Collapsed type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + COLLAPSED, + + /** + * EXPANDED type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * EXPANDED type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + EXPANDED, + + /** + * Action type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Action type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ACTIONING, +} + +/** + * Defines the swipe action item for SwipeActionOptions. + * + * @interface SwipeActionItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the swipe action item for SwipeActionOptions. + * + * @interface SwipeActionItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SwipeActionItem { + /** + * An action item that appears when a list item slides right (when list direction is Vertical) or + * slides down (when list direction Horizontal). + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * An action item that appears when a list item slides right (when list direction is Vertical) or + * slides down (when list direction Horizontal). + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + builder?: CustomBuilder; + + /** + * Defines distance for the delete area. + * + * @type { ?Length } + * @default 56vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines distance for the delete area. + * + * @type { ?Length } + * @default 56vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + actionAreaDistance?: Length; + + /** + * Called when ListItem need to be deleted. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when ListItem need to be deleted. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAction?: () => void; + + /** + * Called when swipe entry delete area. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when swipe entry delete area. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onEnterActionArea?: () => void; + + /** + * Called when swipe exit delete area. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when swipe exit delete area. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onExitActionArea?: () => void; + + /** + * Called when component swipe action state changed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when component swipe action state changed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onStateChange?: (state: SwipeActionState) => void; +} + +/** + * Defines the SwipeActionOption of swipeAction attribute method. + * + * @interface SwipeActionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the SwipeActionOption of swipeAction attribute method. + * + * @interface SwipeActionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the SwipeActionOption of swipeAction attribute method. + * + * @interface SwipeActionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SwipeActionOptions { + /** + * An action item that appears when a list item slides right (when list direction is Vertical) or + * slides down (when list direction Horizontal). + * + * @type { ?(CustomBuilder | SwipeActionItem) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * An action item that appears when a list item slides right (when list direction is Vertical) or + * slides down (when list direction Horizontal). + * + * @type { ?(CustomBuilder | SwipeActionItem) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * An action item that appears when a list item slides right (when list direction is Vertical) or + * slides down (when list direction Horizontal). + * + * @type { ?(CustomBuilder | SwipeActionItem) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + start?: CustomBuilder | SwipeActionItem; + + /** + * An action item that appears when a list item slides left (when list direction is Vertical) or + * slides up (when list direction Horizontal). + * + * @type { ?(CustomBuilder | SwipeActionItem) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * An action item that appears when a list item slides left (when list direction is Vertical) or + * slides up (when list direction Horizontal). + * + * @type { ?(CustomBuilder | SwipeActionItem) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * An action item that appears when a list item slides left (when list direction is Vertical) or + * slides up (when list direction Horizontal). + * + * @type { ?(CustomBuilder | SwipeActionItem) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + end?: CustomBuilder | SwipeActionItem; + + /** + * Sets whether sliding to a boundary has a spring effect. + * + * @type { ?SwipeEdgeEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets whether sliding to a boundary has a spring effect. + * + * @type { ?SwipeEdgeEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets whether sliding to a boundary has a spring effect. + * + * @type { ?SwipeEdgeEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + edgeEffect?: SwipeEdgeEffect; + + /** + * Called when swipe action offset changed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when swipe action offset changed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onOffsetChange?: (offset: number) => void; +} + +/** + * Defines the list item style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the list item style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ListItemStyle { + /** + * Show custom style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Show custom style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NONE = 0, + + /** + * Show default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Show default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CARD = 1, +} + +/** + * Defines the list item options. + * + * @interface ListItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the list item options. + * + * @interface ListItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ListItemOptions { + /** + * Describes the ListItem style. + * + * @type { ?ListItemStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Describes the ListItem style. + * + * @type { ?ListItemStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style?: ListItemStyle; +} + +/** + * Values in the list + * + * @interface ListItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Values in the list + * + * @interface ListItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Values in the list + * + * @interface ListItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Values in the list + * + * @interface ListItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ListItemInterface { + /** + * Called when an interface is used. + * + * @param { ListItemOptions } value + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when an interface is used. + * + * @param { ListItemOptions } value + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (value?: ListItemOptions): ListItemAttribute; + + /** + * Called when an interface is used. + * + * @param { string } value + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when an interface is used. + * + * @param { string } value + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + * @useinstead listItem/ListItemInterface + */ + (value?: string): ListItemAttribute; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ListItemAttribute extends CommonMethod { + /** + * Called when setting whether item is ceiling effect. + * + * @param { Sticky } value + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead list/List#sticky + */ + sticky(value: Sticky): ListItemAttribute; + + /** + * Called when judging whether it is editable. + * + * @param { boolean | EditMode } value + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + editable(value: boolean | EditMode): ListItemAttribute; + + /** + * Called when judging whether it is selectable. + * + * @param { boolean } value + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when judging whether it is selectable. + * + * @param { boolean } value + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when judging whether it is selectable. + * + * @param { boolean } value + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when judging whether it is selectable. + * + * @param { boolean } value + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectable(value: boolean): ListItemAttribute; + + /** + * Called when judging whether it is selected. + * This parameter supports $$ for two-way binding of variables. + * + * @param { boolean } value - if the listItem is selected. + * @returns { ListItemAttribute } the attribute of the listItem. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when judging whether it is selected. + * This parameter supports $$ for two-way binding of variables. + * + * @param { boolean } value - if the listItem is selected. + * @returns { ListItemAttribute } the attribute of the listItem. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selected(value: boolean): ListItemAttribute; + + /** + * Sets the action item that appears when the list item slides in the cross axis direction of the list. + * + * @param { SwipeActionOptions } value - items defines in the SwipeActionOption. + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the action item that appears when the list item slides in the cross axis direction of the list. + * + * @param { SwipeActionOptions } value - items defines in the SwipeActionOption. + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the action item that appears when the list item slides in the cross axis direction of the list. + * + * @param { SwipeActionOptions } value - items defines in the SwipeActionOption. + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + swipeAction(value: SwipeActionOptions): ListItemAttribute; + + /** + * Called when the listItem is selected. + * + * @param { function } event + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the listItem is selected. + * + * @param { function } event + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the listItem is selected. + * + * @param { function } event + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the listItem is selected. + * + * @param { function } event + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onSelect(event: (isSelected: boolean) => void): ListItemAttribute; +} + +/** + * Defines ListItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines ListItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines ListItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines ListItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ListItemInstance: ListItemAttribute; + +/** + * Defines ListItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines ListItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines ListItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines ListItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ListItem: ListItemInterface; + diff --git a/tests/arkts-sdk/ets/list_item_group.d.ts b/tests/arkts-sdk/ets/list_item_group.d.ts new file mode 100644 index 00000000..afc53934 --- /dev/null +++ b/tests/arkts-sdk/ets/list_item_group.d.ts @@ -0,0 +1,408 @@ +/* + * Copyright (c) 2022-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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the list item group style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the list item group style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ListItemGroupStyle { + /** + * Show custom style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Show custom style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NONE = 0, + + /** + * Show default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Show default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CARD = 1, +} + +/** + * Defines the list item group options. + * + * @interface ListItemGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the list item group options. + * + * @interface ListItemGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the list item group options. + * + * @interface ListItemGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ListItemGroupOptions { + /** + * Describes the ListItemGroup header. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Describes the ListItemGroup header. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Describes the ListItemGroup header. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + header?: CustomBuilder; + + /** + * Describes the ListItemGroup headerCompenent. + * + * @type { ?ComponentContent } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + headerComponent?: ComponentContent; + + /** + * Describes the ListItemGroup footer. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Describes the ListItemGroup footer. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Describes the ListItemGroup footer. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + footer?: CustomBuilder; + + /** + * Describes the ListItemGroup footerComponent. + * + * @type { ?ComponentContent } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + footerComponent?: ComponentContent; + + /** + * Describes the ListItemGroup space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Describes the ListItemGroup space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Describes the ListItemGroup space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + space?: number | string; + + /** + * Describes the ListItemGroup style. + * + * @type { ?ListItemGroupStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Describes the ListItemGroup style. + * + * @type { ?ListItemGroupStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style?: ListItemGroupStyle; +} + +/** + * Defines the ListItemGroup component + * + * @interface ListItemGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the ListItemGroup component + * + * @interface ListItemGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the ListItemGroup component + * + * @interface ListItemGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface ListItemGroupInterface { + /** + * Called when interface is called. + * + * @param { ListItemGroupOptions } options + * @returns { ListItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when interface is called. + * + * @param { ListItemGroupOptions } options + * @returns { ListItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when interface is called. + * + * @param { ListItemGroupOptions } options + * @returns { ListItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (options?: ListItemGroupOptions): ListItemGroupAttribute; +} + +/** + * Defines the item group attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the item group attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the item group attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class ListItemGroupAttribute extends CommonMethod { + /** + * Called when the ListItemGroup split line style is set. + * + * @param { { + * strokeWidth: Length; + * color?: ResourceColor; + * startMargin?: Length; + * endMargin?: Length; + * } | null } value + * @returns { ListItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the ListItemGroup split line style is set. + * + * @param { { + * strokeWidth: Length; + * color?: ResourceColor; + * startMargin?: Length; + * endMargin?: Length; + * } | null } value + * @returns { ListItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the ListItemGroup split line style is set. + * + * @param { { + * strokeWidth: Length; + * color?: ResourceColor; + * startMargin?: Length; + * endMargin?: Length; + * } | null } value + * @returns { ListItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the ListItemGroup split line style is set. + * + * @param { ListDividerOptions | null } value + * @returns { ListItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + divider( + value: ListDividerOptions | null, + ): ListItemGroupAttribute; + + /** + * Set children main size for ListItemGroup. + * + * @param { ChildrenMainSize } value - children main size for ListItemGroup + * @returns { ListItemGroupAttribute } the attribute of the ListItemGroup. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + childrenMainSize(value: ChildrenMainSize): ListItemGroupAttribute; +} + +/** + * Defines ListItemGroup Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines ListItemGroup Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines ListItemGroup Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const ListItemGroupInstance: ListItemGroupAttribute; + +/** + * Defines ListItemGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines ListItemGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines ListItemGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const ListItemGroup: ListItemGroupInterface; diff --git a/tests/arkts-sdk/ets/loading_progress.d.ts b/tests/arkts-sdk/ets/loading_progress.d.ts new file mode 100644 index 00000000..98910987 --- /dev/null +++ b/tests/arkts-sdk/ets/loading_progress.d.ts @@ -0,0 +1,418 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Load style of progress bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Load style of progress bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Load style of progress bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Load style of progress bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum LoadingProgressStyle { + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Default, + + /** + * Announcement style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Announcement style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Announcement style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Announcement style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Circular, + + /** + * The style of the track. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The style of the track. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The style of the track. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The style of the track. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Orbital, +} + +/** + * Provides an interface for extending the loading progress. + * + * @interface LoadingProgressInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides an interface for extending the loading progress. + * + * @interface LoadingProgressInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides an interface for extending the loading progress. + * + * @interface LoadingProgressInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for extending the loading progress. + * + * @interface LoadingProgressInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface LoadingProgressInterface { + /** + * Called when the progress bar progress is viewed. + * + * @returns { LoadingProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the progress bar progress is viewed. + * + * @returns { LoadingProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the progress bar progress is viewed. + * + * @returns { LoadingProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the progress bar progress is viewed. + * + * @returns { LoadingProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (): LoadingProgressAttribute; +} + +/** + * Declare the progress bar being loaded + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Declare the progress bar being loaded + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare the progress bar being loaded + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare the progress bar being loaded + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class LoadingProgressAttribute extends CommonMethod { + /** + * Load the color of the progress bar. + * + * @param { ResourceColor } value + * @returns { LoadingProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Load the color of the progress bar. + * + * @param { ResourceColor } value + * @returns { LoadingProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Load the color of the progress bar. + * + * @param { ResourceColor } value + * @returns { LoadingProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Load the color of the progress bar. + * + * @param { ResourceColor } value + * @returns { LoadingProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color(value: ResourceColor): LoadingProgressAttribute; + + /** + * Whether to display the LoadingProgress content. + * + * @param { boolean } value - indicates the state of LoadingProgress content + * @returns { LoadingProgressAttribute } the attribute of the LoadingProgress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Whether to display the LoadingProgress content. + * + * @param { boolean } value - indicates the state of LoadingProgress content + * @returns { LoadingProgressAttribute } the attribute of the LoadingProgress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableLoading(value: boolean): LoadingProgressAttribute; + + /** + * Set the content modifier of loadingProgress. + * + * @param { ContentModifier } modifier - The contentModifier of LoadingProgress. + * @returns { LoadingProgressAttribute} the attribute of the loading progress + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): LoadingProgressAttribute; +} + +/** + * LoadingProgressConfiguration used by LoadingProgress contentModifier + * + * @interface LoadingProgressConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LoadingProgressConfiguration extends CommonConfiguration { + /** + * Whether to enable the LoadingProgress content. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableLoading: boolean; +} + +/** + * Defines LoadingProgress Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines LoadingProgress Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines LoadingProgress Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines LoadingProgress Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const LoadingProgress: LoadingProgressInterface; + +/** + * Loading Progress Extensions on Declarative Classes + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Loading Progress Extensions on Declarative Classes + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Loading Progress Extensions on Declarative Classes + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Loading Progress Extensions on Declarative Classes + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const LoadingProgressInstance: LoadingProgressAttribute; diff --git a/tests/arkts-sdk/ets/location_button.d.ts b/tests/arkts-sdk/ets/location_button.d.ts new file mode 100644 index 00000000..676c83f3 --- /dev/null +++ b/tests/arkts-sdk/ets/location_button.d.ts @@ -0,0 +1,486 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Enumerates the icon styles. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the icon styles. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum LocationIconStyle { + /** + * Icon filled with the specified color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Icon filled with the specified color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + FULL_FILLED = 0, + + /** + * Icon rendered as lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Icon rendered as lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + LINES = 1 +} + +/** + * Enumerates the text that can be displayed on the location button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the text that can be displayed on the location button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum LocationDescription { + /** + * Current Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Current Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + CURRENT_LOCATION = 0, + + /** + * Add Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Add Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + ADD_LOCATION = 1, + + /** + * Select Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Select Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SELECT_LOCATION = 2, + + /** + * Share Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Share Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SHARE_LOCATION = 3, + + /** + * Send Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Send Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SEND_LOCATION = 4, + + /** + * Locating + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Locating + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + LOCATING = 5, + + /** + * Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + LOCATION = 6, + + /** + * Send Current Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Send Current Location + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SEND_CURRENT_LOCATION = 7, + + /** + * Relocation + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Relocation + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + RELOCATION = 8, + + /** + * Punch In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Punch In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + PUNCH_IN = 9, + + /** + * Current Position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Current Position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + CURRENT_POSITION = 10 +} + +/** + * Declares the interface for setting the location button options. + * + * @interface LocationButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Declares the interface for setting the location button options. + * + * @interface LocationButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface LocationButtonOptions { + /** + * Style of the icon to be drawn. + * + * @type { ?LocationIconStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Style of the icon to be drawn. + * + * @type { ?LocationIconStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + icon?: LocationIconStyle; + + /** + * Text to be displayed on the button. + * + * @type { ?LocationDescription } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text to be displayed on the button. + * + * @type { ?LocationDescription } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + text?: LocationDescription; + + /** + * Type of the button. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Type of the button. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + buttonType?: ButtonType; +} + +/** + * Enumerates the click event results of the location button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the click event results of the location button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum LocationButtonOnClickResult { + /** + * Success. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Success. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SUCCESS = 0, + + /** + * Failure because the application is not temporarily authorized for accessing location data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Failure because the application is not temporarily authorized for accessing location data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + TEMPORARY_AUTHORIZATION_FAILED = 1 +} + +/** + * Defines the interface for setting a location button. + * + * @interface LocationButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the interface for setting a location button. + * + * @interface LocationButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +interface LocationButtonInterface { + /** + * Creates a location button. + * + * @returns { LocationButtonAttribute } TReturns the attribute of the location button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Creates a location button. + * + * @returns { LocationButtonAttribute } TReturns the attribute of the location button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + (): LocationButtonAttribute; + + /** + * Creates a location button with the specified composition. + * If an attribute is not set, the corresponding element will not be drawn. + * + * @param { LocationButtonOptions } options - Indicates the options of the location button. + * @returns { LocationButtonAttribute } Returns the attribute of the location button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Creates a location button with the specified composition. + * If an attribute is not set, the corresponding element will not be drawn. + * + * @param { LocationButtonOptions } options - Indicates the options of the location button. + * @returns { LocationButtonAttribute } Returns the attribute of the location button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + (options: LocationButtonOptions): LocationButtonAttribute; +} + +/** + * Defines the attributes of the location button. + * + * @extends SecurityComponentMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the attributes of the location button. + * + * @extends SecurityComponentMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare class LocationButtonAttribute extends SecurityComponentMethod { + /** + * Called when the location button is clicked. + * + * @param { function } event + * @returns { LocationButtonAttribute } Returns the attribute of the location button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the location button is clicked. + * + * @param { function } event + * @returns { LocationButtonAttribute } Returns the attribute of the location button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + onClick(event: (event: ClickEvent, result: LocationButtonOnClickResult) => void): LocationButtonAttribute; +} + +/** + * Defines a button that interacts with the security component service to + * request the authorization for accessing location data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines a button that interacts with the security component service to + * request the authorization for accessing location data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare const LocationButton: LocationButtonInterface; + +/** + * Defines a location button instance for secure access. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines a location button instance for secure access. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare const LocationButtonInstance: LocationButtonAttribute; diff --git a/tests/arkts-sdk/ets/marquee.d.ts b/tests/arkts-sdk/ets/marquee.d.ts new file mode 100644 index 00000000..35020374 --- /dev/null +++ b/tests/arkts-sdk/ets/marquee.d.ts @@ -0,0 +1,730 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines Marquee constructor options. + * + * @interface MarqueeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +interface MarqueeOptions { + /** + * Control whether the running lamp enters the playing state. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Control whether the running lamp enters the playing state. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Control whether the running lamp enters the playing state. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Control whether the running lamp enters the playing state. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + start: boolean; + + /** + * Scroll animation text scroll step, when step is larger than the text width of Marquee, take the default value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Scroll animation text scroll step, when step is larger than the text width of Marquee, take the default value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Scroll animation text scroll step, when step is larger than the text width of Marquee, take the default value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Scroll animation text scroll step, when step is larger than the text width of Marquee, take the default value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + step?: number; + + /** + * Set the number of times the scroll is repeated, infinite loop if it is less than or equal to zero. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the number of times the scroll is repeated, infinite loop if it is less than or equal to zero. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the number of times the scroll is repeated, infinite loop if it is less than or equal to zero. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the number of times the scroll is repeated, infinite loop if it is less than or equal to zero. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + loop?: number; + + /** + * Set text to scroll from the beginning or backward. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set text to scroll from the beginning or backward. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set text to scroll from the beginning or backward. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set text to scroll from the beginning or backward. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fromStart?: boolean; + + /** + * Text that needs scrolling. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text that needs scrolling. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text that needs scrolling. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text that needs scrolling. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + src: string; +} + +/** + * Provides the interface for the marquee attributes. + * + * @interface MarqueeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides the interface for the marquee attributes. + * + * @interface MarqueeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides the interface for the marquee attributes. + * + * @interface MarqueeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides the interface for the marquee attributes. + * + * @interface MarqueeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface MarqueeInterface { + /** + * Create marquee. + * + * @param { object } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Create marquee. + * + * @param { object } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create marquee. + * + * @param { object } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create marquee. + * + * @param { object } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Create marquee. + * + * @param { MarqueeOptions } options - Marquee options. + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options: MarqueeOptions): MarqueeAttribute; +} + +/** + * Declares marquee properties. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Declares marquee properties. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declares marquee properties. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declares marquee properties. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class MarqueeAttribute extends CommonMethod { + /** + * Set marquee font Color. + * + * @param { ResourceColor } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set marquee font Color. + * + * @param { ResourceColor } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set marquee font Color. + * + * @param { ResourceColor } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set marquee font Color. + * + * @param { ResourceColor } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): MarqueeAttribute; + + /** + * Set marquee font size. + * + * @param { Length } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set marquee font size. + * + * @param { Length } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set marquee font size. + * + * @param { Length } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set marquee font size. + * + * @param { Length } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontSize(value: Length): MarqueeAttribute; + + /** + * Set marquee allow scale. + * + * @param { boolean } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set marquee allow scale. + * + * @param { boolean } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set marquee allow scale. + * + * @param { boolean } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set marquee allow scale. + * + * @param { boolean } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + allowScale(value: boolean): MarqueeAttribute; + + /** + * Set marquee font weight. + * + * @param { number | FontWeight | string } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set marquee font weight. + * + * @param { number | FontWeight | string } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set marquee font weight. + * + * @param { number | FontWeight | string } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set marquee font weight. + * + * @param { number | FontWeight | string } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): MarqueeAttribute; + + /** + * Set marquee font family. + * + * @param { string | Resource } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set marquee font family. + * + * @param { string | Resource } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set marquee font family. + * + * @param { string | Resource } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set marquee font family. + * + * @param { string | Resource } value + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontFamily(value: string | Resource): MarqueeAttribute; + + /** + * Marquee scrolling strategy after text update. + * + * @param { MarqueeUpdateStrategy } value - The scrolling strategy after text update. + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + marqueeUpdateStrategy(value: MarqueeUpdateStrategy): MarqueeAttribute; + + /** + * Called when scrolling starts. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when scrolling starts. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when scrolling starts. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when scrolling starts. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onStart(event: () => void): MarqueeAttribute; + + /** + * Called when scrolling to the bottom. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when scrolling to the bottom. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when scrolling to the bottom. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when scrolling to the bottom. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onBounce(event: () => void): MarqueeAttribute; + + /** + * Called when scrolling is complete. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when scrolling is complete. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when scrolling is complete. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when scrolling is complete. + * + * @param { function } event + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onFinish(event: () => void): MarqueeAttribute; +} + +/** + * Defines Marquee Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Marquee Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Marquee Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Marquee Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Marquee: MarqueeInterface; + +/** + * Defines Marquee Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Marquee Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Marquee Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Marquee Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const MarqueeInstance: MarqueeAttribute; diff --git a/tests/arkts-sdk/ets/matrix2d.d.ts b/tests/arkts-sdk/ets/matrix2d.d.ts new file mode 100644 index 00000000..594e7dc4 --- /dev/null +++ b/tests/arkts-sdk/ets/matrix2d.d.ts @@ -0,0 +1,538 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class Matrix2D { + /** + * Horizontal Zoom + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Horizontal Zoom + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Horizontal Zoom + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Horizontal Zoom + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scaleX?: number; + + /** + * Vertical Tilt + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Vertical Tilt + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Vertical Tilt + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Vertical Tilt + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + rotateY?: number; + + /** + * Horizontal Tilt + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Horizontal Tilt + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Horizontal Tilt + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Horizontal Tilt + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + rotateX?: number; + + /** + * Vertical Zoom + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Vertical Zoom + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Vertical Zoom + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Vertical Zoom + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scaleY?: number; + + /** + * Horizontal movement + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Horizontal movement + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Horizontal movement + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Horizontal movement + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + translateX?: number; + + /** + * Vertical movement + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Vertical movement + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Vertical movement + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Vertical movement + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + translateY?: number; + + /** + * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational + * translation scaling effect) + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational + * translation scaling effect) + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational + * translation scaling effect) + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational + * translation scaling effect) + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + identity(): Matrix2D; + + /** + * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect + * is the opposite effect of the original) + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect + * is the opposite effect of the original) + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect + * is the opposite effect of the original) + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect + * is the opposite effect of the original) + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + invert(): Matrix2D; + + /** + * The matrix is superimposed in right multiplication mode. When the input parameter is empty, + * the matrix is superimposed. + * + * @param { Matrix2D } other - Matrix to be superimposed + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The matrix is superimposed in right multiplication mode. When the input parameter is empty, + * the matrix is superimposed. + * + * @param { Matrix2D } other - Matrix to be superimposed + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + multiply(other?: Matrix2D): Matrix2D; + + /** + * Adds the rotation effect of the X and Y axes to the current matrix. + * + * @param { number } rx - Rotation effect of the X-axis + * @param { number } ry - Rotation effect of the Y-axis + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Adds the rotation effect of the X and Y axes to the current matrix. + * + * @param { number } rx - Rotation effect of the X-axis + * @param { number } ry - Rotation effect of the Y-axis + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + * @useinstead rotate + */ + rotate(rx?: number, ry?: number): Matrix2D; + + /** + * Adds the rotation effect of the X and Y axes to the current matrix. + * + * @param { number } degree - The rotation angle, clockwise in radians. + * @param { number } rx - Rotation effect of the X-axis + * @param { number } ry - Rotation effect of the Y-axis + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the rotation effect of the X and Y axes to the current matrix. + * + * @param { number } degree - The rotation angle, clockwise in radians. + * @param { number } rx - Rotation effect of the X-axis + * @param { number } ry - Rotation effect of the Y-axis + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + rotate(degree: number, rx?: number, ry?: number): Matrix2D; + + /** + * Adds the translation effect of the X and Y axes to the current matrix. + * + * @param { number } tx - X-axis translation effect + * @param { number } ty - Y-axis translation effect + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Adds the translation effect of the X and Y axes to the current matrix. + * + * @param { number } tx - X-axis translation effect + * @param { number } ty - Y-axis translation effect + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the translation effect of the X and Y axes to the current matrix. + * + * @param { number } tx - X-axis translation effect + * @param { number } ty - Y-axis translation effect + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the translation effect of the X and Y axes to the current matrix. + * + * @param { number } tx - X-axis translation effect + * @param { number } ty - Y-axis translation effect + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + translate(tx?: number, ty?: number): Matrix2D; + + /** + * Adds the scaling effect of the X and Y axes to the current matrix. + * + * @param { number } sx - X-axis scaling effect + * @param { number } sy - Y-axis scaling effect + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Adds the scaling effect of the X and Y axes to the current matrix. + * + * @param { number } sx - X-axis scaling effect + * @param { number } sy - Y-axis scaling effect + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the scaling effect of the X and Y axes to the current matrix. + * + * @param { number } sx - X-axis scaling effect + * @param { number } sy - Y-axis scaling effect + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the scaling effect of the X and Y axes to the current matrix. + * + * @param { number } sx - X-axis scaling effect + * @param { number } sy - Y-axis scaling effect + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scale(sx?: number, sy?: number): Matrix2D; + + /** + * Constructs a 2D change matrix object. The default value is the unit matrix. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructs a 2D change matrix object. The default value is the unit matrix. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Constructs a 2D change matrix object. The default value is the unit matrix. + * + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(unit: LengthMetricsUnit); +} diff --git a/tests/arkts-sdk/ets/media_cached_image.d.ts b/tests/arkts-sdk/ets/media_cached_image.d.ts new file mode 100644 index 00000000..70b0546a --- /dev/null +++ b/tests/arkts-sdk/ets/media_cached_image.d.ts @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the resource which can use ASTC. + * + * @interface ASTCResource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +interface ASTCResource { + /** + * Array of ASTC uri resources, indicating the range of ASTC data to be obtained. + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + sources: Array; + /** + * Column size, indicating the number of ASTC resources to splice per row. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + column: number; +} + +/** + * @interface MediaCachedImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +interface MediaCachedImageInterface { + /** + * Image resource to be obtained. + * + * @param { PixelMap | ResourceStr | DrawableDescriptor | ASTCResource } src + * @returns { MediaCachedImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + (src: PixelMap | ResourceStr | DrawableDescriptor | ASTCResource): MediaCachedImageAttribute; +} + +/** + * Attributes of MediaCachedImage inherited from ImageAttribute. + * + * @extends ImageAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare class MediaCachedImageAttribute extends ImageAttribute {} + +/** + * MediaCachedImage component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare const MediaCachedImage: MediaCachedImageInterface; + +/** + * Instance of MediaCachedImage component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare const MediaCachedImageInstance: MediaCachedImageAttribute; diff --git a/tests/arkts-sdk/ets/menu.d.ts b/tests/arkts-sdk/ets/menu.d.ts new file mode 100644 index 00000000..8d3f144a --- /dev/null +++ b/tests/arkts-sdk/ets/menu.d.ts @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2022-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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the Menu Component. + * + * @interface MenuInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the Menu Component. + * + * @interface MenuInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the Menu Component. + * + * @interface MenuInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface MenuInterface { + /** + * Creates the menu component. + * + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Creates the menu component. + * + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Creates the menu component. + * + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (): MenuAttribute; +} + +/** + * Declare SubMenuExpandingMode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum SubMenuExpandingMode { + /** + * Sub-menu will expand besides main menu + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SIDE_EXPAND = 0, + + /** + * Sub-menu will expand embedded in main menu + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + EMBEDDED_EXPAND = 1, + + /** + * Sub-menu will expand over main menu + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + STACK_EXPAND = 2, +} + +/** + * Defines the Menu component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the Menu component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the Menu component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class MenuAttribute extends CommonMethod { + /** + * Sets the Menu text size. + * + * @param { Length } value - Indicates the font size of menu item. + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @deprecated since 10 + * @useinstead font + */ + fontSize(value: Length): MenuAttribute; + + /** + * Sets the font style. + * Family and style are not supported currently and will be fixed in future. + * + * @param { Font } value - Indicates the font style of menu item. + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the font style. + * Family and style are not supported currently and will be fixed in future. + * + * @param { Font } value - Indicates the font style of menu item. + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font(value: Font): MenuAttribute; + + /** + * Sets the Menu font color. + * + * @param { ResourceColor } value - Indicates the font color of menu item. + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the Menu font color. + * + * @param { ResourceColor } value - Indicates the font color of menu item. + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): MenuAttribute; + + /** + * Sets the radius of the corner around the menu. + * When the radius is less than the menu width, the default border radius is used. + * + * @param { Dimension | BorderRadiuses } value - the border radius. + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the radius of the corner around the menu. + * When the radius is less than the menu width, the default border radius is used. + * + * @param { Dimension | BorderRadiuses } value - the border radius. + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + radius(value: Dimension | BorderRadiuses): MenuAttribute; + + /** + * Set the divider of menu item + * + * @param { DividerStyleOptions | undefined } options + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + menuItemDivider(options: DividerStyleOptions | undefined): MenuAttribute; + + /** + * Set the divider of menu item group + * + * @param { DividerStyleOptions | undefined } options + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + menuItemGroupDivider(options: DividerStyleOptions | undefined): MenuAttribute; + + /** + * Set the expanding mode of sub-menu + * + * @param { SubMenuExpandingMode } mode + * @returns { MenuAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + subMenuExpandingMode(mode: SubMenuExpandingMode): MenuAttribute; +} + +/** + * Defines Menu Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines Menu Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Menu Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Menu: MenuInterface; + +/** + * Defines Menu Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines Menu Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Menu Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const MenuInstance: MenuAttribute; diff --git a/tests/arkts-sdk/ets/menu_item.d.ts b/tests/arkts-sdk/ets/menu_item.d.ts new file mode 100644 index 00000000..701ad173 --- /dev/null +++ b/tests/arkts-sdk/ets/menu_item.d.ts @@ -0,0 +1,521 @@ +/* + * Copyright (c) 2022-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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the option of MenuItem. + * + * @interface MenuItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the option of MenuItem. + * + * @interface MenuItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the option of MenuItem. + * + * @interface MenuItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MenuItemOptions { + /** + * Defines the start display image info. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Defines the start display image info. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the start display image info. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + startIcon?: ResourceStr; + + /** + * Defines the start display symbol info. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolStartIcon?: SymbolGlyphModifier; + + /** + * Defines the content string display info. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Defines the content string display info. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the content string display info. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + content?: ResourceStr; + + /** + * Defines the end display image info. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Defines the end display image info. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the end display image info. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + endIcon?: ResourceStr; + + /** + * Defines the end display symbol info. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolEndIcon?: SymbolGlyphModifier; + + /** + * Defines the end label info like shortcut. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Defines the end label info like shortcut. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the end label info like shortcut. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + labelInfo?: ResourceStr; + + /** + * Create the submenu. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Create the submenu. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Create the submenu. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + builder?: CustomBuilder; +} + +/** + * Defines the MenuItem Component. + * + * @interface MenuItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the MenuItem Component. + * + * @interface MenuItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the MenuItem Component. + * + * @interface MenuItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface MenuItemInterface { + /** + * Creates the MenuItem component. + * + * @param { MenuItemOptions | CustomBuilder } value + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Creates the MenuItem component. + * + * @param { MenuItemOptions | CustomBuilder } value + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Creates the MenuItem component. + * + * @param { MenuItemOptions | CustomBuilder } value + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: MenuItemOptions | CustomBuilder): MenuItemAttribute; +} + +/** + * Defines the MenuItem component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the MenuItem component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the MenuItem component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class MenuItemAttribute extends CommonMethod { + /** + * Setting whether menuItem is selected. + * + * @param { boolean } value + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Setting whether menuItem is selected. + * + * @param { boolean } value + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Setting whether menuItem is selected. + * + * @param { boolean } value + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selected(value: boolean): MenuItemAttribute; + + /** + * Whether the relevant check icon is displayed when a menu item is selected. + * + * @param { boolean } value - Indicates whether to display the check icon when selected. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Whether the relevant check icon is displayed when a menu item is selected. + * Use type ResourceStr to specify icon instead of the default check mark. + * + * @param { boolean | ResourceStr } value - Indicates whether to display icon when selected. + * true: displays the default check mark when selected. + * false: does not displays icon when selected. + * ResourceStr: displays the specified icon when selected. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Whether the relevant check icon is displayed when a menu item is selected. + * Use type ResourceStr to specify icon instead of the default check mark. + * + * @param { boolean | ResourceStr } value - Indicates whether to display icon when selected. + * true: displays the default check mark when selected. + * false: does not displays icon when selected. + * ResourceStr: displays the specified icon when selected. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Whether the relevant check icon is displayed when a menu item is selected. + * Use type ResourceStr or SymbolGlyphModifier to specify icon instead of the default check mark. + * + * @param { boolean | ResourceStr | SymbolGlyphModifier } value - Indicates whether to display icon when selected. + *
true: displays the default check mark when selected. + *
false: does not displays icon when selected. + *
ResourceStr or SymbolGlyphModifier: displays the specified icon when selected. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectIcon(value: boolean | ResourceStr | SymbolGlyphModifier): MenuItemAttribute; + + /** + * Triggers a callback when a menu item is selected or unchecked. + * + * @param { function } callback + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Triggers a callback when a menu item is selected or unchecked. + * + * @param { function } callback + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggers a callback when a menu item is selected or unchecked. + * + * @param { function } callback + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onChange(callback: (selected: boolean) => void): MenuItemAttribute; + + /** + * Sets the content font style. + * Family and style are not supported currently and will be fixed in future. + * + * @param { Font } value - Indicates the font style of content text. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the content font style. + * Family and style are not supported currently and will be fixed in future. + * + * @param { Font } value - Indicates the font style of content text. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + contentFont(value: Font): MenuItemAttribute; + + /** + * Sets the font color of content text. + * + * @param { ResourceColor } value - Indicates the font color of content text. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the font color of content text. + * + * @param { ResourceColor } value - Indicates the font color of content text. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + contentFontColor(value: ResourceColor): MenuItemAttribute; + + /** + * Sets the label info font style. + * Family and style are not supported currently and will be fixed in future. + * + * @param { Font } value - Indicates the font style of label info text. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the label info font style. + * Family and style are not supported currently and will be fixed in future. + * + * @param { Font } value - Indicates the font style of label info text. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + labelFont(value: Font): MenuItemAttribute; + + /** + * Sets the font color of label info text. + * + * @param { ResourceColor } value - Indicates the font color of label info text. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the font color of label info text. + * + * @param { ResourceColor } value - Indicates the font color of label info text. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + labelFontColor(value: ResourceColor): MenuItemAttribute; +} + +/** + * Defines MenuItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines MenuItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines MenuItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const MenuItem: MenuItemInterface; + +/** + * Defines MenuItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines MenuItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines MenuItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const MenuItemInstance: MenuItemAttribute; diff --git a/tests/arkts-sdk/ets/menu_item_group.d.ts b/tests/arkts-sdk/ets/menu_item_group.d.ts new file mode 100644 index 00000000..e7e7b892 --- /dev/null +++ b/tests/arkts-sdk/ets/menu_item_group.d.ts @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2022-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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the option of MenuItemGroup. + * + * @interface MenuItemGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the option of MenuItemGroup. + * + * @interface MenuItemGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the option of MenuItemGroup. + * + * @interface MenuItemGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MenuItemGroupOptions { + /** + * Defines the header display info. + * + * @type { ?(ResourceStr | CustomBuilder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Defines the header display info. + * + * @type { ?(ResourceStr | CustomBuilder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the header display info. + * + * @type { ?(ResourceStr | CustomBuilder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + header?: ResourceStr | CustomBuilder; + + /** + * Defines the footer display info. + * + * @type { ?(ResourceStr | CustomBuilder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Defines the footer display info. + * + * @type { ?(ResourceStr | CustomBuilder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the footer display info. + * + * @type { ?(ResourceStr | CustomBuilder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + footer?: ResourceStr | CustomBuilder; +} + +/** + * Defines the MenuItemGroup Component. + * + * @interface MenuItemGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the MenuItemGroup Component. + * + * @interface MenuItemGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the MenuItemGroup Component. + * + * @interface MenuItemGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface MenuItemGroupInterface { + /** + * Creates the MenuItemGroup component. + * + * @param { MenuItemGroupOptions } value + * @returns { MenuItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Creates the MenuItemGroup component. + * + * @param { MenuItemGroupOptions } value + * @returns { MenuItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Creates the MenuItemGroup component. + * + * @param { MenuItemGroupOptions } value + * @returns { MenuItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: MenuItemGroupOptions): MenuItemGroupAttribute; +} + +/** + * Defines the MenuItemGroup component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the MenuItemGroup component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the MenuItemGroup component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class MenuItemGroupAttribute extends CommonMethod {} + +/** + * Defines MenuItemGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines MenuItemGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines MenuItemGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const MenuItemGroup: MenuItemGroupInterface; + +/** + * Defines MenuItemGroup Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines MenuItemGroup Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines MenuItemGroup Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const MenuItemGroupInstance: MenuItemGroupAttribute; diff --git a/tests/arkts-subset/ets/nav_destination.d.ts b/tests/arkts-sdk/ets/nav_destination.d.ts similarity index 76% rename from tests/arkts-subset/ets/nav_destination.d.ts rename to tests/arkts-sdk/ets/nav_destination.d.ts index b0d2a349..18d40665 100644 --- a/tests/arkts-subset/ets/nav_destination.d.ts +++ b/tests/arkts-sdk/ets/nav_destination.d.ts @@ -67,7 +67,16 @@ declare interface NavDestinationCommonTitle { * @atomicservice * @since 11 */ - main: string; + /** + * Sets the main title. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + main: string | Resource; /** * Sets the sub title. @@ -93,7 +102,16 @@ declare interface NavDestinationCommonTitle { * @atomicservice * @since 11 */ - sub: string; + /** + * Sets the sub title. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + sub: string | Resource; } /** @@ -174,6 +192,54 @@ declare interface NavDestinationCustomTitle { height: TitleHeight | Length; } +/** + * Types of system Transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare enum NavigationSystemTransitionType { + /** + * Default system transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + DEFAULT = 0, + /** + * None system transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + NONE = 1, + /** + * Configure only titlebar transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + TITLE = 2, + /** + * Configure only content transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + CONTENT = 3, +} + /** * NavDestination mode. * @@ -379,6 +445,39 @@ declare interface NavDestinationContext { getConfigInRouteMap(): RouteMapConfig | undefined; } +/** + * Indicates the nested scrollable container components. + * + * @interface NestedScrollInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface NestedScrollInfo { + /** + * The controller of parent scrollable container component. + * + * @type { Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + parent: Scroller; + + /** + * The controller of child scrollable container component. + * + * @type { Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + child: Scroller; +} + /** * The attribute function of NavDestination * @@ -442,7 +541,19 @@ declare class NavDestinationAttribute extends CommonMethod | CustomBuilder): NavDestinationAttribute; + /** + * Configure toolbar with default style parameter or custom parameter. + * + * @param { Array | CustomBuilder } toolbarParam - Toolbar configuration parameters. + * @param { NavigationToolbarOptions } [options] - Indicates the options of toolbar. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + toolbarConfiguration(toolbarParam: Array | CustomBuilder, options?: NavigationToolbarOptions): NavDestinationAttribute; + + /** + * Hide tool bar + * + * @param { boolean } hide + * @param { boolean } [animated] + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + hideToolBar(hide: boolean, animated?: boolean): NavDestinationAttribute; + /** * Invoked before sub-components of NavDestination are created. * @@ -674,6 +824,53 @@ declare class NavDestinationAttribute extends CommonMethod): NavDestinationAttribute; + + /** + * Set the NavDestination can be restored after the application is terminated. + * To enable this attribute, recoverable and id of Navigation must be set. + * + * @param { boolean } recoverable - set navdestination can be recovered. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 14 + */ + recoverable(recoverable: Optional): NavDestinationAttribute; + + /** + * Configuration of system transition + * + * @param { NavigationSystemTransitionType } type - Types of system Transition + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + systemTransition(type: NavigationSystemTransitionType): NavDestinationAttribute; + + /** + * Bind NavDestination to scrollable container components to automatically hide titlebar and toolbar. + * + * @param { Array } scrollers - The controllers of the scrollable container components. + * @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + bindToScrollable(scrollers: Array): NavDestinationAttribute; + + /** + * Bind NavDestination to nested scrollable container components to automatically hide titlebar and toolbar. + * + * @param { Array } scrollInfos - The controllers of the nested scrollable container components. + * @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + bindToNestedScrollable(scrollInfos: Array): NavDestinationAttribute; } /** diff --git a/tests/arkts-sdk/ets/nav_router.d.ts b/tests/arkts-sdk/ets/nav_router.d.ts new file mode 100644 index 00000000..9cec64c3 --- /dev/null +++ b/tests/arkts-sdk/ets/nav_router.d.ts @@ -0,0 +1,356 @@ +/* + * Copyright (c) 2022-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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Indicates the information of the route page. + * + * @interface RouteInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Indicates the information of the route page. + * + * @interface RouteInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +declare interface RouteInfo { + /** + * The name of the route page. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The name of the route page. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + name: string; + + /** + * The detailed parameter of the route page. + * + * @type { ?unknown } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The detailed parameter of the route page. + * + * @type { ?unknown } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + param?: unknown; +} + +/** + * The construct function of NavRouter. + * + * @interface NavRouterInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * The construct function of NavRouter. + * + * @interface NavRouterInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The construct function of NavRouter. + * + * @interface NavRouterInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +declare interface NavRouterInterface { + /** + * Constructor. + * + * @returns { NavRouterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Constructor. + * + * @returns { NavRouterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Constructor. + * + * @returns { NavRouterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + (): NavRouterAttribute; + + /** + * NavDestination Constructor. + * + * @param { RouteInfo } value - Indicates the information of route page. + * @returns { NavRouterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * NavDestination Constructor. + * + * @param { RouteInfo } value - Indicates the information of route page. + * @returns { NavRouterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + (value: RouteInfo): NavRouterAttribute; +} + +/** + * Define the route mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define the route mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +declare enum NavRouteMode { + /** + * Create a new page to replace the current. The old page is destroyed but kept in the stack for recreating. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Create a new page to replace the current. The old page is destroyed but kept in the stack for recreating. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + PUSH_WITH_RECREATE, + + /** + * Create a new page to cover the current. The old page is remained and kept in the stack. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Create a new page to cover the current. The old page is remained and kept in the stack. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + PUSH, + + /** + * Create a new page to replace the current. The old page is destroyed and removed out of the stack. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Create a new page to replace the current. The old page is destroyed and removed out of the stack. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + REPLACE +} + +/** + * The attribute function of NavRouter + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * The attribute function of NavRouter + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The attribute function of NavRouter + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +declare class NavRouterAttribute extends CommonMethod { + /** + * Trigger callback when NavigationView state change. + * + * @param { function } callback + * @returns { NavRouterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Trigger callback when NavigationView state change. + * + * @param { function } callback + * @returns { NavRouterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger callback when NavigationView state change. + * + * @param { function } callback + * @returns { NavRouterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + onStateChange(callback: (isActivated: boolean) => void): NavRouterAttribute; + + /** + * Define the route mode. + * + * @param { NavRouteMode } mode - The route mode of the NavRouter. + * @returns { NavRouterAttribute } Returns the instance of the NavRouterAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the route mode. + * + * @param { NavRouteMode } mode - The route mode of the NavRouter. + * @returns { NavRouterAttribute } Returns the instance of the NavRouterAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + mode(mode: NavRouteMode): NavRouterAttribute; +} + +/** + * Defines NavRouter Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines NavRouter Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines NavRouter Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +declare const NavRouter: NavRouterInterface; + +/** + * Defines NavRouter Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines NavRouter Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines NavRouter Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +declare const NavRouterInstance: NavRouterAttribute; diff --git a/tests/arkts-subset/ets/navigation.d.ts b/tests/arkts-sdk/ets/navigation.d.ts similarity index 93% rename from tests/arkts-subset/ets/navigation.d.ts rename to tests/arkts-sdk/ets/navigation.d.ts index b134b2ac..707b2d85 100644 --- a/tests/arkts-subset/ets/navigation.d.ts +++ b/tests/arkts-sdk/ets/navigation.d.ts @@ -77,7 +77,16 @@ declare interface NavigationCommonTitle { * @atomicservice * @since 11 */ - main: string; + /** + * Sets the main title. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + main: string | Resource; /** * Sets the sub title. @@ -103,7 +112,16 @@ declare interface NavigationCommonTitle { * @atomicservice * @since 11 */ - sub: string; + /** + * Sets the sub title. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + sub: string | Resource; } /** @@ -499,7 +517,16 @@ declare interface NavigationMenuItem { * @atomicservice * @since 11 */ - value: string; + /** + * The value of navigation menu item. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + value: string | Resource; /** * The icon of navigation menu item. @@ -525,7 +552,16 @@ declare interface NavigationMenuItem { * @atomicservice * @since 11 */ - icon?: string; + /** + * The value of navigation menu item. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + icon?: string | Resource; /** * The symbol of navigation menu item. @@ -663,13 +699,25 @@ declare class NavPathInfo { * * @param { string } name - The name of NavDestination. * @param { unknown } param - The detailed parameter of the NavDestination. - * @param { import('../api/@ohos.base').Callback } onPop - The callback when next page returns. + * @param { ?import('../api/@ohos.base').Callback } onPop - The callback when next page returns. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ - constructor(name: string, param: unknown, onPop?: import('../api/@ohos.base').Callback); + /** + * Creates an instance of NavPathInfo. + * + * @param { string } name - The name of NavDestination. + * @param { unknown } param - The detailed parameter of the NavDestination. + * @param { ?import('../api/@ohos.base').Callback } onPop - The callback when next page returns. + * @param { ?boolean } isEntry - Indicates whether it is an entry destination. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(name: string, param: unknown, onPop?: import('../api/@ohos.base').Callback, isEntry?: boolean); /** * The name of NavDestination. @@ -727,6 +775,17 @@ declare class NavPathInfo { * @since 12 */ onPop?: import('../api/@ohos.base').Callback; + + /** + * Indicates whether it is an entry destination. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isEntry?: boolean; } /** @@ -1097,6 +1156,26 @@ declare class NavPathStack { */ replacePath(info: NavPathInfo, options?: NavigationOptions): void; + /** + * Replace the NavDestination into the stack. + * + * @param { NavPathInfo } info - Indicates the NavDestination to replace in stack. + * @param { NavigationOptions } [options] - Indicates options of stack operation. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameters types. + * 3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + replaceDestination(info: NavPathInfo, options?: NavigationOptions): Promise; + /** * Replace the current NavDestination with the specific one.The current NavDestination will be destroyed. * @@ -1993,6 +2072,40 @@ declare interface NavigationTitleOptions { * @since 12 */ paddingEnd?: LengthMetrics; + + /** + * Text modifier for main title. + * + * @type { ?TextModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + mainTitleModifier?: TextModifier; + + /** + * Text modifier for sub title. + * + * @type { ?TextModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + subTitleModifier?: TextModifier; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHoverMode?: boolean; } /** @@ -2024,6 +2137,16 @@ declare enum BarStyle { * @since 12 */ STACK = 1, + + /** + * SafeAreaPadding style means the bar height will be taken as content's safeAreaPadding. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + SAFE_AREA_PADDING = 2, } /** @@ -2057,6 +2180,18 @@ declare interface NavigationToolbarOptions { * @since 11 */ backgroundBlurStyle?: BlurStyle; + + /** + * Set tool bar style. + * + * @type { ?BarStyle } + * @default BarStyle.STANDARD + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + barStyle?: BarStyle; } /** @@ -2270,7 +2405,7 @@ declare class NavigationAttribute extends CommonMethod { * @since 10 */ /** - * Hide the NavBar, which includes title bar, the child of Navigation and tool bar. Supported in all mode. + * Hide the NavBar, which includes title bar, the child of Navigation and tool bar. Supported in all mode. * It will show top page in the NavPathStack directly or empty if there is no page in the NavPathStack. * * @param { boolean } value @@ -2361,6 +2496,19 @@ declare class NavigationAttribute extends CommonMethod { */ hideTitleBar(value: boolean): NavigationAttribute; + /** + * Hide navigation title bar + * + * @param { boolean } hide + * @param { boolean } animated + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + hideTitleBar(hide: boolean, animated: boolean): NavigationAttribute; + /** * Hide navigation back button * @@ -2513,6 +2661,19 @@ declare class NavigationAttribute extends CommonMethod { */ hideToolBar(value: boolean): NavigationAttribute; + /** + * Hide tool bar + * + * @param { boolean } hide + * @param { boolean } animated + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + hideToolBar(hide: boolean, animated: boolean): NavigationAttribute; + /** * Trigger callback when title mode change finished at free mode. * @@ -2648,6 +2809,29 @@ declare class NavigationAttribute extends CommonMethod { * @since 12 */ systemBarStyle(style: Optional): NavigationAttribute; + + /** + * Set the Navigation can be restored after the application is terminated. + * To enable this attribute, a navigation id must be set. + * + * @param { boolean } recoverable - navigation can be recovered. + * @returns { NavigationAttribute } Returns the instance of the NavigationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 14 + */ + recoverable(recoverable: Optional): NavigationAttribute; + + /** + * Enable dragbar + * + * @param { Optional } isEnabled - enable dragbar or disable dragbar. + * @returns { NavigationAttribute } Returns the instance of the NavigationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableDragBar(isEnabled: Optional): NavigationAttribute; } /** diff --git a/tests/arkts-sdk/ets/navigator.d.ts b/tests/arkts-sdk/ets/navigator.d.ts new file mode 100644 index 00000000..4d085104 --- /dev/null +++ b/tests/arkts-sdk/ets/navigator.d.ts @@ -0,0 +1,397 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Route jump. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Route jump. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Route jump. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +declare enum NavigationType { + /** + * Jump to the next page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Jump to the next page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Jump to the next page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + Push, + + /** + * Return to the previous page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Return to the previous page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Return to the previous page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + Back, + + /** + * Replace page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Replace page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Replace page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + Replace, +} + +/** + * Create route + * + * @interface NavigatorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Create route + * + * @interface NavigatorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Create route + * + * @interface NavigatorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +interface NavigatorInterface { + /** + * Called when the route jumps. + * + * @param { object } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the route jumps. + * + * @param { object } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the route jumps. + * + * @param { object } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + (value?: { target: string; type?: NavigationType }): NavigatorAttribute; + + /** + * Called when using the navigator. + * + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when using the navigator. + * + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the navigator. + * + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + (): NavigatorAttribute; +} + +/** + * Declare navigator properties. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare navigator properties. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare navigator properties. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +declare class NavigatorAttribute extends CommonMethod { + /** + * Called when determining whether the routing component is active. + * + * @param { boolean } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when determining whether the routing component is active. + * + * @param { boolean } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when determining whether the routing component is active. + * + * @param { boolean } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + active(value: boolean): NavigatorAttribute; + + /** + * Called when determining whether the routing component is active. + * + * @param { NavigationType } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when determining whether the routing component is active. + * + * @param { NavigationType } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when determining whether the routing component is active. + * + * @param { NavigationType } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + type(value: NavigationType): NavigatorAttribute; + + /** + * Called when the path to the specified jump target page is set. + * + * @param { string } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the path to the specified jump target page is set. + * + * @param { string } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the path to the specified jump target page is set. + * + * @param { string } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + target(value: string): NavigatorAttribute; + + /** + * Called when data is passed to the target page at the same time during jump. + * + * @param { object } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when data is passed to the target page at the same time during jump. + * + * @param { object } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when data is passed to the target page at the same time during jump. + * + * @param { object } value + * @returns { NavigatorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ + params(value: object): NavigatorAttribute; +} + +/** + * Defines Navigator Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Navigator Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Navigator Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +declare const Navigator: NavigatorInterface; + +/** + * Defines Navigator Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Navigator Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Navigator Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 13 + */ +declare const NavigatorInstance: NavigatorAttribute; diff --git a/tests/arkts-sdk/ets/node_container.d.ts b/tests/arkts-sdk/ets/node_container.d.ts new file mode 100644 index 00000000..074ad34b --- /dev/null +++ b/tests/arkts-sdk/ets/node_container.d.ts @@ -0,0 +1,110 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the Interface of NodeContainer. To display the node build by an associated NodeController. + * + * @interface NodeContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the Interface of NodeContainer. To display the node build by an associated NodeController. + * + * @interface NodeContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface NodeContainerInterface { + /** + * Constructor parameters + * + * @param { import('../api/@ohos.arkui.node').NodeController } controller - Indicates the controller of the NodeContainer. + * @returns { NodeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Constructor parameters + * + * @param { import('../api/@ohos.arkui.node').NodeController } controller - Indicates the controller of the NodeContainer. + * @returns { NodeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (controller: import('../api/@ohos.arkui.node').NodeController): NodeContainerAttribute; +} + +/** + * Defines the attribute of NodeContainer, extends from CommonMethod. + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the attribute of NodeContainer, extends from CommonMethod. + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class NodeContainerAttribute extends CommonMethod {} + +/** + * Defines NodeContainer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines NodeContainer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const NodeContainer: NodeContainerInterface; + +/** + * Defines NodeContainer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines NodeContainer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const NodeContainerInstance: NodeContainerAttribute; diff --git a/tests/arkts-sdk/ets/page_transition.d.ts b/tests/arkts-sdk/ets/page_transition.d.ts new file mode 100644 index 00000000..255c2579 --- /dev/null +++ b/tests/arkts-sdk/ets/page_transition.d.ts @@ -0,0 +1,808 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Declare the jump method. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare the jump method. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the jump method. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum RouteType { + /** + * The page is not redirected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The page is not redirected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The page is not redirected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, + + /** + * Go to the next page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Go to the next page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Go to the next page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Push, + + /** + * Redirect to a specified page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Redirect to a specified page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Redirect to a specified page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Pop, +} + +/** + * Declare the sliding effect of transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare the sliding effect of transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the sliding effect of transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SlideEffect { + /** + * Swipe left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Swipe left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Swipe left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Left, + + /** + * Swipe right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Swipe right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Swipe right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Right, + + /** + * Swipe top. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Swipe top. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Swipe top. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Top, + + /** + * Swipe bottom. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Swipe bottom. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Swipe bottom. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * Swipe start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + START = 5, + + /** + * Swipe end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + END = 6, +} + +/** + * Provides interfaces for common transitions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides interfaces for common transitions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides interfaces for common transitions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class CommonTransition { + /** + * Called when a transition method is required. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a transition method is required. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when a transition method is required. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Called when the slide in effect of the transition is set. + * + * @param { SlideEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the slide in effect of the transition is set. + * + * @param { SlideEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the slide in effect of the transition is set. + * + * @param { SlideEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + slide(value: SlideEffect): T; + + /** + * Called when the translation effect of page transition is set. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the translation effect of page transition is set. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the translation effect of page transition is set. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the translation effect of page transition is set. + * + * @param { TranslateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + translate(value: TranslateOptions): T; + + /** + * Called when setting the zoom effect of page transition. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting the zoom effect of page transition. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when setting the zoom effect of page transition. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when setting the zoom effect of page transition. + * + * @param { ScaleOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + scale(value: ScaleOptions): T; + + /** + * Called when the transparency value of the starting point of entry or the ending point of exit is set. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the transparency value of the starting point of entry or the ending point of exit is set. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the transparency value of the starting point of entry or the ending point of exit is set. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + opacity(value: number): T; +} + +/** + * Defines pageTransition constructor parameters. + * + * @interface PageTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines pageTransition constructor parameters. + * + * @interface PageTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines pageTransition constructor parameters. + * + * @interface PageTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PageTransitionOptions { + /** + * RouteType in which the pageTransition can work. + * @type { ?RouteType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * RouteType in which the pageTransition can work. + * @type { ?RouteType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * RouteType in which the pageTransition can work. + * @type { ?RouteType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type?: RouteType; + /** + * PageTransition animation duration, in ms. + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * PageTransition animation duration, in ms. + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * PageTransition animation duration, in ms. + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + duration?: number; + /** + * PageTransition animation curve. + * @type { ?(Curve | string) } + * @default Curve.Linear + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * PageTransition animation curve. + * @type { ?(Curve | string | ICurve) } + * @default Curve.Linear + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * PageTransition animation curve. + * @type { ?(Curve | string | ICurve) } + * @default Curve.Linear + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + curve?: Curve | string | ICurve; + /** + * PageTransition animation delay time, in ms. + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * PageTransition animation delay time, in ms. + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * PageTransition animation delay time, in ms. + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + delay?: number; +} + +/** + * Callback used to report page trasition events. + * + * @typedef { function } PageTransitionCallback + * @param { RouteType } type - transition route type + * @param { number } progress - transition progess + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type PageTransitionCallback = (type: RouteType, progress: number) => void + +/** + * Provides an interface for page rotation mode. + * + * @interface PageTransitionEnterInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface to set transition style when a page enters. + * + * @interface PageTransitionEnterInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface to set transition style when a page enters. + * + * @interface PageTransitionEnterInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface PageTransitionEnterInterface extends CommonTransition { + /** + * Called when page Jump animation is used. + * + * @param { PageTransitionOptions } value + * @returns { PageTransitionEnterInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when page Jump animation is used. + * + * @param { PageTransitionOptions } value - pageTransition options + * @returns { PageTransitionEnterInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when page Jump animation is used. + * + * @param { PageTransitionOptions } value - pageTransition options + * @returns { PageTransitionEnterInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value: PageTransitionOptions): PageTransitionEnterInterface; + + /** + * Called when the incoming parameter is the normalized progress of the current incoming animation. + * + * @param { function } event + * @returns { PageTransitionEnterInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called frame by frame to customize pageTransition animation when the page enters. + * The incoming parameter is the normalized progress of the current incoming animation. + * + * @param { function } event - animation callback frame by frame + * @returns { PageTransitionEnterInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called frame by frame to customize pageTransition animation when the page enters. + * The incoming parameter is the normalized progress of the current incoming animation. + * + * @param { function } event - animation callback frame by frame + * @returns { PageTransitionEnterInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called frame by frame to customize pageTransition animation when the page enters. + * The incoming parameter is the normalized progress of the current incoming animation. + * + * @param { PageTransitionCallback } event - animation callback frame by frame + * @returns { PageTransitionEnterInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onEnter(event: PageTransitionCallback): PageTransitionEnterInterface; +} + +/** + * Provide an interface to exit the transition. + * + * @interface PageTransitionExitInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provide an interface to set transition style when a page exits. + * + * @interface PageTransitionExitInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provide an interface to set transition style when a page exits. + * + * @interface PageTransitionExitInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface PageTransitionExitInterface extends CommonTransition { + /** + * Called when the transition is delayed. + * + * @param { PageTransitionOptions } value + * @returns { PageTransitionExitInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when page Jump animation is used. + * + * @param { PageTransitionOptions } value - pageTransition options + * @returns { PageTransitionExitInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when page Jump animation is used. + * + * @param { PageTransitionOptions } value - pageTransition options + * @returns { PageTransitionExitInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value: PageTransitionOptions): PageTransitionExitInterface; + + /** + * Called when the input parameter is the normalized progress of the current exit animation. + * + * @param { function } event + * @returns { PageTransitionExitInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called frame by frame to customize pageTransition animation when the page exits. + * The input parameter is the normalized progress of the current exit animation. + * + * @param { function } event + * @returns { PageTransitionExitInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called frame by frame to customize pageTransition animation when the page exits. + * The input parameter is the normalized progress of the current exit animation. + * + * @param { function } event + * @returns { PageTransitionExitInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called frame by frame to customize pageTransition animation when the page exits. + * The input parameter is the normalized progress of the current exit animation. + * + * @param { PageTransitionCallback } event + * @returns { PageTransitionExitInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onExit(event: PageTransitionCallback): PageTransitionExitInterface; +} + +/** + * Defines PageTransitionEnter Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines PageTransitionEnter Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PageTransitionEnter Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const PageTransitionEnter: PageTransitionEnterInterface; + +/** + * Defines PageTransitionExit Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines PageTransitionExit Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PageTransitionExit Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const PageTransitionExit: PageTransitionExitInterface; diff --git a/tests/arkts-sdk/ets/panel.d.ts b/tests/arkts-sdk/ets/panel.d.ts new file mode 100644 index 00000000..a4e505d6 --- /dev/null +++ b/tests/arkts-sdk/ets/panel.d.ts @@ -0,0 +1,800 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Sets the initial state of the slidable panel. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Sets the initial state of the slidable panel. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sets the initial state of the slidable panel. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ +declare enum PanelMode { + /** + * Minimum state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Minimum state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Minimum state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + Mini, + + /** + * SHalf-screen-like status + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * SHalf-screen-like status + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * SHalf-screen-like status + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + Half, + + /** + * Class Full Screen Status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Class Full Screen Status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Class Full Screen Status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + Full, +} + +/** + * Sets the type of sliding panel. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Sets the type of sliding panel. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sets the type of sliding panel. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ +declare enum PanelType { + /** + * The switch between the minibar and full-screen display is provided. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The switch between the minibar and full-screen display is provided. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The switch between the minibar and full-screen display is provided. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + Minibar = 0, + + /** + * Permanent content display class. + * The switchover effect is provided in three sizes: large (full-screen), medium (half-screen), and small. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Permanent content display class. + * The switchover effect is provided in three sizes: large (full-screen), medium (half-screen), and small. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Permanent content display class. + * The switchover effect is provided in three sizes: large (full-screen), medium (half-screen), and small. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + Foldable = 1, + + /** + * Temporary content display area. + * The switchover effect is provided in three sizes: large (full-screen), medium (half-screen), and small. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Temporary content display area. + * The switchover effect is provided in three sizes: large (full-screen), medium (half-screen), and small. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Temporary content display area. + * The switchover effect is provided in three sizes: large (full-screen), medium (half-screen), and small. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + Temporary = 2, + + /** + * Custom content display area. + * The switchover effect is provided in three sizes: large (full-screen), medium (half-screen), and small. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Custom content display area. + * The switchover effect is provided in three sizes: large (full-screen), medium (half-screen), and small. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + CUSTOM = 3, +} + +/** + * Enum for custom content display area. + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum for custom content display area. + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ +declare enum PanelHeight { + /** + * The Panel adapts to the content height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Panel adapts to the content height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + WRAP_CONTENT = 'wrapContent', +} + +/** + * Provides a sliding panel interface. + * + * @interface PanelInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides a sliding panel interface. + * + * @interface PanelInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides a sliding panel interface. + * + * @interface PanelInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ +interface PanelInterface { + /** + * Called when the panel slidable panel pops up. + * + * @param { boolean } show + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the panel slidable panel pops up. + * + * @param { boolean } show + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the panel slidable panel pops up. + * + * @param { boolean } show + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + (show: boolean): PanelAttribute; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Pane Attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Pane Attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ +declare class PanelAttribute extends CommonMethod { + /** + * Called when the initial state of the slidable panel is set. + * + * @param { PanelMode } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the initial state of the slidable panel is set. + * + * @param { PanelMode } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the initial state of the slidable panel is set. + * + * @param { PanelMode } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + mode(value: PanelMode): PanelAttribute; + + /** + * Called when the slidable panel type is set. + * + * @param { PanelType } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the slidable panel type is set. + * + * @param { PanelType } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the slidable panel type is set. + * + * @param { PanelType } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + type(value: PanelType): PanelAttribute; + + /** + * Called when determining whether dragbar exists. + * + * @param { boolean } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when determining whether dragbar exists. + * + * @param { boolean } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when determining whether dragbar exists. + * + * @param { boolean } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + dragBar(value: boolean): PanelAttribute; + + /** + * Sets the height. It is valid only when PanelType is set to Custom. + * @param {Dimension | PanelHeight} value - value - Content height to set. + * @returns { PanelAttribute } Returns the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the height. It is valid only when PanelType is set to Custom. + * @param {Dimension | PanelHeight} value - value - Content height to set. + * @returns { PanelAttribute } Returns the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + customHeight(value: Dimension | PanelHeight): PanelAttribute; + + /** + * Called when the height in the full state is specified. + * + * @param { number | string } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the height in the full state is specified. + * + * @param { number | string } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the height in the full state is specified. + * + * @param { number | string } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + fullHeight(value: number | string): PanelAttribute; + + /** + * Called when the height in the half state is specified. + * + * @param { number | string } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the height in the half state is specified. + * + * @param { number | string } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the height in the half state is specified. + * + * @param { number | string } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + halfHeight(value: number | string): PanelAttribute; + + /** + * Called when the height in the mini state is specified. + * + * @param { number | string } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the height in the mini state is specified. + * + * @param { number | string } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the height in the mini state is specified. + * + * @param { number | string } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + miniHeight(value: number | string): PanelAttribute; + + /** + * Called when the panel slidable panel pops up. + * + * @param { boolean } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the panel slidable panel pops up. + * + * @param { boolean } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the panel slidable panel pops up. + * + * @param { boolean } value + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + show(value: boolean): PanelAttribute; + + /** + * Called when the panel background mask is requested. + * + * @param { ResourceColor } color + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the panel background mask is requested. + * + * @param { ResourceColor } color + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the panel background mask is requested. + * + * @param { ResourceColor } color + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + backgroundMask(color: ResourceColor): PanelAttribute; + + /** + * Called when the panel show close icon. + * + * @param { boolean } value - used to set whether to display the close icon. + * @returns { PanelAttribute } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the panel show close icon. + * + * @param { boolean } value - used to set whether to display the close icon. + * @returns { PanelAttribute } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + showCloseIcon(value: boolean): PanelAttribute; + + /** + * Called when the state of the slidable panel changes. + * + * @param { function } event + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the state of the slidable panel changes. + * + * @param { function } event + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the state of the slidable panel changes. + * + * @param { function } event + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + onChange( + event: ( + /** + * Width of content area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Width of content area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + width: number, + + /** + * Height of content area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Height of content area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + height: number, + + /** + * Initial state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Initial state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + mode: PanelMode, + ) => void, + ): PanelAttribute; + + /** + * Called when height of the panel is changed + * + * @param { function } callback + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when height of the panel is changed + * + * @param { function } callback + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when height of the panel is changed + * + * @param { function } callback + * @returns { PanelAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + onHeightChange(callback: (value: number) => void): PanelAttribute; +} + +/** + * Defines Panel Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Panel Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Panel Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead bindSheet + */ +declare const Panel: PanelInterface; + +/** + * Defines Panel Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Panel Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Panel Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + */ +declare const PanelInstance: PanelAttribute; diff --git a/tests/arkts-subset/ets/particle.d.ts b/tests/arkts-sdk/ets/particle.d.ts similarity index 100% rename from tests/arkts-subset/ets/particle.d.ts rename to tests/arkts-sdk/ets/particle.d.ts diff --git a/tests/arkts-sdk/ets/paste_button.d.ts b/tests/arkts-sdk/ets/paste_button.d.ts new file mode 100644 index 00000000..ec2bc5c9 --- /dev/null +++ b/tests/arkts-sdk/ets/paste_button.d.ts @@ -0,0 +1,321 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Enumerates the icon styles. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the icon styles. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum PasteIconStyle { + /** + * Icon rendered as lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Icon rendered as lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + LINES = 0 +} + +/** + * Enumerates the text that can be displayed on the paste button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the text that can be displayed on the paste button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum PasteDescription { + /** + * Paste + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Paste + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + PASTE = 0 +} + +/** + * Declares the interface for setting the paste button options. + * + * @interface PasteButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Declares the interface for setting the paste button options. + * + * @interface PasteButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface PasteButtonOptions { + /** + * Style of the icon to be drawn. + * + * @type { ?PasteIconStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Style of the icon to be drawn. + * + * @type { ?PasteIconStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + icon?: PasteIconStyle; + + /** + * Text to be displayed on the button. + * + * @type { ?PasteDescription } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text to be displayed on the button. + * + * @type { ?PasteDescription } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + text?: PasteDescription; + + /** + * Type of the button. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Type of the button. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + buttonType?: ButtonType; +} + +/** + * Enumerates the click event results of the paste button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the click event results of the paste button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum PasteButtonOnClickResult { + /** + * Success. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Success. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SUCCESS = 0, + + /** + * Failure because the application is not temporarily authorized for accessing the current pasteboard data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Failure because the application is not temporarily authorized for accessing the current pasteboard data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + TEMPORARY_AUTHORIZATION_FAILED = 1 +} + +/** + * Defines the interface for setting a paste button. + * + * @interface PasteButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the interface for setting a paste button. + * + * @interface PasteButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +interface PasteButtonInterface { + /** + * Creates a paste button. + * + * @returns { PasteButtonAttribute } Returns the attribute of the paste button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Creates a paste button. + * + * @returns { PasteButtonAttribute } Returns the attribute of the paste button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + (): PasteButtonAttribute; + + /** + * Creates a paste button with the specified composition. + * If an attribute is not set, the corresponding element will not be drawn. + * + * @param { PasteButtonOptions } options - Indicates the options of the paste button. + * @returns { PasteButtonAttribute } Returns the attribute of the paste button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Creates a paste button with the specified composition. + * If an attribute is not set, the corresponding element will not be drawn. + * + * @param { PasteButtonOptions } options - Indicates the options of the paste button. + * @returns { PasteButtonAttribute } Returns the attribute of the paste button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + (options: PasteButtonOptions): PasteButtonAttribute; +} + +/** + * Defines the attributes of the paste button. + * + * @extends SecurityComponentMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the attributes of the paste button. + * + * @extends SecurityComponentMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare class PasteButtonAttribute extends SecurityComponentMethod { + /** + * Called when the paste button is clicked. + * + * @param { function } event + * @returns { PasteButtonAttribute } Returns the attribute of the paste button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the paste button is clicked. + * + * @param { function } event + * @returns { PasteButtonAttribute } Returns the attribute of the paste button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + onClick(event: (event: ClickEvent, result: PasteButtonOnClickResult) => void): PasteButtonAttribute; +} + +/** + * Defines a button that interacts with the security component service to + * request the permission for accessing the current pasteboard data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines a button that interacts with the security component service to + * request the permission for accessing the current pasteboard data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare const PasteButton: PasteButtonInterface; + +/** + * Defines a paste button instance for secure access. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines a paste button instance for secure access. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare const PasteButtonInstance: PasteButtonAttribute; diff --git a/tests/arkts-sdk/ets/path.d.ts b/tests/arkts-sdk/ets/path.d.ts new file mode 100644 index 00000000..40bb792e --- /dev/null +++ b/tests/arkts-sdk/ets/path.d.ts @@ -0,0 +1,405 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Define options used to construct a path. + * + * @interface PathOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface PathOptions { + /** + * Width option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Width option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Width option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Width option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: number | string; + + /** + * Height option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Height option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Height option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Height option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: number | string; + + /** + * Commands option. + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Commands option. + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Commands option. + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Commands option. + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + commands?: string +} + +/** + * Provides the path drawing interface. + * + * @interface PathInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides the path drawing interface. + * + * @interface PathInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides the path drawing interface. + * + * @interface PathInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides the path drawing interface. + * + * @interface PathInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface PathInterface { + /** + * Use new to create Path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Use new to create Path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Use new to create Path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Use new to create Path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Use new to create Path. + * + * @param { PathOptions } [options] - path options + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + new (options?: PathOptions): PathAttribute; + + /** + * Called when drawing path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when drawing path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when drawing path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when drawing path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when drawing path. + * + * @param { PathOptions } [options] - path options + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options?: PathOptions): PathAttribute; +} + +/** + * Provides methods for attribute path component. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides methods for attribute path component. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides methods for attribute path component. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides methods for attribute path component. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class PathAttribute extends CommonShapeMethod { + /** + * Called when the command string drawn by the path is set. + * + * @param { string } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the command string drawn by the path is set. + * + * @param { string } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the command string drawn by the path is set. + * + * @param { string } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the command string drawn by the path is set. + * + * @param { string } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + commands(value: string): PathAttribute; +} + +/** + * Defines Path Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Path Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Path Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Path Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Path: PathInterface; + +/** + * Defines Path Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Path Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Path Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Path Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const PathInstance: PathAttribute; diff --git a/tests/arkts-sdk/ets/pattern_lock.d.ts b/tests/arkts-sdk/ets/pattern_lock.d.ts new file mode 100644 index 00000000..b2a173ba --- /dev/null +++ b/tests/arkts-sdk/ets/pattern_lock.d.ts @@ -0,0 +1,643 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * The challenge result based on input pattern for control pattern lock component. + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * The challenge result based on input pattern for control pattern lock component. + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum PatternLockChallengeResult { + /** + * The challenge result is correct. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The challenge result is correct. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CORRECT = 1, + /** + * The challenge result is wrong. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The challenge result is wrong. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + WRONG = 2 +} + +/** + * Defines the options of active circle style. + * + * @interface CircleStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CircleStyleOptions { + /** + * The circle color when cell is active state. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * The circle radius when cell is active state. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius?: LengthMetrics; + + /** + * Enable the wave effect when cell is active. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableWaveEffect?: boolean; +} + +/** + * Provides methods for control pattern lock component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Provides methods for control pattern lock component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides methods for control pattern lock component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class PatternLockController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(); + + /** + * Reset pattern lock. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Reset pattern lock. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Reset pattern lock. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reset(); + + /** + * Set challenge result. + * @param { PatternLockChallengeResult } result - The challenge result based on input pattern. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set challenge result. + * @param { PatternLockChallengeResult } result - The challenge result based on input pattern. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setChallengeResult(result: PatternLockChallengeResult): void; +} + +/** + * Provides an interface for generating PatternLock. + * + * @interface PatternLockInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Provides an interface for generating PatternLock. + * + * @interface PatternLockInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for generating PatternLock. + * + * @interface PatternLockInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PatternLockInterface { + /** + * Constructor. + * + * @param { PatternLockController } [controller] - controller + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Constructor. + * + * @param { PatternLockController } [controller] controller + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Constructor. + * + * @param { PatternLockController } [controller] controller + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (controller?: PatternLockController): PatternLockAttribute; +} + +/** + * Provides methods for attribute pattern lock component. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Provides methods for attribute pattern lock component. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides methods for attribute pattern lock component. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class PatternLockAttribute extends CommonMethod { + /** + * The square side length of pattern lock component. + * + * @param { Length } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The square side length of pattern lock component. + * + * @param { Length } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The square side length of pattern lock component. + * + * @param { Length } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + sideLength(value: Length): PatternLockAttribute; + + /** + * Circle radius. + * + * @param { Length } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Circle radius. + * + * @param { Length } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Circle radius. + * + * @param { Length } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + circleRadius(value: Length): PatternLockAttribute; + + /** + * The background color. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The background color. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The background color. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor(value: ResourceColor): PatternLockAttribute; + + /** + * Regular color. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Regular color. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Regular color. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + regularColor(value: ResourceColor): PatternLockAttribute; + + /** + * The color when cell is selected. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The color when cell is selected. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The color when cell is selected. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedColor(value: ResourceColor): PatternLockAttribute; + + /** + * The color when cell is active state. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The color when cell is active state. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The color when cell is active state. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + activeColor(value: ResourceColor): PatternLockAttribute; + + /** + * The path line color. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The path line color. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The path line color. + * + * @param { ResourceColor } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pathColor(value: ResourceColor): PatternLockAttribute; + + /** + * The path line stroke width. + * + * @param { number | string } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The path line stroke width. + * + * @param { number | string } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The path line stroke width. + * + * @param { number | string } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pathStrokeWidth(value: number | string): PatternLockAttribute; + + /** + * Called when the pattern input completed. + * + * @param { function } callback + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the pattern input completed. + * + * @param { function } callback + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the pattern input completed. + * + * @param { function } callback + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onPatternComplete(callback: (input: Array) => void): PatternLockAttribute; + + /** + * Called when judging whether the input state can be reset by touch pattern lock. + * + * @param { boolean } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when judging whether the input state can be reset by touch pattern lock. + * + * @param { boolean } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether the input state can be reset by touch pattern lock. + * + * @param { boolean } value + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + autoReset(value: boolean): PatternLockAttribute; + + /** + * Called when connecting to a grid dot. + * @param { import('../api/@ohos.base').Callback } callback - A callback instance used when connection to a grid dot. + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when connecting to a grid dot. + * @param { import('../api/@ohos.base').Callback } callback - A callback instance used when connection to a grid dot. + * @returns { PatternLockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDotConnect(callback: import('../api/@ohos.base').Callback): PatternLockAttribute; + + /** + * The activate circle style. + * + * @param { Optional } options - the circle style setting options + * @returns { PatternLockAttribute } PatternLockAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + activateCircleStyle(options: Optional): PatternLockAttribute; +} + +/** + * Defines PatternLock Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines PatternLock Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PatternLock Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const PatternLock: PatternLockInterface; + +/** + * Defines PatternLock Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines PatternLock Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PatternLock Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const PatternLockInstance: PatternLockAttribute; diff --git a/tests/arkts-sdk/ets/plugin_component.d.ts b/tests/arkts-sdk/ets/plugin_component.d.ts new file mode 100644 index 00000000..93b9b763 --- /dev/null +++ b/tests/arkts-sdk/ets/plugin_component.d.ts @@ -0,0 +1,213 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * PluginComponentTemplate + * + * @interface PluginComponentTemplate + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +interface PluginComponentTemplate { + /** + * Defines the plugin source name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + source: string; + /** + * Defines the bundle name of the Template. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + bundleName: string; +} + +/** + * Define options used to construct a plugin component. + * + * @interface PluginComponentOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ +declare interface PluginComponentOptions { + /** + * Plugin component template. + * @type { PluginComponentTemplate } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + template: PluginComponentTemplate; + + /** + * Plugin component data. + * @type { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + data: any +} + +/** + * Data provided when an error occurs. + * + * @interface PluginErrorData + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ +declare interface PluginErrorData { + /** + * Error code. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + errcode: number; + + /** + * Error message. + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + msg: string; +} + +/** + * Callback invoked when an error occurs. + * + * @typedef { function } PluginErrorCallback + * @param { PluginErrorData } info - Plugin error data + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ +declare type PluginErrorCallback = (info: PluginErrorData) => void + +/** + * Provides plugin component. + * + * @interface PluginComponentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +interface PluginComponentInterface { + /** + * Called when setting the plugin. + * + * @param { object } value + * @returns { PluginComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + /** + * Called when setting the plugin. + * + * @param { PluginComponentOptions } options - Plugin component options + * @returns { PluginComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + (options: PluginComponentOptions): PluginComponentAttribute; +} + +/** + * Defines the plugin component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +declare class PluginComponentAttribute extends CommonMethod { + /** + * pluginComponent onComplete callback, + * + * @param { function } callback + * @returns { PluginComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + /** + * PluginComponent onComplete callback + * + * @param { VoidCallback } callback + * @returns { PluginComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + onComplete(callback: VoidCallback): PluginComponentAttribute; + + /** + * pluginComponent onError callback, + * + * @param { function } callback + * @returns { PluginComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + /** + * PluginComponent onError callback + * + * @param { PluginErrorCallback } callback + * @returns { PluginComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + onError(callback: PluginErrorCallback): PluginComponentAttribute; +} + +/** + * Defines PluginComponent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +declare const PluginComponent: PluginComponentInterface; + +/** + * Defines PluginComponent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +declare const PluginComponentInstance: PluginComponentAttribute; diff --git a/tests/arkts-sdk/ets/polygon.d.ts b/tests/arkts-sdk/ets/polygon.d.ts new file mode 100644 index 00000000..7221f295 --- /dev/null +++ b/tests/arkts-sdk/ets/polygon.d.ts @@ -0,0 +1,372 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Define options used to construct a polygon. + * + * @interface PolygonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface PolygonOptions { + /** + * Polygon width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Polygon width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Polygon width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Polygon width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: string | number; + + /** + * Polygon height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Polygon height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Polygon height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Polygon height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: string | number +} + +/** + * Provides the polygon drawing interface. + * + * @interface PolygonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides the polygon drawing interface. + * + * @interface PolygonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides the polygon drawing interface. + * + * @interface PolygonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides the polygon drawing interface. + * + * @interface PolygonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface PolygonInterface { + /** + * Uses new to create Polygon. + * + * @since 7 + */ + /** + * Uses new to create Polygon. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Uses new to create Polygon. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Uses new to create Polygon. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Uses new to create Polygon. + * + * @param { PolygonOptions } [options] - Polygon options + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + new (options?: PolygonOptions): PolygonAttribute; + + /** + * Called when drawing a polygon. + * + * @param { object } value + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when drawing a polygon. + * + * @param { object } value + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when drawing a polygon. + * + * @param { object } value + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when drawing a polygon. + * + * @param { object } value + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when drawing a polygon. + * + * @param { PolygonOptions } [options] - Polygon options + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options?: PolygonOptions): PolygonAttribute; +} + +/** + * Provides attribute for Polygon. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides attribute for Polygon. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides attribute for Polygon. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides attribute for Polygon. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class PolygonAttribute extends CommonShapeMethod { + /** + * Called when the vertex coordinate list of a polygon is set. + * + * @param { Array } value + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the vertex coordinate list of a polygon is set. + * + * @param { Array } value + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the vertex coordinate list of a polygon is set. + * + * @param { Array } value + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the vertex coordinate list of a polygon is set. + * + * @param { Array } value + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + points(value: Array): PolygonAttribute; +} + +/** + * Defines Polygon Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines CheckboxGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines CheckboxGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines CheckboxGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Polygon: PolygonInterface; + +/** + * Defines Polygon Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Polygon Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Polygon Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Polygon Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const PolygonInstance: PolygonAttribute; diff --git a/tests/arkts-sdk/ets/polyline.d.ts b/tests/arkts-sdk/ets/polyline.d.ts new file mode 100644 index 00000000..2f4eae9f --- /dev/null +++ b/tests/arkts-sdk/ets/polyline.d.ts @@ -0,0 +1,365 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Define options used to construct a polyline. + * + * @interface PolylineOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface PolylineOptions { + /** + * Polyline width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Polyline width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Polyline width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Polyline width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: string | number; + + /** + * Polyline height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Polyline height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Polyline height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Polyline height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: string | number +} + +/** + * Provides an interface for drawing polylines. + * + * @interface PolylineInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for drawing polylines. + * + * @interface PolylineInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides an interface for drawing polylines. + * + * @interface PolylineInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for drawing polylines. + * + * @interface PolylineInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface PolylineInterface { + /** + * Uses new to create Polyline. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Uses new to create Polyline. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Uses new to create Polyline. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Uses new to create Polyline. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Uses new to create Polyline. + * + * @param { PolylineOptions } [options] - Poly line options + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + new (options?: PolylineOptions): PolylineAttribute; + + /** + * Called when using the draw fold. + * + * @param { object } value + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when using the draw fold. + * + * @param { object } value + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when using the draw fold. + * + * @param { object } value + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when using the draw fold. + * + * @param { object } value + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when using the draw fold. + * + * @param { PolylineOptions } [options] - Poly line options + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options?: PolylineOptions): PolylineAttribute; +} + +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class PolylineAttribute extends CommonShapeMethod { + /** + * Called when the polyline is set to pass through the coordinate point list. + * + * @param { Array } value + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the polyline is set to pass through the coordinate point list. + * + * @param { Array } value + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the polyline is set to pass through the coordinate point list. + * + * @param { Array } value + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the polyline is set to pass through the coordinate point list. + * + * @param { Array } value + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + points(value: Array): PolylineAttribute; +} + +/** + * Defines Polyline Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Polyline Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Polyline Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Polyline Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Polyline: PolylineInterface; + +/** + * Defines Polyline Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Polyline Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Polyline Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Polyline Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const PolylineInstance: PolylineAttribute; diff --git a/tests/arkts-sdk/ets/progress.d.ts b/tests/arkts-sdk/ets/progress.d.ts new file mode 100644 index 00000000..b5438e4b --- /dev/null +++ b/tests/arkts-sdk/ets/progress.d.ts @@ -0,0 +1,1634 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the option of Progress. + * + * @interface ProgressOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the option of Progress. + * + * @interface ProgressOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the option of Progress. + * + * @interface ProgressOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the option of Progress. + * + * @interface ProgressOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ProgressOptions { + /** + * Sets the value of Progress. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the value of Progress. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the value of Progress. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the value of Progress. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + value: number; + + /** + * Sets the total of Progress. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the total of Progress. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the total of Progress. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the total of Progress. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + total?: number; + + /** + * Sets the style of Progress. + * + * @type { ?ProgressStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 8 + * @useinstead type + */ + style?: ProgressStyle + + /** + * Sets the type of Progress. + * + * @type { ?Type } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the type of Progress. + * + * @type { ?Type } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the type of Progress. + * + * @type { ?Type } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the type of Progress. + * + * @type { ?Type } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + type?: Type +} + +/** + * Type of progress bar + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Type of progress bar + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Type of progress bar + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Type of progress bar + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ProgressType { + /** + * Linear progress bar style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Linear progress bar style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Linear progress bar style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Linear progress bar style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Linear = 0, + + /** + * Ring progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Ring progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Ring progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Ring progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Ring = 1, + + /** + * Eclipse progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Eclipse progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Eclipse progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Eclipse progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Eclipse = 2, + + /** + * ScaleRing progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * ScaleRing progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * ScaleRing progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * ScaleRing progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + ScaleRing = 3, + + /** + * Capsule progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Capsule progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Capsule progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Capsule progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Capsule = 4 +} + +/** + * Current status of progress bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Current status of progress bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ProgressStatus { + /** + * Loading status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Loading status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LOADING, + + /** + * Processing status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Processing status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + PROGRESSING +} + +/** + * Defines style options for progress component. + * + * @interface ProgressStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines style options for progress component. + * + * @interface ProgressStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines style options for progress component. + * + * @interface ProgressStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines style options for progress component. + * + * @interface ProgressStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ProgressStyleOptions extends CommonProgressStyleOptions { + /** + * Defines the strokeWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the strokeWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the strokeWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the strokeWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeWidth?: Length; + + /** + * Defines the scaleCount property. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the scaleCount property. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the scaleCount property. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the scaleCount property. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scaleCount?: number; + + /** + * Defines the scaleWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the scaleWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the scaleWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the scaleWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scaleWidth?: Length; +} + +/** + * Progress common style options. + * + * @interface CommonProgressStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Progress common style options. + * + * @interface CommonProgressStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface CommonProgressStyleOptions { + /** + * Enable smooth effect. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Enable smooth effect. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableSmoothEffect?: boolean; +} + +/** + * Defines the enable scan effect. + * + * @interface ScanEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the enable scan effect. + * + * @interface ScanEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ScanEffectOptions { + /** + * Enable scan effect. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Enable scan effect. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableScanEffect?: boolean; +} + +/** + * Defines the Eclipse style Options. + * + * @interface EclipseStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the Eclipse style Options. + * + * @interface EclipseStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface EclipseStyleOptions extends CommonProgressStyleOptions { + +} + +/** + * Defines the ScaleRing style Options. + * + * @interface ScaleRingStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the ScaleRing style Options. + * + * @interface ScaleRingStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ScaleRingStyleOptions extends CommonProgressStyleOptions { + /** + * Defines the strokeWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the strokeWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeWidth?: Length; + + /** + * Defines the scaleWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the scaleWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scaleWidth?: Length; + + /** + * Defines the scaleCount property. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the scaleCount property. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scaleCount?: number; +} + +/** + * Defines the ring style Options. + * + * @interface RingStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the ring style Options. + * + * @interface RingStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RingStyleOptions extends ScanEffectOptions, CommonProgressStyleOptions { + /** + * Defines the strokeWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the strokeWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeWidth?: Length; + + /** + * Enables progress shadow. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Enables progress shadow. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + shadow?: boolean; + + /** + * The status of progress, default is PROGRESSING. Set to LOADING status will trigger the loading animation. + * + * @type { ?ProgressStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The status of progress, default is PROGRESSING. Set to LOADING status will trigger the loading animation. + * + * @type { ?ProgressStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + status?: ProgressStatus; +} + +/** + * Defines the linear style Options. + * + * @interface LinearStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the linear style Options. + * + * @interface LinearStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface LinearStyleOptions extends ScanEffectOptions, CommonProgressStyleOptions { + /** + * Defines the strokeWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the strokeWidth property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeWidth?: Length; + /** + * Defines the stroke radius property. + * + * @type { ?(PX | VP | LPX | Resource) } + * @default strokeWidth / 2 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the stroke radius property. + * + * @type { ?(PX | VP | LPX | Resource) } + * @default strokeWidth / 2 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeRadius?: PX | VP | LPX | Resource; +} + +/** + * Defines the capsule style Options. + * + * @interface CapsuleStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the capsule style Options. + * + * @interface CapsuleStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface CapsuleStyleOptions extends ScanEffectOptions, CommonProgressStyleOptions { + /** + * Set the inner border color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set the inner border color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + borderColor?: ResourceColor; + + /** + * Set the border width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set the border width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + borderWidth?: Length; + + /** + * Set the text content. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set the text content. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + content?: string; + + /** + * Set the text style. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set the text style. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font?: Font; + + /** + * Set the text fontColor. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set the text fontColor. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor?: ResourceColor; + + /** + * show default percentage. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * show default percentage. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showDefaultPercentage?: boolean; +} + +/** + * Type of progress bar + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Type of progress bar + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Type of progress bar + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Type of progress bar + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ProgressStyle { + /** + * Linear progress bar style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Linear progress bar style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Linear progress bar style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Linear progress bar style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Linear, + + /** + * Ring progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Ring progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Ring progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Ring progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Ring, + + /** + * Eclipse progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Eclipse progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Eclipse progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Eclipse progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Eclipse, + + /** + * ScaleRing progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * ScaleRing progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * ScaleRing progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * ScaleRing progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + ScaleRing, + + /** + * Capsule progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Capsule progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Capsule progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Capsule progress bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Capsule, +} + +/** + * Defines the map for progress type and style. + * + * @interface ProgressStyleMap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the map for progress type and style. + * + * @interface ProgressStyleMap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface ProgressStyleMap { + /** + * Defines the map for Linear progress. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the map for Linear progress. + * + * @type { LinearStyleOptions | ProgressStyleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + [ProgressType.Linear]: LinearStyleOptions | ProgressStyleOptions; + + /** + * Defines the map for Ring progress. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the map for Ring progress. + * + * @type { RingStyleOptions | ProgressStyleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + [ProgressType.Ring]: RingStyleOptions | ProgressStyleOptions; + + /** + * Defines the map for Eclipse progress. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the map for Eclipse progress. + * + * @type { EclipseStyleOptions | ProgressStyleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + [ProgressType.Eclipse]: EclipseStyleOptions | ProgressStyleOptions; + + /** + * Defines the map for ScaleRing progress. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the map for ScaleRing progress. + * + * @type { ScaleRingStyleOptions | ProgressStyleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + [ProgressType.ScaleRing]: ScaleRingStyleOptions | ProgressStyleOptions; + + /** + * Defines the map for Capsule progress. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the map for Capsule progress. + * + * @type { CapsuleStyleOptions | ProgressStyleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + [ProgressType.Capsule]: CapsuleStyleOptions | ProgressStyleOptions; +} + +/** + * Provides the progress bar interface. + * + * @interface ProgressInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides the progress bar interface. + * + * @interface ProgressInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides the progress bar interface. + * + * @interface ProgressInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides the progress bar interface. + * + * @interface ProgressInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ProgressInterface { + /** + * Called when the progress bar is set. + * + * @param { ProgressOptions } options + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the progress bar is set. + * + * @param { ProgressOptions } options + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the progress bar is set. + * + * @param { ProgressOptions } options + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the progress bar is set. + * + * @param { ProgressOptions } options + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (options: ProgressOptions): ProgressAttribute; +} + +/** + * Defines the progress attribute functions. + * + * @extends CommonMethod> + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the progress attribute functions. + * + * @extends CommonMethod> + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the progress attribute functions. + * + * @extends CommonMethod> + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the progress attribute functions. + * + * @extends CommonMethod> + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ProgressAttribute extends CommonMethod> { + /** + * Called when the current progress value is set. + * + * @param { number } value + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the current progress value is set. + * + * @param { number } value + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the current progress value is set. + * + * @param { number } value + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the current progress value is set. + * + * @param { number } value + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + value(value: number): ProgressAttribute; + + /** + * Called when the progress bar foreground is set. + * + * @param { ResourceColor | LinearGradient } value + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the progress bar foreground is set. + * + * @param { ResourceColor | LinearGradient } value + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the progress bar foreground is set. + * + * @param { ResourceColor | LinearGradient } value - indicates the color of the progress. + * @returns { ProgressAttribute } the attribute of the progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the progress bar foreground is set. + * + * @param { ResourceColor | LinearGradient } value - indicates the color of the progress. + * @returns { ProgressAttribute } the attribute of the progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color(value: ResourceColor | LinearGradient): ProgressAttribute; + + /** + * Called when the style of progress bar is set. + * + * @param { Style } value + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the style of progress bar is set. + * + * @param { Style } value + * @returns { ProgressAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the style of progress bar is set. + * + * @param { Style } value - indicates the style of the progress. + * @returns { ProgressAttribute } the attribute of the progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the style of progress bar is set. + * + * @param { Style } value - indicates the style of the progress. + * @returns { ProgressAttribute } the attribute of the progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + style(value: Style): ProgressAttribute; + + /** + * Sets if mark to privacy sensitive. + * + * @param { Optional } isPrivacySensitiveMode - indicates if mark to privacy sensitive. + * @returns { ProgressAttribute } the attribute of the progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + privacySensitive(isPrivacySensitiveMode: Optional): ProgressAttribute; + + /** + * Set the contentModifier of progress. + * + * @param { ContentModifier } modifier - The contentModifier of progress. + * @returns { ProgressAttribute } the attribute of the progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): ProgressAttribute; +} + +/** + * ProgressConfiguration used by progress contentModifier + * + * @interface ProgressConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ProgressConfiguration extends CommonConfiguration { + /** + * The value of Progress. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value: number; + + /** + * The total of Progress. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + total: number; +} + +/** + * Defines Progress Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Progress Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Progress Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Progress Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Progress: ProgressInterface; + +/** + * Defines Progress Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Progress Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Progress Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Progress Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ProgressInstance: ProgressAttribute; diff --git a/tests/arkts-sdk/ets/qrcode.d.ts b/tests/arkts-sdk/ets/qrcode.d.ts new file mode 100644 index 00000000..ccc47f7c --- /dev/null +++ b/tests/arkts-sdk/ets/qrcode.d.ts @@ -0,0 +1,294 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides an interface for generating QR codes. + * + * @interface QRCodeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for generating QR codes. + * + * @interface QRCodeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides an interface for generating QR codes. + * + * @interface QRCodeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for generating QR codes. + * + * @interface QRCodeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface QRCodeInterface { + /** + * Called when a QR code is set. + * + * @param { string } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a QR code is set. + * + * @param { string } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when a QR code is set. + * + * @param { string } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when a QR code is set. + * + * @param { string } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (value: string): QRCodeAttribute; +} + +/** + * Defines the qrcode attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the qrcode attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the qrcode attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the qrcode attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class QRCodeAttribute extends CommonMethod { + /** + * Called when the QR code color is set. + * + * @param { ResourceColor } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the QR code color is set. + * + * @param { ResourceColor } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the QR code color is set. + * + * @param { ResourceColor } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the QR code color is set. + * + * @param { ResourceColor } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color(value: ResourceColor): QRCodeAttribute; + + /** + * Called when setting the QR code background color. + * + * @param { ResourceColor } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting the QR code background color. + * + * @param { ResourceColor } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when setting the QR code background color. + * + * @param { ResourceColor } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting the QR code background color. + * + * @param { ResourceColor } value + * @returns { QRCodeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundColor(value: ResourceColor): QRCodeAttribute; + + /** + * Set the opacity of the QR code content color. + * @param { number | Resource } value - indicates the opacity of the QR code content color. The value is between 0 and 1, with a default value of 1. + * @returns { QRCodeAttribute } the attribute of the QR code + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the opacity of the QR code content color. + * @param { number | Resource } value - indicates the opacity of the QR code content color. The value is between 0 and 1, with a default value of 1. + * @returns { QRCodeAttribute } the attribute of the QR code + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentOpacity(value: number | Resource): QRCodeAttribute; +} + +/** + * Defines QRCode Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines QRCode Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines QRCode Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines QRCode Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const QRCode: QRCodeInterface; + +/** + * Defines QRCode Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines QRCode Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines QRCode Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines QRCode Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const QRCodeInstance: QRCodeAttribute; diff --git a/tests/arkts-sdk/ets/radio.d.ts b/tests/arkts-sdk/ets/radio.d.ts new file mode 100644 index 00000000..bf2c66ea --- /dev/null +++ b/tests/arkts-sdk/ets/radio.d.ts @@ -0,0 +1,607 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the IndicatorType of Radio component + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum RadioIndicatorType { + /** + * Tick shape. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + TICK = 0, + /** + * Dot shape. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DOT = 1, + /** + * custom shape. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + CUSTOM = 2, +} + +/** + * Input parameter for creating a radio box. + * + * @interface RadioOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Input parameter for creating a radio box. + * + * @interface RadioOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Input parameter for creating a radio box. + * + * @interface RadioOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Input parameter for creating a radio box. + * + * @interface RadioOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface RadioOptions { + /** + * Radio group name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Radio group name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Radio group name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Radio group name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + group: string; + + /** + * Radio name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Radio name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Radio name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Radio name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + value: string; + /** + * Indicator Type. + * + * @type { ?RadioIndicatorType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + indicatorType?: RadioIndicatorType; + /** + * builder for IndicatorType.CUSTOM + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + indicatorBuilder?: CustomBuilder; +} + +/** + * Set radio Style. + * + * @interface RadioStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Set radio Style. + * + * @interface RadioStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RadioStyle { + /** + * Set the background color when the radio box is checked. + * + * @type { ?ResourceColor } checkedBackgroundColor - the background color when the radio box is checked. + * @default #007DFF + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the background color when the radio box is checked. + * + * @type { ?ResourceColor } checkedBackgroundColor - the background color when the radio box is checked. + * @default #007DFF + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + checkedBackgroundColor?: ResourceColor; + + /** + * Set the bolder color when the radio box is unchecked. + * + * @type { ?ResourceColor } uncheckedBorderColor - the bolder color when the radio box is unchecked. + * @default #182431 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the bolder color when the radio box is unchecked. + * + * @type { ?ResourceColor } uncheckedBorderColor - the bolder color when the radio box is unchecked. + * @default #182431 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + uncheckedBorderColor?: ResourceColor; + + /** + * Set the indicator color when the radio box is checked. + * + * @type { ?ResourceColor } indicatorColor - the indicator color when the radio box is checked. + * @default #FFFFFF + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the indicator color when the radio box is checked. + * + * @type { ?ResourceColor } indicatorColor - the indicator color when the radio box is checked. + * @default #FFFFFF + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + indicatorColor?: ResourceColor; +} + +/** + * Provides an interface for creating a radio box. + * + * @interface RadioInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides an interface for creating a radio box. + * + * @interface RadioInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides an interface for creating a radio box. + * + * @interface RadioInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for creating a radio box. + * + * @interface RadioInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface RadioInterface { + /** + * Called when a radio box is created. + * + * @param { RadioOptions } options + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when a radio box is created. + * + * @param { RadioOptions } options + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when a radio box is created. + * + * @param { RadioOptions } options + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when a radio box is created. + * + * @param { RadioOptions } options + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (options: RadioOptions): RadioAttribute; +} + +/** + * Provides methods for radio method component. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides methods for radio method component. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides methods for radio method component. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides methods for radio method component. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class RadioAttribute extends CommonMethod { + /** + * Called when the radio box is selected. + * + * @param { boolean } value + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the radio box is selected. + * + * @param { boolean } value + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the radio box is selected. + * + * @param { boolean } value + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the radio box is selected. + * + * @param { boolean } value + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + checked(value: boolean): RadioAttribute; + + /** + * Called when the radio box selection status changes. + * + * @param { function } callback + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the radio box selection status changes. + * + * @param { function } callback + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the radio box selection status changes. + * + * @param { function } callback + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the radio box selection status changes. + * + * @param { function } callback + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onChange(callback: (isChecked: boolean) => void): RadioAttribute; + + /** + * Set the radio style. + * + * @param { RadioStyle } value - the radio style. + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the radio style. + * + * @param { RadioStyle } value - the radio style. + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + radioStyle(value?: RadioStyle): RadioAttribute; + + /** + * Set the Configuration of radio. + * + * @param { ContentModifier } modifier - The contentModifier of radio. + * @returns { RadioAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): RadioAttribute; +} + +/** + * RadioConfiguration used by radio Configuration + * + * @interface RadioConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RadioConfiguration extends CommonConfiguration { + /** + * Radio name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value: string; + + /** + * Called when the radio box is selected. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + checked: boolean; + + /** + * Called when the radio box selection status changes. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + triggerChange: Callback; +} + +/** + * Defines Radio Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Radio Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Radio Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Radio Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Radio: RadioInterface; + +/** + * Defines Radio Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Radio Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Radio Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Radio Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const RadioInstance: RadioAttribute; diff --git a/tests/arkts-sdk/ets/rating.d.ts b/tests/arkts-sdk/ets/rating.d.ts new file mode 100644 index 00000000..1e79c955 --- /dev/null +++ b/tests/arkts-sdk/ets/rating.d.ts @@ -0,0 +1,659 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Define options used to construct a rating. + * + * @interface RatingOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface RatingOptions { + /** + * Rating option. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rating option. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rating option. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rating option. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + rating: number; + + /** + * Indicator option. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicator option. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicator option. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicator option. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + indicator?: boolean +} + +/** + * Define star style options. + * + * @interface StarStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface StarStyleOptions { + /** + * Background URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundUri: string; + + /** + * Foreground URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Foreground URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Foreground URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Foreground URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + foregroundUri: string; + + /** + * Secondary URI option. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Secondary URI option. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Secondary URI option. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Secondary URI option. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + secondaryUri?: string +} + +/** + * Provides the interface for scoring bars. + * + * @interface RatingInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides the interface for scoring bars. + * + * @interface RatingInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides the interface for scoring bars. + * + * @interface RatingInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides the interface for scoring bars. + * + * @interface RatingInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface RatingInterface { + /** + * Called when a score bar is created. + * + * @param { object } options + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a score bar is created. + * + * @param { object } options + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when a score bar is created. + * + * @param { object } options + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when a score bar is created. + * + * @param { object } options + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when a score bar is created. + * + * @param { RatingOptions } [options] - rating options + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options?: RatingOptions): RatingAttribute; +} + +/** + * RatingConfiguration used by rating content modifier. + * + * @interface RatingConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RatingConfiguration extends CommonConfiguration { + /** + * Current number of Rating. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + rating: number; + + /** + * Indicates whether Rating is used as an indicator. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + indicator: boolean; + + /** + * Total stars of Rating. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + stars: number; + + /** + * The step size of the Rating. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + stepSize: number; + + /** + * Trigger Rating select change. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + triggerChange: Callback; +} + +/** + * Defines the rating attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the rating attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the rating attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the rating attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class RatingAttribute extends CommonMethod { + /** + * Called when the total number of stars is set. + * + * @param { number } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the total number of stars is set. + * + * @param { number } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the total number of stars is set. + * + * @param { number } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the total number of stars is set. + * + * @param { number } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stars(value: number): RatingAttribute; + + /** + * Called when the step size of the operation rating. + * + * @param { number } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the step size of the operation rating. + * + * @param { number } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the step size of the operation rating. + * + * @param { number } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the step size of the operation rating. + * + * @param { number } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stepSize(value: number): RatingAttribute; + + /** + * Called when a picture is set. + * + * @param { object } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a picture is set. + * + * @param { object } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when a picture is set. + * + * @param { object } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when a picture is set. + * + * @param { object } value + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when a picture is set. + * + * @param { StarStyleOptions } options - star style options + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + starStyle(options: StarStyleOptions): RatingAttribute; + + /** + * Called when the star rating of the operation scoring bar changes. + * + * @param { function } callback + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the star rating of the operation scoring bar changes. + * + * @param { function } callback + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the star rating of the operation scoring bar changes. + * + * @param { function } callback + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the star rating of the operation scoring bar changes. + * + * @param { function } callback + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onChange(callback: (value: number) => void): RatingAttribute; + + /** + * Set the content modifier of rating. + * + * @param { ContentModifier } modifier - The content modifier of rating. + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): RatingAttribute; +} + +/** + * Defines Rating Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Rating Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Rating Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Rating Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Rating: RatingInterface; + +/** + * Defines Rating Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Rating Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Rating Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Rating Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const RatingInstance: RatingAttribute; diff --git a/tests/arkts-sdk/ets/rect.d.ts b/tests/arkts-sdk/ets/rect.d.ts new file mode 100644 index 00000000..9c5605d7 --- /dev/null +++ b/tests/arkts-sdk/ets/rect.d.ts @@ -0,0 +1,654 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Define options used to construct a rectangle. + * + * @interface RectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface RectOptions { + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: number | string; + + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: number | string; + + /** + * Corner radius of the rectangle. + * + * @type { ?(number | string | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Corner radius of the rectangle. + * + * @type { ?(number | string | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Corner radius of the rectangle. + * + * @type { ?(number | string | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Corner radius of the rectangle. + * + * @type { ?(number | string | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radius?: number | string | Array; +} + +/** + * Define options used to construct a rectangle with rounded corners. + * + * @interface RoundedRectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface RoundedRectOptions { + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: number | string; + + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: number | string; + + /** + * Width of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Width of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Width of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Width of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radiusWidth?: number | string; + + /** + * Height of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Height of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Height of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Height of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radiusHeight?: number | string; +} + +/** + * Provides an interface for drawing rectangles. + * + * @interface RectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for drawing rectangles. + * + * @interface RectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides an interface for drawing rectangles. + * + * @interface RectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for drawing rectangles. + * + * @interface RectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface RectInterface { + /** + * Use new function to create Rect. + * + * @param { object } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Use new function to create Rect. + * + * @param { object } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Use new function to create Rect. + * + * @param { object } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Use new function to create Rect. + * + * @param { object } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Use new function to create Rect. + * + * @param { RectOptions | RoundedRectOptions } [options] - Rect options + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + new ( + options?: RectOptions | RoundedRectOptions, + ): RectAttribute; + + /** + * Called when a rectangle is created. + * + * @param { {width?: number | string;height?: number | string;radius?: number | string | Array;} | + * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a rectangle is created. + * + * @param { {width?: number | string;height?: number | string;radius?: number | string | Array;} | + * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when a rectangle is created. + * + * @param { {width?: number | string;height?: number | string;radius?: number | string | Array;} | + * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when a rectangle is created. + * + * @param { {width?: number | string;height?: number | string;radius?: number | string | Array;} | + * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when a rectangle is created. + * + * @param { RectOptions | RoundedRectOptions } [options] - Rect options + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + ( + options?: RectOptions | RoundedRectOptions, + ): RectAttribute; +} + +/** + * rect attribute declaration. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * rect attribute declaration. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * rect attribute declaration. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * rect attribute declaration. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class RectAttribute extends CommonShapeMethod { + /** + * Called when the fillet width is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the fillet width is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the fillet width is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the fillet width is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radiusWidth(value: number | string): RectAttribute; + + /** + * Called when the fillet height is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the fillet height is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the fillet height is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the fillet height is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radiusHeight(value: number | string): RectAttribute; + + /** + * Called when the fillet size is set. + * + * @param { number | string | Array } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the fillet size is set. + * + * @param { number | string | Array } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the fillet size is set. + * + * @param { number | string | Array } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the fillet size is set. + * + * @param { number | string | Array } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radius(value: number | string | Array): RectAttribute; +} + +/** + * Defines Rect Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Rect Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Rect Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Rect: RectInterface; + +/** + * Rect attribute. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ +declare const RectInStance: RectAttribute; + +/** + * Rect attribute. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const RectInstance: RectAttribute; diff --git a/tests/arkts-sdk/ets/refresh.d.ts b/tests/arkts-sdk/ets/refresh.d.ts new file mode 100644 index 00000000..592efa7b --- /dev/null +++ b/tests/arkts-sdk/ets/refresh.d.ts @@ -0,0 +1,536 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * The refresh status of the drop-down refresh. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The refresh status of the drop-down refresh. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The refresh status of the drop-down refresh. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum RefreshStatus { + /** + * The refresh status of the drop-down refresh. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The refresh status of the drop-down refresh. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The refresh status of the drop-down refresh. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Inactive, + + /** + * Drop down, but the drop-down distance is less than the refresh distance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Drop down, but the drop-down distance is less than the refresh distance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Drop down, but the drop-down distance is less than the refresh distance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Drag, + + /** + * The pull-down exceeds the refresh distance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The pull-down exceeds the refresh distance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The pull-down exceeds the refresh distance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OverDrag, + + /** + * After the pull-down, it rebounds to the refresh distance and enters the refresh state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After the pull-down, it rebounds to the refresh distance and enters the refresh state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After the pull-down, it rebounds to the refresh distance and enters the refresh state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Refresh, + + /** + * After refresh, return to the initial state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After refresh, return to the initial state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After refresh, return to the initial state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Done, +} + +/** + * Defines the options of refresh component. + * + * @interface RefreshOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the options of refresh component. + * + * @interface RefreshOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of refresh component. + * + * @interface RefreshOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface RefreshOptions { + /** + * Whether the current component is being refreshed. + * This parameter supports $$ for two-way binding of variables. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Whether the current component is being refreshed. + * This parameter supports $$ for two-way binding of variables. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Whether the current component is being refreshed. + * This parameter supports $$ for two-way binding of variables. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + refreshing: boolean; + + /** + * Distance to the top of the parent component from the component that + * comes to rest after a successful pull-down gesture. Default value: 16, in vp + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Distance to the top of the parent component from the component that + * comes to rest after a successful pull-down gesture. Default value: 16, in vp + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @deprecated since 11 + */ + offset?: number | string; + + /** + * Coefficient of friction, which indicates the component's sensitivity to the pull-down gesture. + * The value ranges from 0 to 100. Default value: 62 + * - 0 indicates that the component is not sensitive to the pull-down gesture. + * - 100 indicates that the component is highly sensitive to the pull-down gesture. + * - A larger value indicates a more sensitive response of the component to the pull-down gesture. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Coefficient of friction, which indicates the component's sensitivity to the pull-down gesture. + * The value ranges from 0 to 100. Default value: 62 + * - 0 indicates that the component is not sensitive to the pull-down gesture. + * - 100 indicates that the component is highly sensitive to the pull-down gesture. + * - A larger value indicates a more sensitive response of the component to the pull-down gesture. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @deprecated since 11 + */ + friction?: number | string; + + /** + * The text displayed during refreshing + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + promptText?: ResourceStr; + + /** + * Custom component to display during dragging. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Custom component to display during dragging. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + builder?: CustomBuilder; + + /** + * Custom component to display during dragging. + * + * @type { ?ComponentContent } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + refreshingContent?: ComponentContent; +} + +/** + * Provides a pull-down refresh interface. + * + * @interface RefreshInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides a pull-down refresh interface. + * + * @interface RefreshInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides a pull-down refresh interface. + * + * @interface RefreshInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface RefreshInterface { + /** + * Called when the drop-down refresh is set. + * + * @param { RefreshOptions } value - The options of refresh component. + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the drop-down refresh is set. + * + * @param { RefreshOptions } value - The options of refresh component. + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the drop-down refresh is set. + * + * @param { RefreshOptions } value - The options of refresh component. + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value: RefreshOptions): RefreshAttribute; +} + +/** + * Defines the refresh attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the refresh attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the refresh attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class RefreshAttribute extends CommonMethod { + /** + * Called when the refresh state changes. + * + * @param { function } callback + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the refresh state changes. + * + * @param { function } callback + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the refresh state changes. + * + * @param { function } callback + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onStateChange(callback: (state: RefreshStatus) => void): RefreshAttribute; + + /** + * Called when the refresh state is entered. + * + * @param { function } callback + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the refresh state is entered. + * + * @param { function } callback + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the refresh state is entered. + * + * @param { function } callback + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onRefreshing(callback: () => void): RefreshAttribute; + + /** + * The pull-down offset to trigger refresh. + * + * @param { number } value + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + refreshOffset(value: number): RefreshAttribute; + + /** + * Sets whether to trigger refresh when the pull-down distance exceeds the refreshOffset. + * + * @param { boolean } value + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pullToRefresh(value: boolean): RefreshAttribute; + + /** + * Called when the refresh offset changed. + * The unit is vp. + * + * @param { Callback } callback + * @returns { RefreshAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onOffsetChange(callback: Callback): RefreshAttribute; + + /** + * Pull-down follow ratio for Refresh. + * + * @param { Optional } ratio - Pull-down follow ratio for Refresh. + * @returns { RefreshAttribute } The attribute of the Refresh. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pullDownRatio(ratio: Optional): RefreshAttribute; +} + +/** + * Defines Refresh Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Refresh Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Refresh Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Refresh: RefreshInterface; + +/** + * Defines Refresh Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Refresh Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Refresh Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const RefreshInstance: RefreshAttribute; \ No newline at end of file diff --git a/tests/arkts-sdk/ets/relative_container.d.ts b/tests/arkts-sdk/ets/relative_container.d.ts new file mode 100644 index 00000000..cd67f313 --- /dev/null +++ b/tests/arkts-sdk/ets/relative_container.d.ts @@ -0,0 +1,455 @@ +/* + * Copyright (c) 2022-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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides ports for relative containers. + * + * @interface RelativeContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides ports for relative containers. + * + * @interface RelativeContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides ports for relative containers. + * + * @interface RelativeContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface RelativeContainerInterface { + /** + * Constructor. + * + * @returns { RelativeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Constructor. + * + * @returns { RelativeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructor. + * + * @returns { RelativeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (): RelativeContainerAttribute; +} + +/** + * Specifies the position of guideLine + * + * @interface GuideLinePosition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GuideLinePosition { + /** + * Specifies the distance to start of container + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start? : Dimension; + + /** + * Specifies the distance to end of container + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + end? : Dimension; +} + +/** + * Specifies the GuideLineStyle of relative container + * + * @interface GuideLineStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GuideLineStyle { + /** + * Specifies the id of guideLine + * + * @type {string} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id : string; + + /** + * Specifies the direction of guideLine + * + * @type {Axis} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + direction : Axis; + + /** + * Specifies the position of guideLine + * + * @type {GuideLinePosition} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + position : GuideLinePosition; +} + +/** + * Specifies the direction value of Barrier. + * + * @enum {number} + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum BarrierDirection { + /** + * Barrier will be positioned to the far left of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LEFT, + + /** + * Barrier will be positioned to the far right of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + RIGHT, + + /** + * Barrier will be positioned to the top of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TOP, + + /** + * Barrier will be positioned to the bottom of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BOTTOM, +} + +/** + * Specifies the localized direction value of Barrier. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum LocalizedBarrierDirection { + /** + * Localized barrier will be positioned to the far start of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + START = 0, + + /** + * Localized barrier will be positioned to the far end of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + END = 1, + + /** + * Localized barrier will be positioned to the top of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TOP = 2, + + /** + * Localized barrier will be positioned to the bottom of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BOTTOM = 3, +} + +/** + * Specifies the BarrierStyle of relative container + * + * @interface BarrierStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface BarrierStyle { + /** + * Specifies the id of barrier + * + * @type {string} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id : string; + + /** + * Specifies the direction of barrier + * + * @type {BarrierDirection} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + direction : BarrierDirection; + + /** + * Specifies the referencedId of barrier + * + * @type {Array} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + referencedId : Array; +} + +/** + * Specifies the Localized BarrierStyle of relative container + * + * @interface LocalizedBarrierStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LocalizedBarrierStyle { + /** + * Specifies the id of localized barrier + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id : string; + + /** + * Specifies the localized barrier direction of barrier + * + * @type { LocalizedBarrierDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + localizedDirection : LocalizedBarrierDirection; + + /** + * Specifies the referencedId of localized barrier + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + referencedId : Array; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class RelativeContainerAttribute extends CommonMethod { + /** + * Specifies guideLines of relativeContainer + * + * @param { Array } value + * @returns { RelativeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + guideLine(value: Array): RelativeContainerAttribute; + + /** + * Specifies barriers of relativeContainer + * + * @param { Array } value + * @returns { RelativeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + barrier(value: Array): RelativeContainerAttribute; + + /** + * Specifies barriers of relativeContainer + * + * @param { Array } barrierStyle + * @returns { RelativeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + barrier(barrierStyle: Array): RelativeContainerAttribute; +} + +/** + * RelativeContainer + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * RelativeContainer + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * RelativeContainer + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const RelativeContainer: RelativeContainerInterface; + +/** + * RelativeContainerInstance + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * RelativeContainerInstance + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * RelativeContainerInstance + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const RelativeContainerInstance: RelativeContainerAttribute; diff --git a/tests/arkts-sdk/ets/remote_window.d.ts b/tests/arkts-sdk/ets/remote_window.d.ts new file mode 100644 index 00000000..97f7b030 --- /dev/null +++ b/tests/arkts-sdk/ets/remote_window.d.ts @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Round rect. + * + * @interface RRect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +interface RRect { + /** + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + left: number; + + /** + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + top: number; + + /** + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + width: number; + + /** + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + height: number; + + /** + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + radius: number; +} + +/** + * Window animation target. + * + * @interface WindowAnimationTarget + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +interface WindowAnimationTarget { + /** + * @type { string } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + readonly bundleName: string; + + /** + * @type { string } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + readonly abilityName: string; + + /** + * @type { RRect } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + readonly windowBounds: RRect; + + /** + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + readonly missionId: number; +} + +/** + * Provides an interface for controlling the remote window. + * + * @interface RemoteWindowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +interface RemoteWindowInterface { + /** + * Called when the remote window interface is used. + * + * @param { WindowAnimationTarget } target + * @returns { RemoteWindowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ + (target: WindowAnimationTarget): RemoteWindowAttribute; +} + +/** + * Inheritance CommonMethod Set Styles + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +declare class RemoteWindowAttribute extends CommonMethod {} + +/** + * Defines RemoteWindow Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +declare const RemoteWindow: RemoteWindowInterface; + +/** + * Defines RemoteWindow Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 9 + */ +declare const RemoteWindowInstance: RemoteWindowAttribute; diff --git a/tests/arkts-sdk/ets/repeat.d.ts b/tests/arkts-sdk/ets/repeat.d.ts new file mode 100644 index 00000000..f7ecf3f0 --- /dev/null +++ b/tests/arkts-sdk/ets/repeat.d.ts @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file Defines Repeat component. + * @kit ArkUI + */ + +/** + * Construct a new type for each item. + * + * @interface RepeatItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +interface RepeatItem { + /** + * The origin data. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + item: T, + /** + * index of each item. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + index: number +} + +/** + * Define the options of repeat virtualScroll to implement reuse and lazy loading. + * + * @interface VirtualScrollOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface VirtualScrollOptions { + /** + * Total data count. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + totalCount?: number; +} + +/** + * Define a builder template option parameter. + * + * @interface TemplateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface TemplateOptions { + /** + * The cached number of each template. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cachedCount?: number +} + +/** + * Function that return typed string to render one template. + * + * @typedef {function} TemplateTypedFunc + * @param { T } item - data item. + * @param {number} index - data index number in array. + * @returns { string } template type. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type TemplateTypedFunc = (item : T, index : number) => string; + +/** + * Define builder function to render one template type. + * + * @typedef {function} RepeatItemBuilder + * @param { RepeatItem } repeatItem - the repeat item builder function. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type RepeatItemBuilder = (repeatItem: RepeatItem) => void; + +/** + * Defines the Repeat component attribute functions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class RepeatAttribute { + /** + * Executes itemGenerator of each item. + * + * @param { function } itemGenerator + * @returns { RepeatAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + each(itemGenerator: (repeatItem: RepeatItem) => void): RepeatAttribute; + /** + * Obtains key of each item. + * + * @param { function } keyGenerator + * @returns { RepeatAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + key(keyGenerator: (item: T, index: number) => string): RepeatAttribute; + /** + * Enable UI lazy loading when scroll up or down. + * + * @param { VirtualScrollOptions } virtualScrollOptions that defines the options of repeat virtual scroll to implement reuse and lazy loading. + * @returns { RepeatAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + virtualScroll(virtualScrollOptions?: VirtualScrollOptions): RepeatAttribute; + /** + * Type builder function to render specific type of data item. + * + * @param { string } type that defines the template id. + * @param { RepeatItemBuilder } itemBuilder that defines UI builder function. + * @param { TemplateOptions } templateOptions that defines a builder template option parameter. + * @returns { RepeatAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + template(type : string, itemBuilder: RepeatItemBuilder, templateOptions?: TemplateOptions): RepeatAttribute; + /** + * Typed function to render specific type of data item. + * + * @param { TemplateTypedFunc } typedFunc that define template typed function. + * @returns { RepeatAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + templateId(typedFunc: TemplateTypedFunc): RepeatAttribute; +} + +/** + * Defines Repeat Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const Repeat: (arr: Array) => RepeatAttribute; diff --git a/tests/arkts-sdk/ets/rich_editor.d.ts b/tests/arkts-sdk/ets/rich_editor.d.ts new file mode 100644 index 00000000..06e10f98 --- /dev/null +++ b/tests/arkts-sdk/ets/rich_editor.d.ts @@ -0,0 +1,3937 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines delete text direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines delete text direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum RichEditorDeleteDirection { + /** + * Delete backward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Delete backward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BACKWARD, + + /** + * Delete forward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Delete forward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + FORWARD, +} + +/** + * Defines span type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines span type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum RichEditorSpanType { + /** + * Text,corresponding textSpan type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text,corresponding textSpan type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TEXT = 0, + + /** + * Image,corresponding imageSpan type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Image,corresponding imageSpan type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + IMAGE = 1, + + /** + * Mixed,corresponding mixed span type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Mixed,corresponding mixed span type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MIXED = 2, + + /** + * Builder,corresponding builderSpan type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BUILDER = 3, +} + +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum RichEditorResponseType { + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + RIGHT_CLICK = 0, + + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LONG_PRESS = 1, + + /** + * Selected by mouse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Selected by mouse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SELECT = 2, +} + +/** + * Defines the span position. + * + * @interface RichEditorSpanPosition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the span position. + * + * @interface RichEditorSpanPosition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorSpanPosition { + /** + * Define the index of span. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the index of span. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanIndex: number; + + /** + * The range of span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The range of span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanRange: [number, number]; +} + +/** + * Defines the span text style. + * + * @interface RichEditorTextStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the span text style. + * + * @interface RichEditorTextStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorTextStyle { + /** + * font color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor?: ResourceColor; + + /** + * font size. + * + * @type { ?(Length | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font size. + * + * @type { ?(Length | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontSize?: Length | number; + + /** + * font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontStyle?: FontStyle; + + /** + * font weight. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font weight. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontWeight?: number | FontWeight | string; + + /** + * font family. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font family. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontFamily?: ResourceStr; + + /** + * font decoration. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font decoration. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Font decoration. + * + * @type { ?DecorationStyleInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + decoration?: DecorationStyleInterface; + + /** + * Text shadow + * + * @type { ?(ShadowOptions | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Text shadow + * + * @type { ?(ShadowOptions | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textShadow?: ShadowOptions | Array; + + /** + * letter spacing. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + letterSpacing?: number | string; + + /** + * line height. + * + * @type { ? (number | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineHeight?: number | string | Resource; + + /** + * Set font feature, advanced text styles and effects as designed by the font author. + * The format is the like the CSS font-feature-settings attribute. + * + * @type { ?string } + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * the values of reference to doc of RichEditor component + * number of can be single or multiple, and separated by comma ','. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFeature?: string; +} + + +/** + * Defines the leading margin placeholder of a paragraph. + * + * @interface LeadingMarginPlaceholder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the leading margin placeholder of a paragraph. + * + * @interface LeadingMarginPlaceholder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LeadingMarginPlaceholder { + /** + * Placeholder pixelMap. + * + * @type { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Placeholder pixelMap. + * + * @type { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pixelMap: PixelMap; + + /** + * Placeholder size. + * + * @type { [Dimension, Dimension] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Placeholder size. + * + * @type { [Dimension, Dimension] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + size: [Dimension, Dimension]; +} + +/** + * Defines the paragraph style. + * + * @interface RichEditorParagraphStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the paragraph style. + * + * @interface RichEditorParagraphStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorParagraphStyle { + /** + * Text alignment. + * + * @type { ?TextAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Text alignment. + * + * @type { ?TextAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textAlign?: TextAlign; + + /** + * Leading margin. + * + * @type { ?(Dimension | LeadingMarginPlaceholder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Leading margin. + * + * @type { ?(Dimension | LeadingMarginPlaceholder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + leadingMargin?: Dimension | LeadingMarginPlaceholder; + + /** + * Set word break type. + * + * @type { ?WordBreak } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + wordBreak?: WordBreak; + + /** + * Set line break strategy type. + * + * @type { ?LineBreakStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineBreakStrategy?: LineBreakStrategy; +} + +/** + * Defines the paste event. + * + * @interface PasteEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PasteEvent { + /** + * Override system paste event. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Override system paste event. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preventDefault?: Callback; +} + +/** + * Defines the text span. + * + * @interface RichEditorTextSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the text span. + * + * @interface RichEditorTextSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorTextSpan { + /** + * The position of the text span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The position of the text span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanPosition: RichEditorSpanPosition; + + /** + * The content of the text span. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The content of the text span. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string; + + /** + * text style. + * + * @type { ?RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * text style. + * + * @type { ?RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle?: RichEditorTextStyle; +} + +/** + * Defines the richEditor Image Layout Style. + * + * @interface RichEditorLayoutStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the richEditor Image Layout Style. + * + * @interface RichEditorLayoutStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface RichEditorLayoutStyle { + /** + * Outer Margin. + * + * @type { ?(Dimension | Margin) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Outer Margin. + * + * @type { ?(Dimension | Margin) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + margin?: Dimension | Margin; + + /** + * Border radius. + * + * @type { ?(Dimension | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Border radius. + * + * @type { ?(Dimension | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderRadius?: Dimension | BorderRadiuses; +} + +/** + * Defines the span image style. + * + * @interface RichEditorImageSpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the span image style. + * + * @interface RichEditorImageSpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorImageSpanStyle { + /** + * image size. + * + * @type { ?[Dimension, Dimension] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image size. + * + * @type { ?[Dimension, Dimension] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size?: [Dimension, Dimension]; + + /** + * image vertical align. + * + * @type { ?ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image vertical align. + * + * @type { ?ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + verticalAlign?: ImageSpanAlignment; + + /** + * image fit. + * + * @type { ?ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image fit. + * + * @type { ?ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + objectFit?: ImageFit; + + /** + * RichEditor ImageSpan Layout Style. + * + * @type { ?RichEditorLayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * RichEditor ImageSpan Layout Style. + * + * @type { ?RichEditorLayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + layoutStyle?: RichEditorLayoutStyle; +} + +/** + * Defines the symbol span style. + * + * @interface RichEditorSymbolSpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the symbol span style. + * + * @interface RichEditorSymbolSpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorSymbolSpanStyle { + /** + * The font size. + * + * @type { ?(number | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font size. + * + * @type { ?(number | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontSize?: number | string | Resource; + + /** + * The font color. + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font color. + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontColor?: Array; + + /** + * The font weight. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font weight. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontWeight?: number | FontWeight | string; + + /** + * The symbol span effect strategy. + * + * @type { ?SymbolEffectStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The symbol span effect strategy. + * + * @type { ?SymbolEffectStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + effectStrategy?: SymbolEffectStrategy; + + /** + * The symbol span rendering strategy. + * + * @type { ?SymbolRenderingStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The symbol span rendering strategy. + * + * @type { ?SymbolRenderingStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + renderingStrategy?: SymbolRenderingStrategy; +} + +/** + * Defines the text style result. + * + * @interface RichEditorTextStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the text style result. + * + * @interface RichEditorTextStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorTextStyleResult { + /** + * font color. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font color. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor: ResourceColor; + + /** + * font size. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font size. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontSize: number; + + /** + * font style. + * + * @type { FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font style. + * + * @type { FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontStyle: FontStyle; + + /** + * font weight. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font weight. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontWeight: number; + + /** + * font family. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font family. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontFamily: string; + + /** + * font decoration. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font decoration. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Font decoration. + * + * @type { DecorationStyleResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + decoration: DecorationStyleResult; + + /** + * Text shadow + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textShadow?: Array; + + /** + * letter spacing. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + letterSpacing?: number; + + /** + * line height. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineHeight?: number; + + /** + * Set font feature, advanced text styles and effects as designed by the font author. + * The format is the like the CSS font-feature-settings attribute. + * + * @type { ?string } + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * the values of reference to doc of RichEditor component + * number of can be single or multiple, and separated by comma ','. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFeature?: string; +} + +/** + * Defines the paragraph result. + * + * @interface RichEditorParagraphResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the paragraph result. + * + * @interface RichEditorParagraphResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorParagraphResult { + /** + * The paragraph style. + * + * @type { RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The paragraph style. + * + * @type { RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style: RichEditorParagraphStyle; + + /** + * The range of paragraph based on character indices. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The range of paragraph based on character indices. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + range: [number, number]; +} + +/** + * Defines the symbol span style result. + * + * @interface RichEditorSymbolSpanStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the symbol span style result. + * + * @interface RichEditorSymbolSpanStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorSymbolSpanStyleResult { + /** + * The font size. + * + * @type { number | string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font size. + * + * @type { number | string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontSize: number | string | Resource; + + /** + * The font color. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font color. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontColor: Array; + + /** + * The font weight. + * + * @type { number | FontWeight | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font weight. + * + * @type { number | FontWeight | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontWeight: number | FontWeight | string; + + /** + * The symbol span effect strategy. + * + * @type { SymbolEffectStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The symbol span effect strategy. + * + * @type { SymbolEffectStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + effectStrategy: SymbolEffectStrategy; + + /** + * The symbol span rendering strategy. + * + * @type { SymbolRenderingStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The symbol span rendering strategy. + * + * @type { SymbolRenderingStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + renderingStrategy: SymbolRenderingStrategy; +} + +/** + * Defines the text span result. + * + * @interface RichEditorTextSpanResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the text span result. + * + * @interface RichEditorTextSpanResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorTextSpanResult { + /** + * The position of the text span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The position of the text span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanPosition: RichEditorSpanPosition; + + /** + * The content of the text span. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The content of the text span. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string; + + /** + * text style. + * + * @type { RichEditorTextStyleResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * text style. + * + * @type { RichEditorTextStyleResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle: RichEditorTextStyleResult; + + /** + * get offset in span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * get offset in span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetInSpan: [number, number]; + + /** + * Symbol span style. + * + * @type { ?RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Symbol span style. + * + * @type { ?RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolSpanStyle?: RichEditorSymbolSpanStyle; + + /** + * The resource string of the symbol span. + * + * @type { ?Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The resource string of the symbol span. + * + * @type { ?Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + valueResource?: Resource; + + /** + * The Style of paragraph. + * + * @type { ?RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + paragraphStyle?: RichEditorParagraphStyle; + + /** + * The preview text. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + previewText?: string; +} + +/** + * Defines the span image style result. + * + * @interface RichEditorImageSpanStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the span image style result. + * + * @interface RichEditorImageSpanStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorImageSpanStyleResult { + /** + * image size. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image size. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size: [number, number]; + + /** + * image vertical align. + * + * @type { ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image vertical align. + * + * @type { ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + verticalAlign: ImageSpanAlignment; + + /** + * image fit. + * + * @type { ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image fit. + * + * @type { ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + objectFit: ImageFit; + + /** + * RichEditor ImageSpan Layout Style. + * + * @type { ?RichEditorLayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + layoutStyle?: RichEditorLayoutStyle; +} + +/** + * Defines the image span. + * + * @interface RichEditorImageSpanResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the image span. + * + * @interface RichEditorImageSpanResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorImageSpanResult { + /** + * The position of the image span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The position of the image span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanPosition: RichEditorSpanPosition; + + /** + * The pixel map of the image span. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The pixel map of the image span. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + valuePixelMap?: PixelMap; + + /** + * The resource string of the image span. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The resource string of the image span. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + valueResourceStr?: ResourceStr; + + /** + * image attribute. + * + * @type { RichEditorImageSpanStyleResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image attribute. + * + * @type { RichEditorImageSpanStyleResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + imageStyle: RichEditorImageSpanStyleResult; + + /** + * get offset in span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * get offset in span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetInSpan: [number, number]; +} + +/** + * Defines the image span. + * + * @interface RichEditorImageSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the image span. + * + * @interface RichEditorImageSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorImageSpan { + /** + * The position of the image span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The position of the image span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanPosition: RichEditorSpanPosition; + + /** + * The content of the image span. + * + * @type { PixelMap | ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The content of the image span. + * + * @type { PixelMap | ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: PixelMap | ResourceStr; + + /** + * image style. + * + * @type { ?RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image style. + * + * @type { ?RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + imageStyle?: RichEditorImageSpanStyle; +} + +/** + * Defines range of RichEditor. + * + * @interface RichEditorRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines range of RichEditor. + * + * @interface RichEditorRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorRange { + /** + * start offset. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * start offset. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + start?: number; + + /** + * end offset. + * + * @type { ?number } + * @default text length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * end offset. + * + * @type { ?number } + * @default text length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + end?: number; +} + +/** + * Defines the richEditor Gestures. + * + * @interface RichEditorGesture + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the richEditor Gestures. + * + * @interface RichEditorGesture + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorGesture { + /** + * Trigger a click event when a click is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Trigger a click event when a click is clicked. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onClick?: Callback; + + /** + * Trigger a gesture event when long press event is complete. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Trigger a gesture event when long press event is complete. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onLongPress?: Callback; +} + +/** + * Defines the span options of RichEditor. + * + * @interface RichEditorTextSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the span options of RichEditor. + * + * @interface RichEditorTextSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorTextSpanOptions { + /** + * the offset that add a text span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * the offset that add a text span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: number; + + /** + * text style. + * + * @type { ?RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * text style. + * + * @type { ?RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style?: RichEditorTextStyle; + + /** + * Paragraph style. + * + * @type { ?RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Paragraph style. + * + * @type { ?RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + paragraphStyle?: RichEditorParagraphStyle; + + /** + * RichEditor gesture. + * + * @type { ?RichEditorGesture } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * RichEditor gesture. + * + * @type { ?RichEditorGesture } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + gesture?: RichEditorGesture; +} + +/** + * Defines the custom keyboard options of RichEditor. + * + * @interface KeyboardOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface KeyboardOptions { + /** + * Indicates whether to support custom keyboard avoidance. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + supportAvoidance?: boolean; +} + +/** + * Defines the image span options of RichEditor. + * + * @interface RichEditorImageSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the image span options of RichEditor. + * + * @interface RichEditorImageSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorImageSpanOptions { + /** + * the offset that add image span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * the offset that add image span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: number; + + /** + * image style. + * + * @type { ?RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image style. + * + * @type { ?RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + imageStyle?: RichEditorImageSpanStyle; + + /** + * RichEditor gesture. + * + * @type { ?RichEditorGesture } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * RichEditor gesture. + * + * @type { ?RichEditorGesture } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + gesture?: RichEditorGesture; +} + +/** + * Defines the builder span options of RichEditor. + * + * @interface RichEditorBuilderSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the builder span options of RichEditor. + * + * @interface RichEditorBuilderSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorBuilderSpanOptions { + /** + * The offset that add custom builder span at. + * + * @type { ?number } Indicates the index where the builder will be inserted + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The offset that add custom builder span at. + * + * @type { ?number } Indicates the index where the builder will be inserted + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offset?: number; +} + +/** + * Defines the placeholder style. + * + * @interface PlaceholderStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface PlaceholderStyle { + /** + * font. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + font?: Font; + + /** + * fontColor. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontColor?: ResourceColor; +} + +/** + * Defines span style option of RichEditor. + * + * @interface RichEditorSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines span style option of RichEditor. + * + * @interface RichEditorSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorSpanStyleOptions extends RichEditorRange { } + +/** + * Defines paragraph style option of RichEditor. + * + * @interface RichEditorParagraphStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines paragraph style option of RichEditor. + * + * @interface RichEditorParagraphStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorParagraphStyleOptions extends RichEditorRange { + /** + * Paragraph style. + * + * @type { RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Paragraph style. + * + * @type { RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style: RichEditorParagraphStyle; +} + +/** + * Defines text span style option of RichEditor. + * + * @interface RichEditorUpdateTextSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines text span style option of RichEditor. + * + * @interface RichEditorUpdateTextSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorUpdateTextSpanStyleOptions extends RichEditorSpanStyleOptions { + /** + * text style. + * + * @type { RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * text style. + * + * @type { RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle: RichEditorTextStyle; +} + +/** + * Defines image span style option of RichEditor. + * + * @interface RichEditorUpdateImageSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines image span style option of RichEditor. + * + * @interface RichEditorUpdateImageSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorUpdateImageSpanStyleOptions extends RichEditorSpanStyleOptions { + /** + * image style. + * + * @type { RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image style. + * + * @type { RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + imageStyle: RichEditorImageSpanStyle; +} + +/** + * Defines symbol span style option of RichEditor. + * + * @interface RichEditorUpdateSymbolSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines symbol span style option of RichEditor. + * + * @interface RichEditorUpdateSymbolSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorUpdateSymbolSpanStyleOptions extends RichEditorSpanStyleOptions { + /** + * Update the symbol span style. + * + * @type { RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Update the symbol span style. + * + * @type { RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolStyle: RichEditorSymbolSpanStyle; +} + +/** + * Defines the symbol span options of RichEditor. + * + * @interface RichEditorSymbolSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the symbol span options of RichEditor. + * + * @interface RichEditorSymbolSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorSymbolSpanOptions { + /** + * The offset that add custom symbol span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The offset that add custom symbol span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offset?: number; + + /** + * The style that add custom symbol span at. + * + * @type { ?RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The style that add custom symbol span at. + * + * @type { ?RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: RichEditorSymbolSpanStyle; +} + +/** + * Defines the text information for editing. + * + * @interface RichEditorSelection + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the text information for editing. + * + * @interface RichEditorSelection + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorSelection { + /** + * The location info. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The location info. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selection: [number, number]; + + /** + * The selected text content. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The selected text content. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spans: Array; +} + +/** + * Defines the inserted text value info. + * + * @interface RichEditorInsertValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the inserted text value info. + * + * @interface RichEditorInsertValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorInsertValue { + /** + * The location info where the value will be inserted. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The location info where the value will be inserted. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + insertOffset: number; + + /** + * The inserted value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The inserted value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + insertValue: string; + + /** + * The preview text. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + previewText?: string; +} + +/** + * Provides an interface for deleting value from text. + * + * @interface RichEditorDeleteValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Provides an interface for deleting value from text. + * + * @interface RichEditorDeleteValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorDeleteValue { + /** + * The offset of deleting. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The offset of deleting. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset: number; + + /** + * The deleted direction. + * + * @type { RichEditorDeleteDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The deleted direction. + * + * @type { RichEditorDeleteDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + direction: RichEditorDeleteDirection; + + /** + * The deleted text length. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The deleted text length. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + length: number; + + /** + * The deleted span object. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The deleted span object. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + richEditorDeleteSpans: Array; +} + +/** + * Provides an interface for changes in the text. + * + * @interface RichEditorChangeValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorChangeValue { + /** + * Range of content that will be replaced. + * + * @type { TextRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + rangeBefore: TextRange; + + /** + * Text spans to replace. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacedSpans: Array; + + /** + * Image spans to replace. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacedImageSpans: Array; + + /** + * Symbol spans to replace. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacedSymbolSpans: Array; +} + +/** + * Defines the options of RichEditor. + * + * @interface RichEditorOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the options of RichEditor. + * + * @interface RichEditorOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorOptions { + /** + * RichEditor controller. + * + * @type { RichEditorController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * RichEditor controller. + * + * @type { RichEditorController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + controller: RichEditorController; +} + +/** + * Defines the options of RichEditor with StyledString. + * + * @interface RichEditorStyledStringOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorStyledStringOptions { + /** + * RichEditor controller. + * + * @type { RichEditorStyledStringController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + controller: RichEditorStyledStringController; +} + +/** + * Defines the selection menu options. + * + * @interface SelectionMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the selection menu options. + * + * @interface SelectionMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SelectionMenuOptions { + /** + * Callback function when the selection menu appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when the selection menu appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Callback function when the selection menu appears. + * + * @type { ?MenuOnAppearCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAppear?: MenuOnAppearCallback; + + /** + * Callback function when the selection menu disappears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when the selection menu disappears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Callback function when the selection menu disappears. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDisappear?: Callback; + + /** + * Menu type, default value is MenuType.SELECTION_MENU. + * + * @type { ?MenuType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + menuType?: MenuType; +} + +/** + * Provides Base Controller for RichEditor. + * + * @implements TextEditControllerEx + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class RichEditorBaseController implements TextEditControllerEx { + /** + * Get caret offset from controller. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get caret offset from controller. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getCaretOffset(): number; + + /** + * Set caret offset. + * + * @param { number } offset - caret offset. + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set caret offset. + * + * @param { number } offset - caret offset. + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setCaretOffset(offset: number): boolean; + + /** + * close the select menu when menu is on. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * close the select menu when menu is on. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + closeSelectionMenu(): void; + + /** + * Get the typing text style. + * + * @returns { RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the typing text style. + * + * @returns { RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getTypingStyle(): RichEditorTextStyle; + + /** + * Set the typing text style. + * + * @param { RichEditorTextStyle } value - set the typing text style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the typing text style. + * + * @param { RichEditorTextStyle } value - set the typing text style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setTypingStyle(value: RichEditorTextStyle): void; + + /** + * Text selection is achieved by specifying the start and end positions of the rich editor. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Specify the start and end positions to select a range of content. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @param { SelectionOptions } [options] - Indicates the options of selection. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; + + /** + * Judge whether is in editing state + * + * @returns { boolean } - true is editing state, false is non editing status + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isEditing(): boolean; + + /** + * Stop editing state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + stopEditing(): void; + + /** + * Get LayoutManager. + * + * @returns { LayoutManager } - Return the LayoutManager. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getLayoutManager(): LayoutManager; + + /** + * Get PreviewText. + * + * @returns { PreviewText } - Return the PreviewText. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getPreviewText(): PreviewText; +} + +/** + * Provides Controller for RichEditor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Provides Controller for RichEditor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Provides Controller for RichEditor. + * + * @extends RichEditorBaseController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class RichEditorController extends RichEditorBaseController { + /** + * Add a text span. + * + * @param { string } value - text value. + * @param { RichEditorTextSpanOptions } [options] - span info. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Add a text span. + * + * @param { string } value - text value. + * @param { RichEditorTextSpanOptions } [options] - span info. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + addTextSpan(value: string, options?: RichEditorTextSpanOptions): number; + + /** + * Add a image span. + * + * @param { PixelMap | ResourceStr } value - image value. + * @param { RichEditorImageSpanOptions } [options] - image span info. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Add a image span. + * + * @param { PixelMap | ResourceStr } value - image value. + * @param { RichEditorImageSpanOptions } [options] - image span info. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + addImageSpan(value: PixelMap | ResourceStr, options?: RichEditorImageSpanOptions): number; + + /** + * Add a builder span. + * + * @param { CustomBuilder } value - Indicates the custom builder node + * @param { RichEditorBuilderSpanOptions } [options] - span option. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Add a builder span. + * + * @param { CustomBuilder } value - Indicates the custom builder node + * @param { RichEditorBuilderSpanOptions } [options] - span option. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + addBuilderSpan(value: CustomBuilder, options?: RichEditorBuilderSpanOptions): number; + + /** + * Add a symbol span. + * + * @param { Resource } value - symbol span value + * @param { RichEditorSymbolSpanOptions } [options] - symbol span option. + * @returns { number } symbol span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Add a symbol span. + * + * @param { Resource } value - symbol span value + * @param { RichEditorSymbolSpanOptions } [options] - symbol span option. + * @returns { number } symbol span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + addSymbolSpan(value: Resource, options?: RichEditorSymbolSpanOptions ): number; + + /** + * Modify span style. + * + * @param { RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Modify span style. + * + * @param { RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions | RichEditorUpdateSymbolSpanStyleOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + updateSpanStyle(value: RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions | RichEditorUpdateSymbolSpanStyleOptions): void; + + /** + * Modify span style. + * + * @param { RichEditorParagraphStyleOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Modify span style. + * + * @param { RichEditorParagraphStyleOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + updateParagraphStyle(value: RichEditorParagraphStyleOptions): void; + + /** + * Delete span. + * + * @param { RichEditorRange } [value] - range for deleting. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Delete span. + * + * @param { RichEditorRange } [value] - range for deleting. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + deleteSpans(value?: RichEditorRange): void; + + /** + * Get span content. + * + * @param { RichEditorRange } [value] - range for getting span info. + * @returns { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get span content. + * + * @param { RichEditorRange } [value] - range for getting span info. + * @returns { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getSpans(value?: RichEditorRange): Array; + + /** + * Get span content. + * + * @param { RichEditorRange } [value] - range for getting span info. + * @returns { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get span content. + * + * @param { RichEditorRange } [value] - range for getting span info. + * @returns { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getParagraphs(value?: RichEditorRange): Array; + + /** + * Called when the content is selected. + * + * @returns { RichEditorSelection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the content is selected. + * + * @returns { RichEditorSelection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getSelection(): RichEditorSelection; + + /** + * Convert StyledString to spans in rich editor. + * return a empty Array if convert failed + * + * @param { StyledString } value - StyledString. + * @returns { Array } + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + //fromStyledString(value: StyledString): Array; + + /** + * Convert spans to StyledString in rich editor. + * return a empty StyledString if convert failed + * + * @param { RichEditorRange } value - range of spans in rich editor + * @returns { StyledString } + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + toStyledString(value: RichEditorRange): StyledString; +} + +/** + * Defines the types of spans in rich editor. + * + * @typedef { RichEditorImageSpanResult | RichEditorTextSpanResult } RichEditorSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type RichEditorSpan = RichEditorImageSpanResult | RichEditorTextSpanResult; + +/** + * Provides Controller for RichEditor with StyledString. + * + * @extends RichEditorBaseController + * @implements StyledStringController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class RichEditorStyledStringController extends RichEditorBaseController implements StyledStringController { + /** + * Set the StyledString of the RichEditor. + * + * @param { StyledString } styledString - StyledString. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setStyledString(styledString: StyledString): void; + + /** + * Get the StyledString of the RichEditor. + * + * @returns { MutableStyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + getStyledString(): MutableStyledString; + + /** + * Get the selection in the StyledString of the RichEditor. + * + * @returns { RichEditorRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getSelection(): RichEditorRange; + + /** + * Register content changed listener + * + * @param { StyledStringChangedListener } listener - content changed listener. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onContentChanged(listener: StyledStringChangedListener): void; +} + +/** + * Provides attribute for RichEditor. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Provides attribute for RichEditor. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class RichEditorAttribute extends CommonMethod { + /** + * Called when on ready. + * + * @param { function } callback - The triggered function when rich editor is ready. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when on ready. + * + * @param { function } callback - The triggered function when rich editor is ready. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when on ready. + * + * @param { Callback } callback - The triggered function when rich editor is ready. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onReady(callback: Callback): RichEditorAttribute; + + /** + * Called when the content is selected. + * + * @param { function } callback - The triggered function when select text. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the content is selected. + * + * @param { function } callback - The triggered function when select text. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the content is selected. + * + * @param { Callback } callback - The triggered function when select text. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onSelect(callback: Callback): RichEditorAttribute; + + /** + * Called when selection range or caret position is changed. + * + * @param { Callback } callback - The triggered function when change selection range or caret position. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onSelectionChange(callback: Callback): RichEditorAttribute; + + /** + * Get text value information when about to input. + * + * @param { function } callback - The triggered function when text content is about to insert. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get text value information when about to input. + * + * @param { function } callback - The triggered function when text content is about to insert. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Get text value information when about to input. + * + * @param { Callback } callback - The triggered function when text content is about to insert. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + aboutToIMEInput(callback: Callback): RichEditorAttribute; + + /** + * Get text value information when completed input. + * + * @param { function } callback - The triggered function when text content has been inserted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get text value information when completed input. + * + * @param { function } callback - The triggered function when text content has been inserted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Get text value information when completed input. + * + * @param { Callback } callback - The triggered function when text content has been inserted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onIMEInputComplete(callback: Callback): RichEditorAttribute; + + /** + * Called when ime input complete. + * + * @param { Callback } callback - The triggered function when text content has been inserted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidIMEInput(callback: Callback): RichEditorAttribute; + + /** + * Get text value information when about to delete. + * + * @param { function } callback - The triggered function when text content is about to delete. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get text value information when about to delete. + * + * @param { function } callback - The triggered function when text content is about to delete. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Get text value information when about to delete. + * + * @param { Callback } callback - The triggered function when text content is about to delete. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + aboutToDelete(callback: Callback): RichEditorAttribute; + + /** + * Notify that the deletion has been completed + * + * @param { function } callback - The triggered function when text content has been deleted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Notify that the deletion has been completed + * + * @param { function } callback - The triggered function when text content has been deleted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Notify that the deletion has been completed + * + * @param { Callback } callback - The triggered function when text content has been deleted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDeleteComplete(callback: Callback): RichEditorAttribute; + + /** + * Allow replication. + * + * @param { CopyOptions } value - Indicates the type of copy option. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Allow replication. + * + * @param { CopyOptions } value - Indicates the type of copy option. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + copyOptions(value: CopyOptions): RichEditorAttribute; + + /** + * Bind to the selection menu. + * + * @param { RichEditorSpanType } spanType - Indicates the type of selection menu. + * @param { CustomBuilder } content - Indicates the content of selection menu. + * @param { ResponseType } responseType - Indicates response type of selection menu. + * @param { SelectionMenuOptions } [options] - Indicates the options of selection menu. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bind to the selection menu. + * + * @param { RichEditorSpanType } spanType - Indicates the type of selection menu. + * @param { CustomBuilder } content - Indicates the content of selection menu. + * @param { ResponseType | RichEditorResponseType } responseType - Indicates response type of selection menu. + * @param { SelectionMenuOptions } [options] - Indicates the options of selection menu. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + bindSelectionMenu(spanType: RichEditorSpanType, content: CustomBuilder, responseType: ResponseType | RichEditorResponseType, + options?: SelectionMenuOptions): RichEditorAttribute; + + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value - Set up a custom keyboard of RichEditor + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of RichEditor + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customKeyboard(value: CustomBuilder, options?: KeyboardOptions): RichEditorAttribute; + + /** + * Defines onPaste callback. + * + * @param { function } callback Executed when a paste operation is performed. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines onPaste callback. + * + * @param { PasteEventCallback } callback Executed when a paste operation is performed. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onPaste(callback: PasteEventCallback): RichEditorAttribute; + + /** + * Enable data detector. + * + * @param { boolean } enable - Enable data detector. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Enable data detector. + * + * @param { boolean } enable - Enable data detector. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableDataDetector(enable: boolean): RichEditorAttribute; + + /** + * Enable preview text. + * + * @param { boolean } enable - Enable preview text. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enablePreviewText(enable: boolean): RichEditorAttribute; + + /** + * Data detector with config. + * + * @param { TextDataDetectorConfig } config - The config of text data detector. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Data detector with config. + * + * @param { TextDataDetectorConfig } config - The config of text data detector. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dataDetectorConfig(config: TextDataDetectorConfig): RichEditorAttribute; + + /** + * Set richEditor placeholder. + * + * @param { ResourceStr } value - The value of placeholder. + * @param { PlaceholderStyle } [style] - The style of placeholder. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + placeholder(value: ResourceStr, style?: PlaceholderStyle): RichEditorAttribute; + + /** + * Set caret color of rich editor. + * + * @param { ResourceColor } value - Custom color types. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + caretColor(value: ResourceColor): RichEditorAttribute; + + /** + * Set background color of selected text in rich editor. + * + * @param { ResourceColor } value - Custom color types. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedBackgroundColor(value: ResourceColor): RichEditorAttribute; + + /** + * Called when edit status is changed + * + * @param { Callback } callback - when edit status is changed + * @returns { RichEditorAttribute } returns The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onEditingChange(callback: Callback): RichEditorAttribute; + + /** + * Set enter key type of soft keyboard. + * + * @param { EnterKeyType } value - the enter key type of soft keyboard + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enterKeyType(value: EnterKeyType): RichEditorAttribute; + + /** + * Called when submitted. + * + * @param { SubmitCallback } callback - callback of the listened event. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onSubmit(callback: SubmitCallback): RichEditorAttribute; + + /** + * Called before text changed. + * + * @param { Callback } callback - The triggered function before text content is about to change. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillChange(callback: Callback) : RichEditorAttribute; + + /** + * Called after text changed. + * + * @param { OnDidChangeCallback } callback - The triggered function after content changed. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidChange(callback: OnDidChangeCallback) : RichEditorAttribute; + + /** + * Called before the cut event. + * + * @param { Callback } callback - Called before the cut event. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onCut(callback: Callback): RichEditorAttribute; + + /** + * Called before the copy event. + * + * @param { Callback } callback - Called before the copy event. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onCopy(callback: Callback): RichEditorAttribute; + + /** + * Set the custom text menu. + * + * @param { EditMenuOptions } editMenu - Customize text menu options. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + editMenuOptions(editMenu: EditMenuOptions): RichEditorAttribute; + + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } isEnabled - Whether enable request keyboard when on focus. + * @returns { RichEditorAttribute } Returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableKeyboardOnFocus(isEnabled: boolean): RichEditorAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): RichEditorAttribute; + + /** + * Define bar state of the RichEditor. + * + * @param { BarState } state - bar state. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + barState(state: BarState): RichEditorAttribute; +} + +/** + * the callback of cut event. + * @interface CutEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CutEvent { + /** + * Prevent system cut event. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preventDefault?: Callback; +} + +/** + * the callback of copy event. + * @interface CopyEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CopyEvent { + /** + * Prevent system cut event. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preventDefault?: Callback; +} + +/** + * callback of the listened enter key event. + * + * @typedef { function } SubmitCallback + * @param { EnterKeyType } enterKey - the enter key type of soft keyboard. + * @param { SubmitEvent } event - Provides the method of keeping RichEditor editable state when submitted. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type SubmitCallback = (enterKey: EnterKeyType, event: SubmitEvent) => void; + +/** + * Callback function when the selection menu appears. + * + * @typedef { function } MenuOnAppearCallback + * @param { number } start - Start offset of the selected content in rich editor. + * @param { number } end - End offset of the selected content in rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type MenuOnAppearCallback = (start: number, end: number) => void; + +/** + * Callback function when a paste operation is performed. + * + * @typedef { function } PasteEventCallback + * @param { PasteEvent } [event] - The paste event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type PasteEventCallback = (event?: PasteEvent) => void; + +/** + * Provides an interface for writing texts. + * + * @interface RichEditorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Provides an interface for writing texts. + * + * @interface RichEditorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface RichEditorInterface { + /** + * Called when create RichEditor. + * + * @param { RichEditorOptions } value + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when create RichEditor. + * + * @param { RichEditorOptions } value + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value: RichEditorOptions): RichEditorAttribute; + + /** + * Called when create RichEditor with StyledString. + * + * @param { RichEditorStyledStringOptions} options + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (options: RichEditorStyledStringOptions): RichEditorAttribute; +} + +/** + * Defines RichEditor Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines RichEditor Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const RichEditorInstance: RichEditorAttribute; + +/** + * Defines RichEditor Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines RichEditor Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const RichEditor: RichEditorInterface; diff --git a/tests/arkts-sdk/ets/rich_text.d.ts b/tests/arkts-sdk/ets/rich_text.d.ts new file mode 100644 index 00000000..dc21fa42 --- /dev/null +++ b/tests/arkts-sdk/ets/rich_text.d.ts @@ -0,0 +1,204 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides an interface for RichText component. + * + * @interface RichTextInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides an interface for RichText component. + * + * @interface RichTextInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Provides an interface for RichText component. + * + * @interface RichTextInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ +interface RichTextInterface { + /** + * Set value. + * + * @param { string } content + * @returns { RichTextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set value. + * + * @param { string } content + * @returns { RichTextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Set value. + * + * @param { string } content + * @returns { RichTextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + (content: string): RichTextAttribute; +} + +/** + * Defines the RichText attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the RichText attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Defines the RichText attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ +declare class RichTextAttribute extends CommonMethod { + /** + * Triggered when the RichText loading starts. + * + * @param { function } callback + * @returns { RichTextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Triggered when the RichText loading starts. + * + * @param { function } callback + * @returns { RichTextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Triggered when the RichText loading starts. + * + * @param { function } callback + * @returns { RichTextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + onStart(callback: () => void): RichTextAttribute; + + /** + * Triggered when the RichText loading ends. + * + * @param { function } callback + * @returns { RichTextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Triggered when the RichText loading ends. + * + * @param { function } callback + * @returns { RichTextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Triggered when the RichText loading ends. + * + * @param { function } callback + * @returns { RichTextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + onComplete(callback: () => void): RichTextAttribute; +} + +/** + * Defines RichText Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines RichText Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Defines RichText Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ +declare const RichText: RichTextInterface; + +/** + * Defines RichText Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines RichText Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Defines RichText Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ +declare const RichTextInstance: RichTextAttribute; diff --git a/tests/arkts-subset/ets/navigator.d.ts b/tests/arkts-sdk/ets/root_scene.d.ts similarity index 30% rename from tests/arkts-subset/ets/navigator.d.ts rename to tests/arkts-sdk/ets/root_scene.d.ts index b01af1eb..503451a4 100644 --- a/tests/arkts-subset/ets/navigator.d.ts +++ b/tests/arkts-sdk/ets/root_scene.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 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 @@ -13,16 +13,68 @@ * limitations under the License. */ -interface NavigatorInterface { - (): NavigatorAttribute; - // (value?: { target: string; type?: NavigationType }): NavigatorAttribute; +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the session of RootScene. + * + * @interface RootSceneSession + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +interface RootSceneSession { +} + +/** + * Defines the interface of RootScene. + * + * @interface RootSceneInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +interface RootSceneInterface { + /** + * Called when the RootScene is used. + * + * @param { RootSceneSession } session - indicates the session of RootScene. + * @returns { RootSceneAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + (session: RootSceneSession): RootSceneAttribute; } -declare class NavigatorAttribute extends CommonMethod { - // active(value: boolean): NavigatorAttribute; - // type(value: NavigationType): NavigatorAttribute; - // target(value: string): NavigatorAttribute; - // params(value: object): NavigatorAttribute; +/** + * Defines the attribute functions of RootScene. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare class RootSceneAttribute extends CommonMethod { } -declare const Navigator: NavigatorInterface; -declare const NavigatorInstance: NavigatorAttribute; \ No newline at end of file + +/** + * Defines the RootScene component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare const RootScene: RootSceneInterface; + +/** + * Defines the RootScene instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare const RootSceneInstance: RootSceneAttribute; diff --git a/tests/arkts-sdk/ets/row.d.ts b/tests/arkts-sdk/ets/row.d.ts new file mode 100644 index 00000000..bf9f1339 --- /dev/null +++ b/tests/arkts-sdk/ets/row.d.ts @@ -0,0 +1,356 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Define options used to construct a row. + * + * @interface RowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface RowOptions { + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + space?: string | number; +} + +/** + * The components are laid out horizontally + * + * @interface RowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The components are laid out horizontally + * + * @interface RowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * The components are laid out horizontally + * + * @interface RowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * The components are laid out horizontally + * + * @interface RowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface RowInterface { + /** + * Called when the layout is set in the horizontal direction. + * + * @param { object } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the layout is set in the horizontal direction. + * + * @param { object } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the layout is set in the horizontal direction. + * + * @param { object } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the layout is set in the horizontal direction. + * + * @param { object } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the layout is set in the horizontal direction. + * + * @param { ?RowOptions } options - row options + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options?: RowOptions): RowAttribute; +} + +/** + * Defines the row attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the row attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the row attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the row attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class RowAttribute extends CommonMethod { + /** + * Called when the vertical alignment is set. + * + * @param { VerticalAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the vertical alignment is set. + * + * @param { VerticalAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the vertical alignment is set. + * + * @param { VerticalAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the vertical alignment is set. + * + * @param { VerticalAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignItems(value: VerticalAlign): RowAttribute; + + /** + * Called when the horizontal alignment is set. + * + * @param { FlexAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the horizontal alignment is set. + * + * @param { FlexAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the horizontal alignment is set. + * + * @param { FlexAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the horizontal alignment is set. + * + * @param { FlexAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + justifyContent(value: FlexAlign): RowAttribute; + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { RowAttribute } The attribute of the row. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): RowAttribute; + /** + * Called when the Main-Axis's direction is set reversed or not + * + * @param { Optional } isReversed - If the main axis is reversed. + * @returns { RowAttribute } The attribute of the row. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + reverse(isReversed: Optional): RowAttribute; +} + +/** + * Defines Row Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Row Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Row Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Row Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Row: RowInterface; + +/** + * Defines Row Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Row Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Row Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Row Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const RowInstance: RowAttribute; diff --git a/tests/arkts-sdk/ets/row_split.d.ts b/tests/arkts-sdk/ets/row_split.d.ts new file mode 100644 index 00000000..936f5c47 --- /dev/null +++ b/tests/arkts-sdk/ets/row_split.d.ts @@ -0,0 +1,166 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides interfaces for layout in the vertical direction. + * + * @interface RowSplitInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides interfaces for layout in the vertical direction. + * + * @interface RowSplitInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides interfaces for layout in the vertical direction. + * + * @interface RowSplitInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface RowSplitInterface { + /** + * Called when the layout along the vertical direction is set. + * + * @returns { RowSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the layout along the vertical direction is set. + * + * @returns { RowSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the layout along the vertical direction is set. + * + * @returns { RowSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (): RowSplitAttribute; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class RowSplitAttribute extends CommonMethod { + /** + * Called when judging whether the split line can be dragged. + * + * @param { boolean } value + * @returns { RowSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when judging whether the split line can be dragged. + * + * @param { boolean } value + * @returns { RowSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether the split line can be dragged. + * + * @param { boolean } value + * @returns { RowSplitAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + resizeable(value: boolean): RowSplitAttribute; +} + +/** + * Defines RowSplit Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines RowSplit Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines RowSplit Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const RowSplit: RowSplitInterface; + +/** + * Defines RowSplit Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines RowSplit Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines RowSplit Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const RowSplitInstance: RowSplitAttribute; diff --git a/tests/arkts-sdk/ets/save_button.d.ts b/tests/arkts-sdk/ets/save_button.d.ts new file mode 100644 index 00000000..6def0491 --- /dev/null +++ b/tests/arkts-sdk/ets/save_button.d.ts @@ -0,0 +1,486 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Enumerates the icon styles. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the icon styles. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum SaveIconStyle { + /** + * Icon filled with the specified color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Icon filled with the specified color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + FULL_FILLED = 0, + + /** + * Icon rendered as lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Icon rendered as lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + LINES = 1, + + /** + * Icon rendered as picture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + PICTURE = 2 +} + +/** + * Enumerates the text that can be displayed on the save button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the text that can be displayed on the save button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum SaveDescription { + /** + * Download + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Download + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + DOWNLOAD = 0, + + /** + * Download File + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Download File + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + DOWNLOAD_FILE = 1, + + /** + * Save + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Save + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SAVE = 2, + + /** + * Save Image + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Save Image + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SAVE_IMAGE = 3, + + /** + * Save File + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Save File + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SAVE_FILE = 4, + + /** + * Download and Share + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Download and Share + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + DOWNLOAD_AND_SHARE = 5, + + /** + * Receive + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Receive + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + RECEIVE = 6, + + /** + * Continue to Receive + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Continue to Receive + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + CONTINUE_TO_RECEIVE = 7, + + /** + * Save to gallery + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + SAVE_TO_GALLERY = 8, + + /** + * Export to gallery + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + EXPORT_TO_GALLERY = 9, + + /** + * Quick save to gallery + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + QUICK_SAVE_TO_GALLERY = 10, + + /** + * Resave to gallery + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + RESAVE_TO_GALLERY = 11 +} + +/** + * Declares the interface for setting the save button options. + * + * @interface SaveButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Declares the interface for setting the save button options. + * + * @interface SaveButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface SaveButtonOptions { + /** + * Style of the icon to be drawn. + * + * @type { ?SaveIconStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Style of the icon to be drawn. + * + * @type { ?SaveIconStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + icon?: SaveIconStyle; + + /** + * Text to be displayed on the button. + * + * @type { ?SaveDescription } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text to be displayed on the button. + * + * @type { ?SaveDescription } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + text?: SaveDescription; + + /** + * Type of the button. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Type of the button. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + buttonType?: ButtonType; +} + +/** + * Enumerates the click event results of the save button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the click event results of the save button. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum SaveButtonOnClickResult { + /** + * Success. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Success. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SUCCESS = 0, + + /** + * Failure because the application is not temporarily authorized for saving files. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Failure because the application is not temporarily authorized for saving files. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + TEMPORARY_AUTHORIZATION_FAILED = 1 +} + +/** + * Defines the interface for setting a save button. + * + * @interface SaveButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the interface for setting a save button. + * + * @interface SaveButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +interface SaveButtonInterface { + /** + * Creates a save button. + * + * @returns { SaveButtonAttribute } Returns the attribute of the save button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Creates a save button. + * + * @returns { SaveButtonAttribute } Returns the attribute of the save button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + (): SaveButtonAttribute; + + /** + * Creates a save button with the specified composition. + * If an attribute is not set, the corresponding element will not be drawn. + * + * @param { SaveButtonOptions } options - Indicates the options of the save button. + * @returns { SaveButtonAttribute } Returns the attribute of the save button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Creates a save button with the specified composition. + * If an attribute is not set, the corresponding element will not be drawn. + * + * @param { SaveButtonOptions } options - Indicates the options of the save button. + * @returns { SaveButtonAttribute } Returns the attribute of the save button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + (options: SaveButtonOptions): SaveButtonAttribute; +} + +/** + * Defines the attributes of the save button. + * + * @extends SecurityComponentMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the attributes of the save button. + * + * @extends SecurityComponentMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare class SaveButtonAttribute extends SecurityComponentMethod { + /** + * Called when the save button is clicked. + * + * @param { function } event + * @returns { SaveButtonAttribute } Returns the attribute of the save button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the save button is clicked. + * + * @param { function } event + * @returns { SaveButtonAttribute } Returns the attribute of the save button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + onClick(event: (event: ClickEvent, result: SaveButtonOnClickResult) => void): SaveButtonAttribute; +} + +/** + * Defines a button that interacts with the security component service to + * request the permission for saving files in the media library. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines a button that interacts with the security component service to + * request the permission for saving files in the media library. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare const SaveButton: SaveButtonInterface; + +/** + * Defines a save button instance for secure access. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines a save button instance for secure access. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare const SaveButtonInstance: SaveButtonAttribute; diff --git a/tests/arkts-subset/ets/select.d.ts b/tests/arkts-sdk/ets/screen.d.ts similarity index 34% rename from tests/arkts-subset/ets/select.d.ts rename to tests/arkts-sdk/ets/screen.d.ts index d4eb6d8e..2a9afb3a 100644 --- a/tests/arkts-subset/ets/select.d.ts +++ b/tests/arkts-sdk/ets/screen.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 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 @@ -13,30 +13,57 @@ * limitations under the License. */ -declare interface SelectOption { - value: ResourceStr; - icon?: ResourceStr; - symbolIcon?: SymbolGlyphModifier; -} - -declare interface MenuItemConfiguration extends CommonConfiguration { - - value: ResourceStr; - - icon?: ResourceStr; - - triggerSelect(index: number, value: string): void; -} +/** + * @file + * @kit ArkUI + */ -interface SelectInterface { - (options: Array): SelectAttribute; +/** + * Defines the interface of Screen. + * + * @interface ScreenInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +interface ScreenInterface { + /** + * Called when the Screen is used. + * + * @param { number } screenId - indicates the identifier of a screen. + * @returns { ScreenAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + (screenId: number): ScreenAttribute; } -declare class SelectAttribute extends CommonMethod { - - menuItemContentModifier(modifier: ContentModifier): SelectAttribute; +/** + * Defines the attribute functions of Screen. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare class ScreenAttribute extends CommonMethod { } -declare const Select: SelectInterface; +/** + * Defines the Screen component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare const Screen: ScreenInterface; -declare const SelectInstance: SelectAttribute; +/** + * Defines the Screen instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare const ScreenInstance: ScreenAttribute; diff --git a/tests/arkts-sdk/ets/scroll.d.ts b/tests/arkts-sdk/ets/scroll.d.ts new file mode 100644 index 00000000..cc1731a2 --- /dev/null +++ b/tests/arkts-sdk/ets/scroll.d.ts @@ -0,0 +1,1622 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Content scroll direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Content scroll direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Content scroll direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ScrollDirection { + /** + * Vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Vertical, + + /** + * Horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Horizontal, + + /** + * Free scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Free, + + /** + * Non-scrollable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Non-scrollable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Non-scrollable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, +} + +/** + * ScrollAlign. + * + * @enum { number } ScrollAlign + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * ScrollAlign. + * + * @enum { number } ScrollAlign + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ScrollAlign { + /** + * Start position alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Start position alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + START, + + /** + * Center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CENTER, + + /** + * End position alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * End position alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + END, + + /** + * Scroll the minimum distance to fully display the specified item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scroll the minimum distance to fully display the specified item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + AUTO, +} + +/** + * OffsetResult info. + * + * @interface OffsetResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface OffsetResult { + /** + * The X-axis offset. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + xOffset: number; + + /** + * The y-axis offset. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + yOffset: number; +} + +/** + * Define scroll edge options + * + * @interface ScrollEdgeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ScrollEdgeOptions { + /** + * The fasten speed of scrolling to the edge, unit is vp/s. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + velocity?: number; +} + +/** + * Define scrollToIndex options + * + * @interface ScrollToIndexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ScrollToIndexOptions { + /** + * The extra offset of scrolling to the index, unit is vp. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + extraOffset?: LengthMetrics; +} + +/** + * Provides custom animation parameters. + * + * @interface ScrollAnimationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ScrollAnimationOptions { + /** + * Set the duration of the animation. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + duration?: number; + + /** + * Set the curve of the animation. + * + * @type { ?(Curve | ICurve) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + curve?: Curve | ICurve; + + /** + * Set whether the animation can over the boundary. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + canOverScroll?: boolean; +} + +/** + * OffsetOptions info. + * + * @interface OffsetOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface OffsetOptions { + /** + * The X-axis offset. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + xOffset?: Dimension; + + /** + * The y-axis offset. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + yOffset?: Dimension; +} + +/** + * Scroller + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Scroller + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Scroller + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class Scroller { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Called when the setting slides to the specified position. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the setting slides to the specified position. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the setting slides to the specified position. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the setting slides to the specified position. + * + * @param { ScrollOptions } options - scroll options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + scrollTo(options: ScrollOptions); + + /** + * Called when scrolling to the edge of the container. + * + * @param { Edge } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { Edge } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { Edge } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { Edge } value - Edge type of the container. + * @param { ScrollEdgeOptions } [options] - Options of scrolling to edge. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scrollEdge(value: Edge, options?: ScrollEdgeOptions); + + /** + * Fling the scroll view. + * + * @param { number } velocity - initial velocity of fling, in vp/s. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fling(velocity: number): void; + + /** + * Called when page turning mode is set. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when page turning mode is set. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when page turning mode is set. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when page turning mode is set. + * + * @param { ScrollPageOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + scrollPage(value: ScrollPageOptions); + + /** + * Called when page turning mode is set. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + scrollPage(value: { next: boolean; direction?: Axis }); + + /** + * Called when viewing the scroll offset. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when viewing the scroll offset. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when viewing the scroll offset. + * + * @returns { OffsetResult } Returns the current scrolling offset. If the scroller not bound to a component, the return value is void. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + currentOffset() : OffsetResult; + + /** + * Called when sliding to the specified index. + * + * @param { number } value + * @param { boolean } smooth + * @param { ScrollAlign } align + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when sliding to the specified index. + * + * @param { number } value - Index to jump to. + * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } align - Sets the alignment mode of a specified index. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when sliding to the specified index. + * + * @param { number } value - Index to jump to. + * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } align - Sets the alignment mode of a specified index. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Scroll to the specified index. + * + * @param { number } value - Index to jump to. + * @param { boolean } [smooth] - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } [align] - Sets the alignment mode of a specified index. + * @param { ScrollToIndexOptions } [options] - Sets the options of a specified index, such as extra offset. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scrollToIndex(value: number, smooth?: boolean, align?: ScrollAlign, options?: ScrollToIndexOptions); + + /** + * Called when the setting slides by offset. + * + * @param { Length } dx + * @param { Length } dy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the setting slides by offset. + * + * @param { Length } dx + * @param { Length } dy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the setting slides by offset. + * + * @param { Length } dx + * @param { Length } dy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBy(dx: Length, dy: Length); + + /** + * Indicates whether the component scrolls to the end position. + * + * @returns { boolean } Returns whether the component scrolls to the end position. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates whether the component scrolls to the end position. + * + * @returns { boolean } Returns whether the component scrolls to the end position. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + isAtEnd(): boolean; + + /** + * Get child item size and position. + * + * @param { number } index - Index of the item. + * @returns { RectResult } Returns the size and position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get child item size and position. + * + * @param { number } index - Index of the item. + * @returns { RectResult } Returns the size and position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getItemRect(index: number): RectResult; + + /** + * Get item index by position. + * + * @param { number } x - X coordinate relative to the upper left corner of the current component's original area, in vp. + * @param { number } y - Y coordinate relative to the upper left corner of the current component's original area, in vp. + * @returns { number } Index of the item. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - The controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + getItemIndex(x: number, y: number): number; +} + +/** + * Define scroll options. + * + * @interface ScrollOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface ScrollOptions { + /** + * The X-axis offset. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The X-axis offset. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + xOffset: number | string; + + /** + * The Y-axis offset. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Y-axis offset. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + yOffset: number | string; + + /** + * Descriptive animation. + * + * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters + * and the boolean type enables default spring animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Descriptive animation. + * + * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters + * and the boolean type enables default spring animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Descriptive animation. + * + * @type { ?( ScrollAnimationOptions | boolean) } The ScrollAnimationOptions type provides custom animation parameters + * and the boolean type enables default spring animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + animation?: ScrollAnimationOptions | boolean; +} + +/** + * Define scroll page options + * @interface ScrollPageOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ +declare interface ScrollPageOptions { + /** + * Control whether to scroll to the next page or the previous page. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + next: boolean; + + /** + * Set whether the scrollPage have animate. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + animation?: boolean; +} + +/** + * Define scroll snap options + * + * @interface ScrollSnapOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Define scroll snap options + * + * @interface ScrollSnapOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface ScrollSnapOptions { + /** + * Set scroll snap alignment. + * + * @type { ScrollSnapAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set scroll snap alignment. + * + * @type { ScrollSnapAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + snapAlign: ScrollSnapAlign; + + /** + * Set snap positions. When the type of snapPositions is Dimension, Scroll content is paginated by an integer + * multiple of snapPositions. When the type of snapPositions is Array, Scroll content is paginated based + * on the array of snapPositions. + * + * @type { ?(Dimension | Array) } + * @default 100% + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set snap positions. When the type of snapPositions is Dimension, Scroll content is paginated by an integer + * multiple of snapPositions. When the type of snapPositions is Array, Scroll content is paginated based + * on the array of snapPositions. + * + * @type { ?(Dimension | Array) } + * @default 100% + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + snapPagination?: Dimension | Array; + + /** + * Set whether the beginning of the Scroll content counts an a snap. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set whether the beginning of the Scroll content counts an a snap. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + enableSnapToStart?: boolean; + + /** + * Set whether the end of the Scroll content counts an a snap. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set whether the end of the Scroll content counts an a snap. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + enableSnapToEnd?: boolean; +} + +/** + * Provides interfaces for scrollable containers. + * + * @interface ScrollInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides interfaces for scrollable containers. + * + * @interface ScrollInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides interfaces for scrollable containers. + * + * @interface ScrollInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface ScrollInterface { + /** + * Called when a scrollable container is set. + * + * @param { Scroller } scroller + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a scrollable container is set. + * + * @param { Scroller } scroller + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when a scrollable container is set. + * + * @param { Scroller } scroller + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (scroller?: Scroller): ScrollAttribute; +} + +/** + * Defines a Scroll onScrollEdge callback. + * + * @typedef { function } OnScrollEdgeCallback + * @param { Edge } side - the edge position scrolled to + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnScrollEdgeCallback = (side: Edge) => void; + +/** + * The data returned by the event handler when onScrollFrameBegin. + * + * @interface OnScrollFrameBeginHandlerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface OnScrollFrameBeginHandlerResult { + /** + * Actual sliding amount, unit vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Actual sliding amount, unit vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Actual sliding amount, unit vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetRemain: number; +} + +/** + * Defines a Scroll onScrollFrameBegin callback. + * + * @typedef { function } OnScrollFrameBeginCallback + * @param { number } offset - The upcoming sliding amount, unit vp + * @param { ScrollState } state - current sliding status + * @returns { OnScrollFrameBeginHandlerResult } data - the scroll data return by handler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnScrollFrameBeginCallback = (offset: number, state: ScrollState) => OnScrollFrameBeginHandlerResult; + +/** + * Defines the scroll attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the scroll attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the scroll attribute functions. + * + * @extends ScrollableCommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class ScrollAttribute extends ScrollableCommonMethod { + /** + * Called when the scroll method is slid. + * + * @param { ScrollDirection } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the scroll method is slid. + * + * @param { ScrollDirection } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the scroll method is slid. + * + * @param { ScrollDirection } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollable(value: ScrollDirection): ScrollAttribute; + + /** + * Called when the setting slides to the specified position. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the setting slides to the specified position. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the setting slides to the specified position. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead scroll/Scroll#onWillScroll + * + */ + onScroll(event: (xOffset: number, yOffset: number) => void): ScrollAttribute; + + /** + * Called when the Scroll will scroll. + * + * @param { ScrollOnWillScrollCallback } handler - callback of Scroll + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillScroll(handler: ScrollOnWillScrollCallback): ScrollAttribute; + + /** + * Called when the Scroll did scroll. + * + * @param { ScrollOnScrollCallback } handler - callback of Scroll, + * xOffset and yOffset are offsets this frame did scroll, scrollState is current scroll state. + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidScroll(handler: ScrollOnScrollCallback): ScrollAttribute; + + /** + * Called when scrolling to the edge of the container. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { OnScrollEdgeCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollEdge(event: OnScrollEdgeCallback): ScrollAttribute; + + /** + * Called when scrolling start. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when scrolling start. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling start. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when scrolling start. + * + * @param { VoidCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollStart(event: VoidCallback): ScrollAttribute; + + /** + * Called when scrolling has stopped. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead scroll/Scroll#onScrollStop + */ + onScrollEnd(event: () => void): ScrollAttribute; + + /** + * Called when scrolling has stopped. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when scrolling has stopped. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling has stopped. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when scrolling has stopped. + * + * @param { VoidCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollStop(event: VoidCallback): ScrollAttribute; + + /** + * Called when the status of the scroll bar is set. + * + * @param { BarState } barState + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the status of the scroll bar is set. + * + * @param { BarState } barState + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the status of the scroll bar is set. + * + * @param { BarState } barState + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBar(barState: BarState): ScrollAttribute; + + /** + * Called when the color of the scroll bar is set. + * + * @param { Color | number | string } color + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the color of the scroll bar is set. + * + * @param { Color | number | string } color + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the color of the scroll bar is set. + * + * @param { Color | number | string } color + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarColor(color: Color | number | string): ScrollAttribute; + + /** + * Called when the width of the scroll bar is set. + * + * @param { number | string } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the width of the scroll bar is set. + * + * @param { number | string } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the width of the scroll bar is set. + * + * @param { number | string } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarWidth(value: number | string): ScrollAttribute; + + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } edgeEffect + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } edgeEffect + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } edgeEffect + * @param { EdgeEffectOptions } options + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + edgeEffect(edgeEffect: EdgeEffect, options?: EdgeEffectOptions): ScrollAttribute; + + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when scrolling begin each frame. + * + * @param { OnScrollFrameBeginCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollFrameBegin(event: OnScrollFrameBeginCallback): ScrollAttribute; + + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: NestedScrollOptions): ScrollAttribute; + + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { ScrollAttribute } The attribute of the scroll + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { ScrollAttribute } The attribute of the scroll + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableScrollInteraction(value: boolean): ScrollAttribute; + + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + friction(value: number | Resource): ScrollAttribute; + + /** + * Called to setting the scroll snap options. + * + * @param { ScrollSnapOptions } value - options for scroll snap. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to setting the scroll snap options. + * + * @param { ScrollSnapOptions } value - options for scroll snap. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + scrollSnap(value: ScrollSnapOptions): ScrollAttribute; + + /** + * Determines whether the scroll view stops on multiples of the content size when the user scrolls. + * + * @param { boolean } value - A boolean value determines whether paging is enabled for scroll. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Determines whether the scroll view stops on multiples of the content size when the user scrolls. + * + * @param { boolean } value - A boolean value determines whether paging is enabled for scroll. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enablePaging(value: boolean): ScrollAttribute; + + /** + * Called to setting the initial offset + * + * @param { OffsetOptions } value - options for scroll initial offset. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + initialOffset(value: OffsetOptions): ScrollAttribute; +} + +/** + * callback of Scroll, using in onDidScroll. + * + * @typedef { function } ScrollOnScrollCallback + * @param { number } xOffset - horizontal offset this frame did scroll. + * @param { number } yOffset - vertical offset this frame did scroll. + * @param { ScrollState } scrollState - current scroll state. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ScrollOnScrollCallback = (xOffset: number, yOffset: number, scrollState: ScrollState) => void; + +/** + * Called before scroll to allow developer to control real offset the Scroll can scroll. + * + * @typedef { function } ScrollOnWillScrollCallback + * @param { number } xOffset - horizontal offset this frame will scroll, which may or may not be reached. + * @param { number } yOffset - vertical offset this frame will scroll, which may or may not be reached. + * @param { ScrollState } scrollState - current scroll state. + * @param { ScrollSource } scrollSource - source of current scroll. + * @returns { void | OffsetResult } the remain offset for the Scroll, + * same as (xOffset, yOffset) when no OffsetResult is returned. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ScrollOnWillScrollCallback = + (xOffset: number, yOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => void | OffsetResult; + +/** + * Defines Scroll Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Scroll Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Scroll Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Scroll: ScrollInterface; + +/** + * Defines Scroll Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Scroll Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Scroll Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const ScrollInstance: ScrollAttribute; diff --git a/tests/arkts-sdk/ets/scroll_bar.d.ts b/tests/arkts-sdk/ets/scroll_bar.d.ts new file mode 100644 index 00000000..e5928123 --- /dev/null +++ b/tests/arkts-sdk/ets/scroll_bar.d.ts @@ -0,0 +1,333 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Content scroll direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Content scroll direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Content scroll direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ScrollBarDirection { + /** + * Vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Vertical, + + /** + * Horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Horizontal, +} + +/** + * Defines the options of ScrollBar. + * + * @interface ScrollBarOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the options of ScrollBar. + * + * @interface ScrollBarOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of ScrollBar. + * + * @interface ScrollBarOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ScrollBarOptions { + /** + * Sets the scroller of scroll bar. + * + * @type { Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the scroller of scroll bar. + * + * @type { Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the scroller of scroll bar. + * + * @type { Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scroller: Scroller; + + /** + * Sets the direction of scroll bar. + * + * @type { ?ScrollBarDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the direction of scroll bar. + * + * @type { ?ScrollBarDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the direction of scroll bar. + * + * @type { ?ScrollBarDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + direction?: ScrollBarDirection; + + /** + * Sets the state of scroll bar. + * + * @type { ?BarState } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the state of scroll bar. + * + * @type { ?BarState } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the state of scroll bar. + * + * @type { ?BarState } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + state?: BarState; +} + +/** + * Provides interfaces for scroll bar. + * + * @interface ScrollBarInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides interfaces for scroll bar. + * + * @interface ScrollBarInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides interfaces for scroll bar. + * + * @interface ScrollBarInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface ScrollBarInterface { + /** + * Called when a ScrollBar container is set. + * + * @param { ScrollBarOptions } value + * @returns { ScrollBarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when a ScrollBar container is set. + * + * @param { ScrollBarOptions } value + * @returns { ScrollBarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when a ScrollBar container is set. + * + * @param { ScrollBarOptions } value + * @returns { ScrollBarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value: ScrollBarOptions): ScrollBarAttribute; +} + +/** + * Defines the scrollbar attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the scrollbar attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the scrollbar attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class ScrollBarAttribute extends CommonMethod { + /** + * Called when setting whether to enable nested scroll. + * @param { Optional } enabled - Whether to enable nested scroll. + * @returns { ScrollBarAttribute } The attribute of the scroll bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableNestedScroll(enabled: Optional): ScrollBarAttribute; +} + +/** + * Defines ScrollBar Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines ScrollBar Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines ScrollBar Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const ScrollBar: ScrollBarInterface; + +/** + * Defines ScrollBar Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines ScrollBar Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines ScrollBar Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const ScrollBarInstance: ScrollBarAttribute; diff --git a/tests/arkts-sdk/ets/search.d.ts b/tests/arkts-sdk/ets/search.d.ts new file mode 100644 index 00000000..dfdef130 --- /dev/null +++ b/tests/arkts-sdk/ets/search.d.ts @@ -0,0 +1,1635 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class SearchController extends TextContentControllerBase { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretPosition(value: number): void; + + /** + * Exit edit state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Exit edit state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stopEditing(): void; + + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @param { SelectionOptions } [options] - Indicates the options of the text selection. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setTextSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; +} + +/** + * Enum for the style of cancel button + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum for the style of cancel button + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum CancelButtonStyle { + /** + * The value of button style constant + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of button style constant + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CONSTANT, + + /** + * The value of button style invisible + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of button style invisible + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + INVISIBLE, + + /** + * The value of button style input + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of button style input + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + INPUT +} + +/** + * Declare the type of search input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Declare the type of search input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum SearchType { + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NORMAL = 0, + + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NUMBER = 2, + + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PHONE_NUMBER = 3, + + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + EMAIL = 5, + + /** + * Number decimal entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NUMBER_DECIMAL = 12, + + /** + * URL entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + URL = 13, +} + +/** + * Options used to construct the search. + * + * @typedef SearchOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface SearchOptions { + /** + * Text input in the search text box. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text input in the search text box. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + value?: string; + + /** + * Text displayed when there is no input. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text displayed when there is no input. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text displayed when there is no input. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + placeholder?: ResourceStr; + + /** + * Path to the search icon. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Path to the search icon. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + icon?: string; + + /** + * Controller of the component. + * + * @type { ?SearchController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Controller of the component. + * + * @type { ?SearchController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + controller?: SearchController; +} + +/** + * The construct function of search + * + * @interface SearchInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The construct function of search + * + * @interface SearchInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The construct function of search + * + * @interface SearchInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface SearchInterface { + /** + * The options of SearchInterface + * + * @param { object } options + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The options of SearchInterface + * + * @param { object } options + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The options of SearchInterface + * + * @param { object } options + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * The options of SearchInterface. + * + * @param { SearchOptions } [options] - Search options. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + (options?: SearchOptions): SearchAttribute; +} + +/** + * Defines the icon options + * + * @interface IconOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the icon options + * + * @interface IconOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface IconOptions { + /** + * Set the icon size + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the icon size + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size?: Length; + + /** + * Set the icon color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the icon color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + + /** + * Set the icon resource + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the icon resource + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + src?: ResourceStr; +} + +/** + * Defines the SearchButton options + * + * @interface SearchButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the SearchButton options + * + * @interface SearchButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface SearchButtonOptions { + /** + * Set the SearchButton fontSize + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the SearchButton fontSize + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontSize?: Length; + + /** + * Set the SearchButton fontColor + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the SearchButton fontColor + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor?: ResourceColor; + + /** + * Automatically disables the search button before the user enters text + * + * @type { ?Boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + autoDisable?: Boolean; +} + +/** + * Defines the CancelButton options + * + * @interface CancelButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface CancelButtonOptions { + /** + * Set the CancelButton style + * + * @type { ?CancelButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: CancelButtonStyle; + + /** + * Set the CancelButton icon + * + * @type { ?IconOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + icon?: IconOptions; +} + +/** + * Defines the CancelButton symbol options + * + * @interface CancelButtonSymbolOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface CancelButtonSymbolOptions { + /** + * Set the CancelButton style + * + * @type { ?CancelButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: CancelButtonStyle; + + /** + * Set the CancelButton symbol icon + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + icon?: SymbolGlyphModifier; +} + +/** + * Declare the event listener callback of the enter key. + * + * @typedef { function } SearchSubmitCallback + * @param { string } searchContent - The submitted content of search. + * @param { SubmitEvent } [event] - Provides the method of keeping Search editable state when submitted. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type SearchSubmitCallback = (searchContent: string, event?: SubmitEvent) => void; + +/** + * The attribute function of search + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The attribute function of search + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The attribute function of search + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class SearchAttribute extends CommonMethod { + /** + * Set the search button text + * + * @param { string } value - indicates the text of the search button. + * @param { SearchButtonOption } option + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the search button text, fontSize and fontColor + * + * @param { string } value - indicates the text of the search button. + * @param { SearchButtonOptions } option - indicates the fontSize and fontColor of the search button. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the search button text, fontSize and fontColor + * + * @param { string } value - indicates the text of the search button. + * @param { SearchButtonOptions } option - indicates the fontSize and fontColor of the search button. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + searchButton(value: string, option?: SearchButtonOptions): SearchAttribute; + + /** + * Set the text Color + * + * @param { ResourceColor } value - indicates the color of the text. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the text Color + * + * @param { ResourceColor } value - indicates the color of the text. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): SearchAttribute; + + /** + * Set the search icon style + * + * @param { IconOptions } value - indicates the style of the search icon. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the search icon style + * + * @param { IconOptions } value - indicates the style of the search icon. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Set the search icon style + * + * @param { IconOptions | SymbolGlyphModifier } value - indicates the style of the search icon. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + searchIcon(value: IconOptions | SymbolGlyphModifier): SearchAttribute; + + /** + * Set the cancel button style + * + * @param { object } value - indicates the style of the cancel button. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the cancel button style + * + * @param { object } value - indicates the style of the cancel button. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Set the cancel button style + * + * @param { CancelButtonOptions | CancelButtonSymbolOptions } value - indicates the style of the cancel button. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cancelButton(value: CancelButtonOptions | CancelButtonSymbolOptions): SearchAttribute; + + /** + * Specify the indentation of the first line in a text-block. + * + * @param { Dimension } value - The length of text indent. + * @returns { SearchAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textIndent(value: Dimension): SearchAttribute; + + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { Callback } error + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + inputFilter(value: ResourceStr, error?: Callback): SearchAttribute; + + /** + * Called when judging whether the text editing change finished. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onEditChange(callback: Callback): SearchAttribute; + + /** + * Define the text selected background color of the text input. + * + * @param { ResourceColor } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedBackgroundColor(value: ResourceColor): SearchAttribute; + + /** + * Set the cursor style + * + * @param { CaretStyle } value - indicates the style of the cursor. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the cursor style + * + * @param { CaretStyle } value - indicates the style of the cursor. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretStyle(value: CaretStyle): SearchAttribute; + + /** + * Set the place hold text color + * + * @param { ResourceColor } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the place hold text color + * + * @param { ResourceColor } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the place hold text color + * + * @param { ResourceColor } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholderColor(value: ResourceColor): SearchAttribute; + + /** + * Set the font used for place holder text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the font used for place holder text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the font used for place holder text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholderFont(value?: Font): SearchAttribute; + + /** + * Set the font used for input text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the font used for input text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the font used for input text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textFont(value?: Font): SearchAttribute; + + /** + * Set enter key type of soft keyboard + * + * @param { EnterKeyType } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enterKeyType(value: EnterKeyType): SearchAttribute; + + /** + * Call the function when clicked the search button + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Call the function when clicked the search button + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Call the function when clicked the search button + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Call the function when clicked the search button. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSubmit(callback: Callback): SearchAttribute; + /** + * Call the function when clicked the search button. + * + * @param { SearchSubmitCallback } callback - callback of the listened event. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSubmit(callback: SearchSubmitCallback): SearchAttribute; + + /** + * Call the function when editing the input text + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Call the function when editing the input text + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Call the function when editing the input text + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Call the function when editing the input text + * + * @param { EditableTextOnChangeCallback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onChange(callback: EditableTextOnChangeCallback): SearchAttribute; + + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the text selection changes. + * + * @param { OnTextSelectionChangeCallback } callback - Callback of the listened event. + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onTextSelectionChange(callback: OnTextSelectionChangeCallback): SearchAttribute; + + /** + * Called when the content scrolls. + * + * @param { function } callback - callback of the listened event. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the content scrolls. + * + * @param { function } callback - callback of the listened event. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the content scrolls. + * + * @param { OnContentScrollCallback } callback - Callback of the listened event. + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onContentScroll(callback: OnContentScrollCallback): SearchAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCopy(callback: Callback): SearchAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCut(callback: Callback): SearchAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * Executed when a paste operation is performed. + * { string } value - The text content to be pasted. + * { PasteEvent } event - The user-defined paste event. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { OnPasteCallback } callback - Executed when a paste operation is performed. + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPaste(callback: OnPasteCallback): SearchAttribute; + + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + copyOption(value: CopyOptions): SearchAttribute; + + /** + * Called when the input of maximum text length is set. + * + * @param { number } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * crossplatform + * @since 11 + */ + /** + * Called when the input of maximum text length is set. + * + * @param { number } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * crossplatform + * @atomicservice + * @since 12 + */ + maxLength(value: number): SearchAttribute; + + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textAlign(value: TextAlign): SearchAttribute; + + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } value + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } value + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableKeyboardOnFocus(value: boolean): SearchAttribute; + + /** + * Controls whether the selection menu pops up. + * + * @param { boolean } value + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Controls whether the selection menu pops up. + * + * @param { boolean } value + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectionMenuHidden(value: boolean): SearchAttribute; + + /** + * Called when the minimum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + minFontSize(value: number | string | Resource): SearchAttribute; + + /** + * Called when the maximum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maxFontSize(value: number | string | Resource): SearchAttribute; + + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value - Set up a custom keyboard of Search + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of Search + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customKeyboard(value: CustomBuilder, options?: KeyboardOptions): SearchAttribute; + + /** + * Called when the text decoration of the text is set. + * + * @param { TextDecorationOptions } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + decoration(value: TextDecorationOptions): SearchAttribute; + + /** + * Called when the distance between text fonts is set. + * + * @param { number | string | Resource } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + letterSpacing(value: number | string | Resource): SearchAttribute; + + /** + * Called when the line height of the font is set. + * + * @param { number | string | Resource } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineHeight(value: number | string | Resource): SearchAttribute; + + /** + * Called when the search type is set. + * + * @param { SearchType } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the search type is set. + * + * @param { SearchType } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type(value: SearchType): SearchAttribute; + + /** + * Set font feature. + * + * @param { string } value - The fontFeature. + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * the values of reference to doc of search component + * number of can be single or multiple, and separated by comma ','. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFeature(value: string): SearchAttribute; + + /** + * Get text value information when about to input. + * + * @param { Callback } callback - The triggered function when text content is about to insert. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillInsert(callback: Callback): SearchAttribute; + + /** + * Get text value information when completed input. + * + * @param { Callback } callback - The triggered function when text content has been inserted. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidInsert(callback: Callback): SearchAttribute; + + /** + * Get text value information when about to delete. + * + * @param { Callback } callback - The triggered function when text content is about to delete. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDelete(callback: Callback): SearchAttribute; + + /** + * Get text value information when the deletion has been completed + * + * @param { Callback } callback - The triggered function when text content has been deleted. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidDelete(callback: Callback): SearchAttribute; + + /** + * Set the custom text menu. + * + * @param { EditMenuOptions } editMenu - Customize text menu options. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + editMenuOptions(editMenu: EditMenuOptions): SearchAttribute; + + /** + * Define the preview text mode of the text input. + * + * @param { boolean } enable - Indicates the preview text mode. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enablePreviewText(enable: boolean): SearchAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): SearchAttribute; +} + +/** + * Defines Search Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Search Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Search Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Search: SearchInterface; + +/** + * Defines Search Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Search Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Search Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const SearchInstance: SearchAttribute; diff --git a/tests/arkts-sdk/ets/security_component.d.ts b/tests/arkts-sdk/ets/security_component.d.ts new file mode 100644 index 00000000..983241c2 --- /dev/null +++ b/tests/arkts-sdk/ets/security_component.d.ts @@ -0,0 +1,530 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Enumerates the layout direction of the icon and text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the layout direction of the icon and text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum SecurityComponentLayoutDirection { + /** + * Horizontal layout. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Horizontal layout. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + HORIZONTAL = 0, + + /** + * Vertical layout. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Vertical layout. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + VERTICAL = 1 +} + +/** + * Defines the method of a security component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the method of a security component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare class SecurityComponentMethod { + /** + * Icon size. + * + * @param { Dimension } value - Indicates the size of the icon. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Icon size. + * + * @param { Dimension } value - Indicates the size of the icon. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + iconSize(value: Dimension): T; + + /** + * Layout direction of the icon and text. + * + * @param { SecurityComponentLayoutDirection } value - Indicates the layout direction of the icon and text. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Layout direction of the icon and text. + * + * @param { SecurityComponentLayoutDirection } value - Indicates the layout direction of the icon and text. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + layoutDirection(value: SecurityComponentLayoutDirection): T; + + /** + * Position of the security component. + * + * @param { Position } value - Indicates the position of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Position of the security component. + * + * @param { Position } value - Indicates the position of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + position(value: Position): T; + + /** + * Anchor of the security component for positioning. The top start edge of the component is used as + * the reference point for offset. + * + * @param { Position } value - Indicates the anchor of the component when it is positioned. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Anchor of the security component for positioning. The top start edge of the component is used as + * the reference point for offset. + * + * @param { Position } value - Indicates the anchor of the component when it is positioned. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + markAnchor(value: Position): T; + + /** + * Coordinate offset relative to the layout position. + * Setting this attribute does not affect the layout of the parent container. + * The position is adjusted only during drawing. + * + * @param { Position } value - Indicates the offset value. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Coordinate offset relative to the layout position. + * Setting this attribute does not affect the layout of the parent container. + * The position is adjusted only during drawing. + * + * @param { Position } value - Indicates the offset value. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. + * The position is adjusted only during drawing. + * + * @param { Position | Edges | LocalizedEdges } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + offset(value: Position | Edges | LocalizedEdges): T; + + /** + * Font size of the inner text. + * + * @param { Dimension } value - Indicates the font size of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Font size of the inner text. + * + * @param { Dimension } value - Indicates the font size of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + fontSize(value: Dimension): T; + + /** + * Font style of the inner text. + * + * @param { FontStyle } value - Indicates the font style of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Font style of the inner text. + * + * @param { FontStyle } value - Indicates the font style of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): T; + + /** + * Font weight of the inner text. + * + * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Font weight of the inner text. + * + * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): T; + + /** + * Font family of the inner text. + * + * @param { string | Resource } value - Indicates the font family of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Font family of the inner text. + * + * @param { string | Resource } value - Indicates the font family of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + fontFamily(value: string | Resource): T; + + /** + * Font color of the inner text. + * + * @param { ResourceColor } value - Indicates the font color of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Font color of the inner text. + * + * @param { ResourceColor } value - Indicates the font color of the text in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): T; + + /** + * Color of the icon. + * + * @param { ResourceColor } value - Indicates the icon color in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Color of the icon. + * + * @param { ResourceColor } value - Indicates the icon color in the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + iconColor(value: ResourceColor): T; + + /** + * Background color. + * + * @param { ResourceColor } value - Indicates the background color of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Background color. + * + * @param { ResourceColor } value - Indicates the background color of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + backgroundColor(value: ResourceColor): T; + + /** + * Style of the border. + * + * @param { BorderStyle } value - Indicates the border style of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Style of the border. + * + * @param { BorderStyle } value - Indicates the border style of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + borderStyle(value: BorderStyle): T; + + /** + * Width of the border. + * + * @param { Dimension } value - Indicates the border width of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Width of the border. + * + * @param { Dimension } value - Indicates the border width of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + borderWidth(value: Dimension): T; + + /** + * Color of the border. + * + * @param { ResourceColor } value - Indicates the border color of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Color of the border. + * + * @param { ResourceColor } value - Indicates the border color of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + borderColor(value: ResourceColor): T; + + /** + * Radius of the border. + * + * @param { Dimension } value - Indicates the border radius of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Radius of the border. + * + * @param { Dimension } value - Indicates the border radius of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + borderRadius(value: Dimension): T; + + /** + * Padding between the background border and icon/inner text. + * + * @param { Padding | Dimension } value - Indicates the padding of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Padding between the background border and icon/inner text. + * + * @param { Padding | Dimension } value - Indicates the padding of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + padding(value: Padding | Dimension): T; + + /** + * Space between the inner text and icon. + * + * @param { Dimension } value - Indicates the space between the inner text and icon. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Space between the inner text and icon. + * + * @param { Dimension } value - Indicates the space between the inner text and icon. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + textIconSpace(value: Dimension): T; + + /** + * Key. User can set an key to the component to identify it. + * + * @param { string } value - identify the key of the component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + * @test + */ + key(value: string): T; + + /** + * Sets the width of the component. + * + * @param { Length } value - Indicates the width of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Sets the width of the component. + * + * @param { Length } value - Indicates the width of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + width(value: Length): T; + + /** + * Sets the height of the component. + * + * @param { Length } value - Indicates the height of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Sets the height of the component. + * + * @param { Length } value - Indicates the height of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + height(value: Length): T; + + /** + * The size of the component. + * + * @param { SizeOptions } value - Indicates the size of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * The size of the component. + * + * @param { SizeOptions } value - Indicates the size of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + size(value: SizeOptions): T; + + /** + * constraint Size: + * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. + * + * @param { ConstraintSizeOptions } value - Indicates the constraint size of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * constraint Size: + * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. + * + * @param { ConstraintSizeOptions } value - Indicates the constraint size of the security component. + * @returns { T } Returns the attribute of the security component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + constraintSize(value: ConstraintSizeOptions): T; +} diff --git a/tests/arkts-sdk/ets/select.d.ts b/tests/arkts-sdk/ets/select.d.ts new file mode 100644 index 00000000..18c61c1f --- /dev/null +++ b/tests/arkts-sdk/ets/select.d.ts @@ -0,0 +1,932 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * The declare of selectOption. + * + * @interface SelectOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The declare of selectOption. + * + * @interface SelectOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The declare of selectOption. + * + * @interface SelectOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SelectOption { + /** + * Option string. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Option string. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Option string. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: ResourceStr; + + /** + * Option icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Option icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Option icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + icon?: ResourceStr; + + /** + * Indicates the symbol icon of this menu item. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolIcon?: SymbolGlyphModifier; +} + +/** + * Provides the select interface. + * + * @interface SelectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides the select interface. + * + * @interface SelectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides the select interface. + * + * @interface SelectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface SelectInterface { + /** + * Called when the select is set. + * + * @param { Array } options + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the select is set. + * + * @param { Array } options + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the select is set. + * + * @param { Array } options + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (options: Array): SelectAttribute; +} + +/** + * The enum for arrow position in the select + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The enum for arrow position in the select + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ArrowPosition { + /** + * The value of arrow position end + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of arrow position end + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + END = 0, + + /** + * The value of arrow position start + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of arrow position start + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + START = 1 +} + +/** + * The type of alignment between select and menu. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * The type of alignment between select and menu. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum MenuAlignType { + /** + * The value of menu align type start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The value of menu align type start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + START, + /** + * The value of menu align type center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The value of menu align type center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CENTER, + /** + * The value of menu align type end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The value of menu align type end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + END +} + +/** + * The commonMethod of select. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The commonMethod of select. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The commonMethod of select. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class SelectAttribute extends CommonMethod { + /** + * Sets the serial number of the select item, starting from 0. + * + * @param { number } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the serial number of the select item, starting from 0. + * + * @param { number } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the serial number of the select item, starting from 0. + * + * @param { number | Resource } value - the serial number of the select item. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selected(value: number | Resource): SelectAttribute; + + /** + * Sets the text display of the select button itself. + * + * @param { string } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the text display of the select button itself. + * + * @param { string } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text display of the select button itself. + * + * @param { ResourceStr } value - the text display of the select button itself. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value(value: ResourceStr): SelectAttribute; + + /** + * Sets the text properties of the select button itself. + * + * @param { Font } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the text properties of the select button itself. + * + * @param { Font } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text properties of the select button itself. + * + * @param { Font } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font(value: Font): SelectAttribute; + + /** + * Sets the text color of the select button itself. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the text color of the select button itself. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text color of the select button itself. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): SelectAttribute; + + /** + * Sets the background color of the selected items in the select. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the background color of the selected items in the select. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the background color of the selected items in the select. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedOptionBgColor(value: ResourceColor): SelectAttribute; + + /** + * Sets the text style of the selected items in the select. + * + * @param { Font } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the text style of the selected items in the select. + * + * @param { Font } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of the selected items in the select. + * + * @param { Font } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedOptionFont(value: Font): SelectAttribute; + + /** + * Sets the text color of the selected item in the select. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the text color of the selected item in the select. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text color of the selected item in the select. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedOptionFontColor(value: ResourceColor): SelectAttribute; + + /** + * Sets the background color of the select item. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the background color of the select item. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the background color of the select item. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + optionBgColor(value: ResourceColor): SelectAttribute; + + /** + * Sets the text style for select items. + * + * @param { Font } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the text style for select items. + * + * @param { Font } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style for select items. + * + * @param { Font } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + optionFont(value: Font): SelectAttribute; + + /** + * Sets the text color for select items. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the text color for select items. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text color for select items. + * + * @param { ResourceColor } value + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + optionFontColor(value: ResourceColor): SelectAttribute; + + /** + * Callback for selecting an item from the select. + * + * @param { function } callback + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Callback for selecting an item from the select. + * + * @param { function } callback + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback for selecting an item from the select. + * + * @param { function } callback + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onSelect(callback: (index: number, value: string) => void): SelectAttribute; + + /** + * Set the space for text and icon in select + * + * @param { Length } value - indicates the length of the space + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the space for text and icon in select + * + * @param { Length } value - indicates the length of the space + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + space(value: Length): SelectAttribute; + + /** + * Set the layout direction for text and arrow in select + * + * @param { ArrowPosition } value - indicates the arrow position in the select + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the layout direction for text and arrow in select + * + * @param { ArrowPosition } value - indicates the arrow position in the select + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowPosition(value: ArrowPosition): SelectAttribute; + + /** + * Set the alignment between select and menu. + * + * @param { MenuAlignType } alignType - The type of alignment between select and menu. + * @param { Offset } offset - The offset between select and menu. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set the alignment between select and menu. + * + * @param { MenuAlignType } alignType - The type of alignment between select and menu. + * @param { Offset } offset - The offset between select and menu. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + menuAlign(alignType: MenuAlignType, offset?: Offset): SelectAttribute; + + /** + * Set the width of each option and set whether the option width fit the trigger. + * + * @param { Dimension | OptionWidthMode } value - The length of option width and decide option width to fit trigger or content. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the width of each option and set whether the option width fit the trigger. + * + * @param { Dimension | OptionWidthMode } value - The length of option width and decide option width to fit trigger or content. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + optionWidth(value: Dimension | OptionWidthMode ): SelectAttribute; + + /** + * Set the height of each option. + * + * @param { Dimension } value - The length of option height. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the height of each option. + * + * @param { Dimension } value - The length of option height. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + optionHeight(value: Dimension): SelectAttribute; + + /** + * set the menu's background color + * + * @param { ResourceColor } value - The backgroundColor of menu. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * set the menu's background color + * + * @param { ResourceColor } value - The backgroundColor of menu. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + menuBackgroundColor(value: ResourceColor): SelectAttribute; + + /** + * set menu background blur Style + * + * @param { BlurStyle } value - The BackgroundBlurStyle of menu. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * set menu background blur Style + * + * @param { BlurStyle } value - The BackgroundBlurStyle of menu. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + menuBackgroundBlurStyle(value: BlurStyle): SelectAttribute; + + /** + * Sets the size for controls within Select Component. + * + * @param { ControlSize } value - control size + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + controlSize(value: ControlSize): SelectAttribute; + + /** + * Register a ContentModifier for each menu item. + * + * @param { ContentModifier } modifier - The content modifier of select menu item. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + menuItemContentModifier(modifier: ContentModifier): SelectAttribute; + + /** + * Set the divider of select. + * + * @param { Optional | null } options Set custom and hidden divider. + * @returns { SelectAttribute } the attribute of the select. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + divider(options: Optional | null): SelectAttribute; +} + +/** + * MenuItemConfiguration used by menu item content modifier. + * + * @interface MenuItemConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface MenuItemConfiguration extends CommonConfiguration{ + /** + * Indicates the text of this menu item. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value: ResourceStr; + + /** + * Indicates the icon of this menu item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + icon?: ResourceStr; + + /** + * Indicates the symbol icon of this menu item. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolIcon?: SymbolGlyphModifier; + + /** + * Indicates whether this menu item is selected or not. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selected: boolean; + + /** + * Indicates the index of the menu item. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: number; + + /** + * Select this menu item. + * + * @param { number } index - The value of menu item index. + * @param { string } value - The value of menu item text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + triggerSelect(index: number, value: string): void; +} +/** + * Defines Select Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Select Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Select Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Select: SelectInterface; + +/** + * Defines Select Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Select Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Select Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const SelectInstance: SelectAttribute; diff --git a/tests/arkts-sdk/ets/shape.d.ts b/tests/arkts-sdk/ets/shape.d.ts new file mode 100644 index 00000000..271b80fc --- /dev/null +++ b/tests/arkts-sdk/ets/shape.d.ts @@ -0,0 +1,930 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Viewport bounding box. + * + * @interface ViewportRect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface ViewportRect { + /** + * Viewport X coordinate. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Viewport X coordinate. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Viewport X coordinate. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Viewport X coordinate. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: number | string; + + /** + * Viewport Y coordinate. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Viewport Y coordinate. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Viewport Y coordinate. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Viewport Y coordinate. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: number | string; + + /** + * Viewport width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Viewport width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Viewport width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Viewport width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: number | string; + + /** + * Viewport height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Viewport height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Viewport height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Viewport height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: number | string +} + +/** + * Provides interfaces for drawing components. + * + * @interface ShapeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides interfaces for drawing components. + * + * @interface ShapeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides interfaces for drawing components. + * + * @interface ShapeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides interfaces for drawing components. + * + * @interface ShapeInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ShapeInterface { + /** + * Use the new function to create Shape. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Use the new function to create Shape. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use the new function to create Shape. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + new (value?: PixelMap): ShapeAttribute; + + /** + * Called when a component is drawn. + * + * @param { PixelMap } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a component is drawn. + * + * @param { PixelMap } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when a component is drawn. + * + * @param { PixelMap } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value: PixelMap): ShapeAttribute; + + /** + * Called when a component is drawn. + * + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a component is drawn. + * + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when a component is drawn. + * + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when a component is drawn. + * + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (): ShapeAttribute; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ShapeAttribute extends CommonMethod { + /** + * Viewport of shape + * + * @param { object } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Viewport of shape + * + * @param { object } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Viewport of shape + * + * @param { object } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Viewport of shape + * + * @param { object } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Viewport of shape + * + * @param { ViewportRect } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + viewPort(value: ViewportRect): ShapeAttribute; + + /** + * Called when the border color is set. + * + * @param { ResourceColor } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the border color is set. + * + * @param { ResourceColor } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the border color is set. + * + * @param { ResourceColor } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the border color is set. + * + * @param { ResourceColor } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stroke(value: ResourceColor): ShapeAttribute; + + /** + * Called when the fill color is set. + * + * @param { ResourceColor } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the fill color is set. + * + * @param { ResourceColor } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the fill color is set. + * + * @param { ResourceColor } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the fill color is set. + * + * @param { ResourceColor } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fill(value: ResourceColor): ShapeAttribute; + + /** + * Called when the offset of the starting point of border drawing is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the offset of the starting point of border drawing is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the offset of the starting point of border drawing is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the offset of the starting point of border drawing is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeDashOffset(value: number | string): ShapeAttribute; + + /** + * Called when the gap of the border is set. + * + * @param { Array } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the gap of the border is set. + * + * @param { Array } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the gap of the border is set. + * + * @param { Array } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the gap of the border is set. + * + * @param { Array } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeDashArray(value: Array): ShapeAttribute; + + /** + * Called when the path endpoint drawing style is set. + * + * @param { LineCapStyle } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the path endpoint drawing style is set. + * + * @param { LineCapStyle } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the path endpoint drawing style is set. + * + * @param { LineCapStyle } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the path endpoint drawing style is set. + * + * @param { LineCapStyle } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeLineCap(value: LineCapStyle): ShapeAttribute; + + /** + * Called when the border corner drawing style is set. + * + * @param { LineJoinStyle } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the border corner drawing style is set. + * + * @param { LineJoinStyle } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the border corner drawing style is set. + * + * @param { LineJoinStyle } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the border corner drawing style is set. + * + * @param { LineJoinStyle } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeLineJoin(value: LineJoinStyle): ShapeAttribute; + + /** + * Called when the limit value for drawing acute angles as oblique angles is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the limit value for drawing acute angles as oblique angles is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the limit value for drawing acute angles as oblique angles is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the limit value for drawing acute angles as oblique angles is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeMiterLimit(value: number | string): ShapeAttribute; + + /** + * Called when the opacity of the border is set. + * + * @param { number | string | Resource } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the opacity of the border is set. + * + * @param { number | string | Resource } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the opacity of the border is set. + * + * @param { number | string | Resource } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the opacity of the border is set. + * + * @param { number | string | Resource } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeOpacity(value: number | string | Resource): ShapeAttribute; + + /** + * Called when the transparency of the border is set. + * + * @param { number | string | Resource } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the transparency of the border is set. + * + * @param { number | string | Resource } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the transparency of the border is set. + * + * @param { number | string | Resource } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the transparency of the border is set. + * + * @param { number | string | Resource } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fillOpacity(value: number | string | Resource): ShapeAttribute; + + /** + * Called when the width of the border is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the width of the border is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the width of the border is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the width of the border is set. + * + * @param { number | string } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeWidth(value: number | string): ShapeAttribute; + + /** + * Called when setting whether anti aliasing is on. + * + * @param { boolean } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting whether anti aliasing is on. + * + * @param { boolean } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when setting whether anti aliasing is on. + * + * @param { boolean } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting whether anti aliasing is on. + * + * @param { boolean } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + antiAlias(value: boolean): ShapeAttribute; + + /** + * Called when shape mesh. + * + * @param { Array } value + * @param { number } column + * @param { number } row + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when shape mesh. + * + * @param { Array } value + * @param { number } column + * @param { number } row + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when shape mesh. + * + * @param { Array } value + * @param { number } column + * @param { number } row + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when shape mesh. + * + * @param { Array } value + * @param { number } column + * @param { number } row + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + mesh(value: Array, column: number, row: number): ShapeAttribute; +} + +/** + * Defines Shape Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Shape Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Shape Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Shape Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Shape: ShapeInterface; + +/** + * Defines Shape Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Shape Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Shape Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Shape Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ShapeInstance: ShapeAttribute; diff --git a/tests/arkts-sdk/ets/sidebar.d.ts b/tests/arkts-sdk/ets/sidebar.d.ts new file mode 100644 index 00000000..c48390db --- /dev/null +++ b/tests/arkts-sdk/ets/sidebar.d.ts @@ -0,0 +1,1083 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Sets the sidebar style of showing + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Sets the sidebar style of showing + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sets the sidebar style of showing + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SideBarContainerType { + /** + * The sidebar invisible + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The sidebar invisible + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The sidebar invisible + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Embed, + + /** + * The sidebar visible + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The sidebar visible + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The sidebar visible + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Overlay, + + /** + * The sidebar AUTO + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The sidebar AUTO + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + AUTO, +} + +/** + * Sets the sidebar position of showing + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Sets the sidebar position of showing + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sets the sidebar position of showing + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SideBarPosition { + /** + * The sidebar is on the Start of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The sidebar is on the Start of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The sidebar is on the Start of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Start, + + /** + * The sidebar is on the End of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The sidebar is on the End of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The sidebar is on the End of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + End, +} + +/** + * ButtonStyle icons. + * + * @typedef ButtonStyleIcon + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface ButtonIconOptions { + /** + * Defines whether an icon is shown. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines whether an icon is shown. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines whether an icon is shown. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + shown: string | PixelMap | Resource; + + /** + * Defines whether an icon is hidden. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines whether an icon is hidden. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines whether an icon is hidden. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hidden: string | PixelMap | Resource; + + /** + * Defines whether an icon is switching. + * + * @type { ?(string | PixelMap | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines whether an icon is switching. + * + * @type { ?(string | PixelMap | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines whether an icon is switching. + * + * @type { ?(string | PixelMap | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + switching?: string | PixelMap | Resource; +} + +/** + * Sets the control button style + * + * @interface ButtonStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Sets the control button style + * + * @interface ButtonStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sets the control button style + * + * @interface ButtonStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ButtonStyle { + /** + * Set the left of control button + * default value is 16vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the left of control button + * default value is 16vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the left of control button + * default value is 16vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + left?: number; + + /** + * Set the top of control button + * default value is 48vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the top of control button + * default value is 48vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the top of control button + * default value is 48vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + top?: number; + + /** + * Set the width of control button + * default value is 32vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the width of control button + * default value is 24vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the width of control button + * default value is 24vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + width?: number; + + /** + * Set the height of control button + * default value is 32vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the height of control button + * default value is 24vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the height of control button + * default value is 24vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + height?: number; + + /** + * Set the button icon when sidebar status has changed + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the button icon when sidebar status has changed + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the button icon when sidebar status has changed + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Set the button icon when sidebar status has changed + * + * @type { ?ButtonIconOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + icons?: ButtonIconOptions; +} + +/** + * The construct function of sidebar + * + * @interface SideBarContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The construct function of sidebar + * + * @interface SideBarContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The construct function of sidebar + * + * @interface SideBarContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface SideBarContainerInterface { + /** + * Called when showing the sidebar of a block entry. + * + * @param { SideBarContainerType } type + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when showing the sidebar of a block entry. + * + * @param { SideBarContainerType } type + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when showing the sidebar of a block entry. + * + * @param { SideBarContainerType } type + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (type?: SideBarContainerType): SideBarContainerAttribute; +} + +/** + * Provides an interface for the style of a divider including stroke width, color, start margin + * and end margin + * + * @interface DividerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for the style of a divider including stroke width, color, start margin + * and end margin + * + * @interface DividerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface DividerStyle { + /** + * Define the stroke width of the divider + * + * @type { Length } + * @default 1vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the stroke width of the divider + * + * @type { Length } + * @default 1vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeWidth: Length; + + /** + * Define the color of the divider + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the color of the divider + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + + /** + * Define the start margin of the divider + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the start margin of the divider + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + startMargin?: Length; + + /** + * Define the end margin of the divider + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the end margin of the divider + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + endMargin?: Length; +} + +/** + * The attribute function of sidebar + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The attribute function of sidebar + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The attribute function of sidebar + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class SideBarContainerAttribute extends CommonMethod { + /** + * Callback showControlButton function when setting the status of sidebar + * + * @param { boolean } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Callback showControlButton function when setting the status of sidebar + * + * @param { boolean } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback showControlButton function when setting the status of sidebar + * + * @param { boolean } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showSideBar(value: boolean): SideBarContainerAttribute; + + /** + * Callback controlButton function when setting the style of button + * + * @param { ButtonStyle } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Callback controlButton function when setting the style of button + * + * @param { ButtonStyle } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback controlButton function when setting the style of button + * + * @param { ButtonStyle } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + controlButton(value: ButtonStyle): SideBarContainerAttribute; + + /** + * Callback showControlButton function when setting the status of button + * + * @param { boolean } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Callback showControlButton function when setting the status of button + * + * @param { boolean } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback showControlButton function when setting the status of button + * + * @param { boolean } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showControlButton(value: boolean): SideBarContainerAttribute; + + /** + * Trigger callback when sidebar style of showing change finished. + * + * @param { function } callback + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger callback when sidebar style of showing change finished. + * + * @param { function } callback + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger callback when sidebar style of showing change finished. + * + * @param { function } callback + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onChange(callback: (value: boolean) => void): SideBarContainerAttribute; + + /** + * Sets the length of sidebar. + * default value is 200vp. + * + * @param { number } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the length of sidebar. + * default value is 240vp. + * + * @param { number } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the length of sidebar. + * default value is 240vp. + * + * @param { number } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + sideBarWidth(value: number): SideBarContainerAttribute; + + /** + * Sets the min length of sidebar. + * default value is 200vp. + * + * @param { number } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the min length of sidebar. + * default value is 240vp. + * + * @param { number } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the min length of sidebar. + * default value is 240vp. + * + * @param { number } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + minSideBarWidth(value: number): SideBarContainerAttribute; + + /** + * Sets the max length of sidebar. + * default value is 280vp. + * + * @param { number } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the max length of sidebar. + * default value is 280vp. + * + * @param { number } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the max length of sidebar. + * default value is 280vp. + * + * @param { number } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxSideBarWidth(value: number): SideBarContainerAttribute; + + /** + * Sets the length of sidebar. + * + * @param { Length } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the length of sidebar. + * + * @param { Length } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the length of sidebar. + * + * @param { Length } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + sideBarWidth(value: Length): SideBarContainerAttribute; + + /** + * Sets the min length of sidebar. + * default value is 200vp. + * + * @param { Length } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the min length of sidebar. + * default value is 200vp. + * + * @param { Length } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the min length of sidebar. + * default value is 200vp. + * + * @param { Length } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + minSideBarWidth(value: Length): SideBarContainerAttribute; + + /** + * Sets the max length of sidebar. + * default value is 280vp. + * + * @param { Length } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the max length of sidebar. + * default value is 280vp. + * + * @param { Length } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the max length of sidebar. + * default value is 280vp. + * + * @param { Length } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxSideBarWidth(value: Length): SideBarContainerAttribute; + + /** + * Sets whether to automatically hide when drag sidebar width is less than the minimum width. + * default value is true. + * + * @param { boolean } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets whether to automatically hide when drag sidebar width is less than the minimum width. + * default value is true. + * + * @param { boolean } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets whether to automatically hide when drag sidebar width is less than the minimum width. + * default value is true. + * + * @param { boolean } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + autoHide(value: boolean): SideBarContainerAttribute; + + /** + * Called when determining the location of the sidebar. + * default value is Start. + * + * @param { SideBarPosition } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when determining the location of the sidebar. + * default value is Start. + * + * @param { SideBarPosition } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when determining the location of the sidebar. + * default value is Start. + * + * @param { SideBarPosition } value + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + sideBarPosition(value: SideBarPosition): SideBarContainerAttribute; + + /** + * Set divider style for sideBarContainer + * + * @param { DividerStyle | null } value - indicates the style of the divider or whether to show the divider. + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set divider style for sideBarContainer + * + * @param { DividerStyle | null } value - indicates the style of the divider or whether to show the divider. + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + divider(value: DividerStyle | null): SideBarContainerAttribute; + + /** + * Sets the min length of content. + * default value is 360vp. + * + * @param { Dimension } value - min length of content. + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the min length of content. + * default value is 360vp. + * + * @param { Dimension } value - min length of content. + * @returns { SideBarContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + minContentWidth(value: Dimension): SideBarContainerAttribute; +} + +/** + * Defines SideBarContainer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines SideBarContainer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines SideBarContainer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const SideBarContainer: SideBarContainerInterface; + +/** + * Defines SideBarContainer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines SideBarContainer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines SideBarContainer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const SideBarContainerInstance: SideBarContainerAttribute; diff --git a/tests/arkts-sdk/ets/slider.d.ts b/tests/arkts-sdk/ets/slider.d.ts new file mode 100644 index 00000000..5817e3d4 --- /dev/null +++ b/tests/arkts-sdk/ets/slider.d.ts @@ -0,0 +1,1582 @@ +/* + * Copyright (c) 2021-2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Declare sliderstyle + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare sliderstyle + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare sliderstyle + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare sliderstyle + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum SliderStyle { + /** + * The slider is on the slide rail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The slider is on the slide rail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The slider is on the slide rail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The slider is on the slide rail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + OutSet, + + /** + * The slider is in the slide rail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The slider is in the slide rail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The slider is in the slide rail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The slider is in the slide rail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + InSet, + /** + * No slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NONE, +} + +/** + * Declare SliderChangeMode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare SliderChangeMode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare SliderChangeMode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare SliderChangeMode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum SliderChangeMode { + /** + * Start dragging the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Start dragging the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Start dragging the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Start dragging the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Begin, + + /** + * Drag the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Drag the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Drag the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Drag the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Moving, + + /** + * End dragging the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * End dragging the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * End dragging the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * End dragging the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, + + /** + * Click the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Click the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Click the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Click the slider. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Click, +} + +/** + * Declare SliderInteraction + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum SliderInteraction { + /** + * Allow user to slide the block and click track to move the block + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SLIDE_AND_CLICK, + + /** + * Only allow user to slide the block + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SLIDE_ONLY, + + /** + * Allow user to slide the block and click track to move the block, but click value only change when touch up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SLIDE_AND_CLICK_UP = 2 +} + +/** + * Defines the valid slidable range. If and only if MIN <= from <= to <= MAX, sliding range can be set successfully. + * + * @interface SlideRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SlideRange { + /** + * Set the start point of sliding range. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + from?: number; + + /** + * Set the end point of sliding range. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + to?: number; +} + +/** + * Defines the options of Slider. + * + * @interface SliderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of Slider. + * + * @interface SliderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of Slider. + * + * @interface SliderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of Slider. + * + * @interface SliderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface SliderOptions { + /** + * Current value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Current value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Current value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Current value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + value?: number; + + /** + * Sets the min value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the min value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the min value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the min value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + min?: number; + + /** + * Sets the max value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the max value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the max value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the max value of Slider. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + max?: number; + + /** + * Sets the step of each slide value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the step of each slide value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the step of each slide value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the step of each slide value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + step?: number; + + /** + * Sets the slider style. + * + * @type { ?SliderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the slider style. + * + * @type { ?SliderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the slider style. + * + * @type { ?SliderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the slider style. + * + * @type { ?SliderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + style?: SliderStyle; + + /** + * Sets the slider direction style. + * + * @type { ?Axis } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the slider direction style. + * + * @type { ?Axis } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the slider direction style. + * + * @type { ?Axis } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the slider direction style. + * + * @type { ?Axis } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + direction?: Axis; + + /** + * Set whether the direction of the slider needs to be reversed. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set whether the direction of the slider needs to be reversed. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set whether the direction of the slider needs to be reversed. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set whether the direction of the slider needs to be reversed. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + reverse?: boolean; +} + +/** + * Declare SliderBlockType + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare SliderBlockType + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SliderBlockType { + /** + * Use the default block. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use the default block. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DEFAULT, + + /** + * Use an image as the slider block. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use an image as the slider block. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + IMAGE, + + /** + * Use a shape as the slider block. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use a shape as the slider block. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SHAPE, +} + +/** + * Defines the style of slider block. + * + * @interface SliderBlockStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the style of slider block. + * + * @interface SliderBlockStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SliderBlockStyle { + /** + * Sets the type of slider block. + * + * @type { SliderBlockType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the type of slider block. + * + * @type { SliderBlockType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type: SliderBlockType; + + /** + * Sets the image of slider block while the type is set to SliderBlockType.Image. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the image of slider block while the type is set to SliderBlockType.Image. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + image?: ResourceStr; + + /** + * Sets the shape of slider block while the type is set to SliderBlockType.Shape. + * + * @type { ?(CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the shape of slider block while the type is set to SliderBlockType.Shape. + * + * @type { ?(CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + shape?: CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute; +} + +/** + * Defines the callback type used in SliderConfiguration. + * + * @typedef {function} SliderTriggerChangeCallback + * @param { number } value - The value of slider. + * @param { SliderChangeMode } mode - The changeMode of slider. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type SliderTriggerChangeCallback = (value: number, mode: SliderChangeMode) => void; + +/** + * SliderConfiguration used by slider content modifier + * + * @interface SliderConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SliderConfiguration extends CommonConfiguration { + /** + * Current progress value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value: number; + + /** + * Minimum value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + min: number; + + /** + * Maximum value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + max: number; + + /** + * The sliding step size of Slider. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + step: number; + + /** + * Trigger slider change + * + * @type { SliderTriggerChangeCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + triggerChange: SliderTriggerChangeCallback; +} + +/** + * Provides an interface for the slide bar component. + * + * @interface SliderInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for the slide bar component. + * + * @interface SliderInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides an interface for the slide bar component. + * + * @interface SliderInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for the slide bar component. + * + * @interface SliderInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface SliderInterface { + /** + * Called when the slider bar component is used. + * + * @param { SliderOptions } options + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the slider bar component is used. + * + * @param { SliderOptions } options + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the slider bar component is used. + * + * @param { SliderOptions } options + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the slider bar component is used. + * + * @param { SliderOptions } options + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (options?: SliderOptions): SliderAttribute; +} + +/** + * Defines the attribute functions of Slider. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the attribute functions of Slider. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the attribute functions of Slider. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the attribute functions of Slider. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class SliderAttribute extends CommonMethod { + /** + * Called when the slider color of the slider bar is set. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the slider color of the slider bar is set. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the slider color of the slider bar is set. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the slider color of the slider bar is set. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + blockColor(value: ResourceColor): SliderAttribute; + + /** + * Called when the track color of the slider is set. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the track color of the slider is set. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the track color of the slider is set. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the track color of the slider is set. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the track color of the slider is set. + * + * @param { ResourceColor | LinearGradient } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + trackColor(value: ResourceColor | LinearGradient): SliderAttribute; + + /** + * Called when the slider of the slider bar is set to slide over the area color. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the slider of the slider bar is set to slide over the area color. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the slider of the slider bar is set to slide over the area color. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the slider of the slider bar is set to slide over the area color. + * + * @param { ResourceColor } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedColor(value: ResourceColor): SliderAttribute; + + /** + * Called when the minimum label is set. + * + * @param { string } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead min + */ + minLabel(value: string): SliderAttribute; + + /** + * Called when the maximum label is set. + * + * @param { string } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead max + */ + maxLabel(value: string): SliderAttribute; + + /** + * Called when setting whether to display step size. + * + * @param { boolean } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting whether to display step size. + * + * @param { boolean } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when setting whether to display step size. + * + * @param { boolean } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting whether to display step size. + * + * @param { boolean } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + showSteps(value: boolean): SliderAttribute; + + /** + * Called when the percentage of bubble prompt is set when sliding. + * + * @param { boolean } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the percentage of bubble prompt is set when sliding. + * + * @param { boolean } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the percentage of bubble prompt is set when sliding. + * + * @param { boolean } value - Whether to display the bubble. + * @param { ResourceStr } content - Text content in the bubble. If the content is not specified, the current + * percentage is displayed by default. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the percentage of bubble prompt is set when sliding. + * + * @param { boolean } value - Whether to display the bubble. + * @param { ResourceStr } content - Text content in the bubble. If the content is not specified, the current + * percentage is displayed by default. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + showTips(value: boolean, content?: ResourceStr): SliderAttribute; + + /** + * Called when the thickness of track is set. + * + * @param { Length } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the thickness of track is set. + * + * @param { Length } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the thickness of track is set. + * + * @param { Length } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the thickness of track is set. + * + * @param { Length } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + trackThickness(value: Length): SliderAttribute; + + /** + * Called when the selection value changes. + * + * @param { function } callback + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the selection value changes. + * + * @param { function } callback + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the selection value changes. + * + * @param { function } callback + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the selection value changes. + * + * @param { function } callback + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onChange(callback: (value: number, mode: SliderChangeMode) => void): SliderAttribute; + + /** + * Called when the border color of block is set. + * + * @param { ResourceColor } value - the border color of block. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the border color of block is set. + * + * @param { ResourceColor } value - the border color of block. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + blockBorderColor(value: ResourceColor): SliderAttribute; + + /** + * Called when the border width of block is set. + * + * @param { Length } value - the border width of block. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the border width of block is set. + * + * @param { Length } value - the border width of block. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + blockBorderWidth(value: Length): SliderAttribute; + + /** + * Called when the color of step is set. + * + * @param { ResourceColor } value - the color of step. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the color of step is set. + * + * @param { ResourceColor } value - the color of step. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stepColor(value: ResourceColor): SliderAttribute; + + /** + * Called when the radius of track border is set. + * + * @param { Length } value - the radius of track border. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the radius of track border is set. + * + * @param { Length } value - the radius of track border. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + trackBorderRadius(value: Length): SliderAttribute; + + /** + * Called when the radius of selected part is set. + * + * @param { Dimension } value - the radius of selected part. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedBorderRadius(value: Dimension): SliderAttribute; + + /** + * Called when the size of block is set. + * + * @param { SizeOptions } value - the size of block. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the size of block is set. + * + * @param { SizeOptions } value - the size of block. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + blockSize(value: SizeOptions): SliderAttribute; + + /** + * Called when the style of block is set. + * + * @param { SliderBlockStyle } value - the style of block. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the style of block is set. + * + * @param { SliderBlockStyle } value - the style of block. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + blockStyle(value: SliderBlockStyle): SliderAttribute; + + /** + * Called when the diameter of step is set. + * + * @param { Length } value - the diameter of step. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the diameter of step is set. + * + * @param { Length } value - the diameter of step. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stepSize(value: Length): SliderAttribute; + + /** + * Sets the interaction mode of the slider. + * + * @param { SliderInteraction } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + sliderInteractionMode(value: SliderInteraction): SliderAttribute; + + /** + * Sets the min value when Slider response to drag event. + * + * @param { number } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + minResponsiveDistance(value: number): SliderAttribute; + + /** + * Set the content modifier of slider. + * + * @param { ContentModifier } modifier - The content modifier of slider. + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): SliderAttribute; + + /** + * Set the valid slidable range. + * + * @param { SlideRange } value + * @returns { SliderAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + slideRange(value: SlideRange): SliderAttribute; +} + +/** + * Defines Slider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Slider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Slider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Slider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Slider: SliderInterface; + +/** + * Defines Slider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Slider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Slider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Slider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const SliderInstance: SliderAttribute; diff --git a/tests/arkts-sdk/ets/span.d.ts b/tests/arkts-sdk/ets/span.d.ts new file mode 100644 index 00000000..ece02031 --- /dev/null +++ b/tests/arkts-sdk/ets/span.d.ts @@ -0,0 +1,688 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Define the background style of span. + * + * @interface TextBackgroundStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Define the background style of span. + * + * @interface TextBackgroundStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextBackgroundStyle { + /** + * Background color of span. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Background color of span. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * Background radius of span. + * + * @type { ?(Dimension | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Background radius of span. + * + * @type { ?(Dimension | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius?: Dimension | BorderRadiuses; +} + +/** + * Define the BaseSpan class, contains the common methods of span. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Define the BaseSpan class, contains the common methods of span. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class BaseSpan extends CommonMethod { + /** + * Span background style. + * + * @param { TextBackgroundStyle } style - The background style of span. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Span background style. + * + * @param { TextBackgroundStyle } style - The background style of span. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textBackgroundStyle(style: TextBackgroundStyle): T; + + /** + * Base line offset of the Span. + * + * @param { LengthMetrics } value - The base line offset of the Span. + * @returns { T } The attribute of the Span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + baselineOffset(value: LengthMetrics): T; +} + +/** + * Provide text decoration. + * + * @interface SpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provide text decoration. + * + * @interface SpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provide text decoration. + * + * @interface SpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provide text decoration. + * + * @interface SpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface SpanInterface { + /** + * Called when text is entered in span. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when text is entered in span. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when text is entered in span. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when text is entered in span. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (value: string | Resource): SpanAttribute; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends BaseSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class SpanAttribute extends BaseSpan { + /** + * Called when the font is set. + * + * @param { Font } value - the span font size and weight and family and style. + * @returns { SpanAttribute } The attribute of the span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the font is set. + * + * @param { Font } value - the span font size and weight and family and style. + * @returns { SpanAttribute } The attribute of the span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font(value: Font): SpanAttribute; + + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): SpanAttribute; + + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontSize(value: number | string | Resource): SpanAttribute; + + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): SpanAttribute; + + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): SpanAttribute; + + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontFamily(value: string | Resource): SpanAttribute; + + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { DecorationStyleInterface } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + decoration(value: DecorationStyleInterface): SpanAttribute; + + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + letterSpacing(value: number | string): SpanAttribute; + + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + textCase(value: TextCase): SpanAttribute; + + /** + * Called when the line height of the span is set. + * + * @param { Length } value - The line height of the span. + * @returns { SpanAttribute } The attribute of the span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the line height of the span is set. + * + * @param { Length } value - The line height of the span. + * @returns { SpanAttribute } The attribute of the span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + lineHeight(value: Length): SpanAttribute; + + /** + * Called when the text shadow is set. + * + * @param { ShadowOptions | Array } value - The shadow options. + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the text shadow is set. + * + * @param { ShadowOptions | Array } value - The shadow options. + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textShadow(value: ShadowOptions | Array): SpanAttribute; +} + +/** + * Defines Span Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Span Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Span Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Span Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Span: SpanInterface; + +/** + * Defines Span Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Span Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Span Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Span Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const SpanInstance: SpanAttribute; diff --git a/tests/arkts-sdk/ets/stack.d.ts b/tests/arkts-sdk/ets/stack.d.ts new file mode 100644 index 00000000..d3505d6c --- /dev/null +++ b/tests/arkts-sdk/ets/stack.d.ts @@ -0,0 +1,297 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Options used to construct the stack. + * + * @interface StackOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface StackOptions { + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignContent?: Alignment; +} + +/** + * Provides ports for stacking containers. + * + * @interface StackInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides ports for stacking containers. + * + * @interface StackInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides ports for stacking containers. + * + * @interface StackInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides ports for stacking containers. + * + * @interface StackInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface StackInterface { + /** + * Set the value. + * + * @param { object } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Set the options. + * + * @param { ?StackOptions } options - stack options + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options?: StackOptions): StackAttribute; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class StackAttribute extends CommonMethod { + /** + * Called when the occupancy of items in the container is set. + * + * @param { Alignment } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the occupancy of items in the container is set. + * + * @param { Alignment } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the occupancy of items in the container is set. + * + * @param { Alignment } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the occupancy of items in the container is set. + * + * @param { Alignment } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignContent(value: Alignment): StackAttribute; + + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { StackAttribute } The attribute of the stack. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): StackAttribute; +} + +/** + * Defines Stack Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Stack Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Stack Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Stack Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Stack: StackInterface; + +/** + * Defines Stack Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Stack Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Stack Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Stack Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const StackInstance: StackAttribute; diff --git a/tests/arkts-sdk/ets/state_management.d.ts b/tests/arkts-sdk/ets/state_management.d.ts new file mode 100644 index 00000000..7db8947e --- /dev/null +++ b/tests/arkts-sdk/ets/state_management.d.ts @@ -0,0 +1,189 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the ColorMode of device. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the ColorMode of device. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum ColorMode { + /** + * Light mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Light mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + LIGHT = 0, + + /** + * Dark mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Dark mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + DARK, +} + +/** + * Defines the LayoutDirection of device. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the LayoutDirection of device. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum LayoutDirection { + /** + * Elements are laid out from left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elements are laid out from left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + LTR, + + /** + * Elements are laid out from right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elements are laid out from right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + RTL, + + /** + * Elements are laid out from auto. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Elements are laid out from auto. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + Auto, +} + +/** + * Defines the base class of storage. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare class Storage { + /** + * Constructor parameters. + * + * @param { boolean } needCrossThread + * @param { string } file + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + constructor(needCrossThread?: boolean, file?: string); + + /** + * Called when data is obtained. + * + * @param { string } key + * @returns { string | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + get(key: string): string | undefined; + + /** + * Called when setting. + * + * @param { string } key + * @param { any } val + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + set(key: string, val: any): void; + + /** + * Called when data is cleared. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + clear(): void; + + /** + * Called when data is deleted. + * + * @param { string } key + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + delete(key: string): void; +} diff --git a/tests/arkts-sdk/ets/stepper.d.ts b/tests/arkts-sdk/ets/stepper.d.ts new file mode 100644 index 00000000..f8167577 --- /dev/null +++ b/tests/arkts-sdk/ets/stepper.d.ts @@ -0,0 +1,291 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Declare the stepper. + * + * @interface StepperInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Declare the stepper. + * + * @interface StepperInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the stepper. + * + * @interface StepperInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface StepperInterface { + /** + * Called when the stepper component is used. + * + * @param { object } value + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the stepper component is used. + * + * @param { object } value + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the stepper component is used. + * + * @param { object } value + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { index?: number }): StepperAttribute; +} + +/** + * Defines the stepper attribute functions + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the stepper attribute functions + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the stepper attribute functions + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class StepperAttribute extends CommonMethod { + /** + * Callback when the finish label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Callback when the finish label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the finish label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onFinish(callback: () => void): StepperAttribute; + + /** + * Callback when the skip label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Callback when the skip label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the skip label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onSkip(callback: () => void): StepperAttribute; + + /** + * Callback when the change label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Callback when the change label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the change label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onChange(callback: (prevIndex: number, index: number) => void): StepperAttribute; + + /** + * Callback when the next label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Callback when the next label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the next label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onNext(callback: (index: number, pendingIndex: number) => void): StepperAttribute; + + /** + * Callback when the previous label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Callback when the previous label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the previous label is clicked. + * + * @param { function } callback + * @returns { StepperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onPrevious(callback: (index: number, pendingIndex: number) => void): StepperAttribute; +} + +/** + * Defines Stepper Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Stepper Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Stepper Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Stepper: StepperInterface; + +/** + * Defines Stepper Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Stepper Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Stepper Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const StepperInstance: StepperAttribute; diff --git a/tests/arkts-sdk/ets/stepper_item.d.ts b/tests/arkts-sdk/ets/stepper_item.d.ts new file mode 100644 index 00000000..09673bc4 --- /dev/null +++ b/tests/arkts-sdk/ets/stepper_item.d.ts @@ -0,0 +1,348 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * ItemState + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * ItemState + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * ItemState + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ItemState { + /** + * Default State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Default State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Normal, + + /** + * Disabled State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Disabled State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Disabled State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Disabled, + + /** + * Waiting State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Waiting State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Waiting State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Waiting, + + /** + * Skip State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Skip State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Skip State + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Skip, +} + +/** + * Provides an interface for switching the stepperItem view on stepper container. + * + * @interface StepperItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides an interface for switching the stepperItem view on stepper container. + * + * @interface StepperItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for switching the stepperItem view on stepper container. + * + * @interface StepperItemInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface StepperItemInterface { + /** + * Called when the stepperItem component is used. + * + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the stepperItem component is used. + * + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the stepperItem component is used. + * + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (): StepperItemAttribute; +} + +/** + * Defines the stepper item attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the stepper item attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the stepper item attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class StepperItemAttribute extends CommonMethod { + /** + * Called when the value of stepperItem prevLabel is set + * + * @param { string } value + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the value of stepperItem prevLabel is set + * + * @param { string } value + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the value of stepperItem prevLabel is set + * + * @param { string } value + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + prevLabel(value: string): StepperItemAttribute; + + /** + * Called when the value of stepperItem nextLabel is set + * + * @param { string } value + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the value of stepperItem nextLabel is set + * + * @param { string } value + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the value of stepperItem nextLabel is set + * + * @param { string } value + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nextLabel(value: string): StepperItemAttribute; + + /** + * Called when the value of stepperItem status is set + * + * @param { ItemState } value + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the value of stepperItem status is set + * + * @param { ItemState } value + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the value of stepperItem status is set + * + * @param { ItemState } value + * @returns { StepperItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + status(value?: ItemState): StepperItemAttribute; +} + +/** + * Defines StepperItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines StepperItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines StepperItem Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const StepperItemInstance: StepperItemAttribute; + +/** + * Defines StepperItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines StepperItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines StepperItem Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const StepperItem: StepperItemInterface; diff --git a/tests/arkts-sdk/ets/styled_string.d.ts b/tests/arkts-sdk/ets/styled_string.d.ts new file mode 100644 index 00000000..e9c8e0f2 --- /dev/null +++ b/tests/arkts-sdk/ets/styled_string.d.ts @@ -0,0 +1,1672 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * StyledString + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class StyledString { + /** + * constructor. + * + * @param { string | ImageAttachment | CustomSpan } value - indicates the current object value of the StyledString. + * @param { Array } [styles] - indicates the SpanStyle objects. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: string | ImageAttachment | CustomSpan, styles?: Array); + + /** + * Get the length of the StyledString's characters. + * + * @type { number } - the length of the StyledString's characters. + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly length: number; + + /** + * Get the literal content of the StyledString. + * + * @returns { string } - the literal content of the StyledString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getString(): string; + + /** + * Get the attribute objects of the subStyledString. + * + * @param { number } start - the start position of the subStyledString. + * @param { number } length - the length of the subStyledString's characters. + * @param { StyledStringKey } [styledKey] - the specified type. + * @returns { Array } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getStyles(start: number, length: number, styledKey?: StyledStringKey): Array; + + /** + * Judge if two attribute strings are equal. + * + * @param { StyledString } other - another StyledString. + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + equals(other: StyledString): boolean; + + /** + * Get the substring of the StyledString. + * + * @param { number } start - the start position of the subStyledString. + * @param { number } [length] - the length of the subStyledString's characters. + * @returns { StyledString } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + subStyledString(start: number, length?: number): StyledString; + + /** + * Returns StyledString from the provided HTML string. + * + * @param { string } html - the html text will be converted to a StyledString. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static fromHtml(html: string): Promise; + + /** + * Returns HTML string from the provided StyledString. + * + * @param { StyledString } styledString - the StyledString will be converted to a HTML string. + * @returns { string } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + static toHtml(styledString: StyledString): string; + + /** + * Returns ArrayBuffer from the serialized styled string. + * + * @param { StyledString } styledString - StyledString parameter. + * @returns { ArrayBuffer } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + static marshalling(styledString: StyledString): ArrayBuffer; + + /** + * Returns StyledString from the deserialized ArrayBuffer. + * + * @param { ArrayBuffer } buffer - The buffer will be deserialized to a StyledString. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + static unmarshalling(buffer: ArrayBuffer): Promise; +} + +/** + * StyleOptions + * + * @interface StyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface StyleOptions { + /** + * The start position of the StyleOptions. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start?: number; + + /** + * The length of the modifiedStyledString's characters. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + length?: number; + + /** + * The attribute key of the StyleOptions. + * + * @type { StyledStringKey } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + styledKey: StyledStringKey; + + /** + * The attribute value of the StyleOptions. + * + * @type { StyledStringValue } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + styledValue: StyledStringValue; +} + +/** + * SpanStyle + * + * @interface SpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SpanStyle { + /** + * The start position of the SpanStyle. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start: number; + + /** + * The length of the modifiedStyledString's characters. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + length: number; + + /** + * The attribute key of the SpanStyle. + * + * @type { StyledStringKey } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + styledKey: StyledStringKey; + + /** + * The attribute value of the SpanStyle. + * + * @type { StyledStringValue } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + styledValue: StyledStringValue; +} + +/** + * Defines TextStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +//TODO: Already exists as interface +declare class TextStyle_styled_string { + + /** + * constructor. + * + * @param { TextStyleInterface } [value] - font property object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value?: TextStyleInterface); + + /** + * Get the fontColor of the StyledString. + * + * @type { ?ResourceColor } - the set fontColor of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly fontColor?: ResourceColor; + + /** + * Get the fontFamily of the StyledString. + * + * @type { ?string } - the fontFamily of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly fontFamily?: string; + + /** + * Get the fontSize of the StyledString. + * If not undefined, the unit is vp. + * + * @type { ?number } - the fontSize of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly fontSize?: number; + + /** + * Get the fontWeight of the StyledString. + * + * @type { ?number } - the fontWeight of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly fontWeight?: number; + + /** + * Get the fontStyle of the StyledString. + * + * @type { ?FontStyle } - the fontStyle of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly fontStyle?: FontStyle; +} + +/** + * TextStyleInterface + * + * @interface TextStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextStyleInterface { + /** + * The fontColor value of the font property object. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontColor?: ResourceColor; + + /** + * The fontFamily value of the font property object. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFamily?: ResourceStr; + + /** + * The fontSize value of the font property object. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontSize?: LengthMetrics; + + /** + * The fontWeight value of the font property object. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontWeight?: number | FontWeight | string; + + /** + * The fontStyle value of the font property object. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontStyle?: FontStyle; +} + +/** + * Defines DecorationStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class DecorationStyle { + + /** + * constructor. + * + * @param { DecorationStyleInterface } value - text decoration value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: DecorationStyleInterface); + + /** + * Get the text decoration type of the StyledString. + * + * @type { TextDecorationType } - the decoration type of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly type: TextDecorationType; + + /** + * Get the decorationColor of the StyledString. + * + * @type { ?ResourceColor } - the decorationColor of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly color?: ResourceColor; + + /** + * Get the decorationStyle of the StyledString. + * + * @type { ?TextDecorationStyle } - the decorationStyle of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly style?: TextDecorationStyle; +} + +/** + * DecorationStyleInterface + * + * @interface DecorationStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DecorationStyleInterface { + /** + * The type value of the decoration property object. + * + * @type { TextDecorationType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: TextDecorationType; + + /** + * The color value of the decoration property object. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * The style value of the decoration property object. + * + * @type { ?TextDecorationStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: TextDecorationStyle; +} + +/** + * Defines BaselineOffsetStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class BaselineOffsetStyle { + + /** + * constructor. + * + * @param { LengthMetrics } value - baseline offset value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: LengthMetrics); + + /** + * Get the baselineOffset value of the StyledString. + * The unit is vp. + * + * @type { number } - the baselineOffset value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly baselineOffset: number; +} + +/** + * Defines LetterSpacingStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class LetterSpacingStyle { + + /** + * constructor. + * + * @param { LengthMetrics } value - letter space value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: LengthMetrics); + + /** + * Get the letterSpacing value of the StyledString. + * The unit is vp. + * + * @type { number } - the letterSpacing value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly letterSpacing: number; +} + +/** + * Defines TextShadowStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TextShadowStyle { + + /** + * constructor. + * + * @param { ShadowOptions | Array } value - text shadow value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: ShadowOptions | Array); + + /** + * Get the textShadow value of the StyledString. + * + * @type { Array } - the textShadow value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly textShadow: Array; +} + +/** + * Defines Sets the property string background color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare class BackgroundColorStyle { + + /** + * constructor. + * + * @param { TextBackgroundStyle } textBackgroundStyle - textBackgroundStyle value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + constructor(textBackgroundStyle: TextBackgroundStyle); + + /** + * Get the textBackgroundStyle value of the StyledString. + * + * @type { TextBackgroundStyle } - the textBackgroundStyle value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + readonly textBackgroundStyle: TextBackgroundStyle; +} + +/** + * Defines GestureStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class GestureStyle { + + /** + * constructor. + * + * @param { GestureStyleInterface } [value] - gesture event object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value?: GestureStyleInterface); +} + +/** + * Defines the Gesture Events. + * + * @interface GestureStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GestureStyleInterface { + /** + * Trigger a click event when a click is clicked. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onClick?: Callback; + + /** + * Trigger a gesture event when long press event is complete. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onLongPress?: Callback; +} + +/** + * Defines ParagraphStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ParagraphStyle { + + /** + * constructor. + * + * @param { ParagraphStyleInterface } [value] - paragraph property object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value?: ParagraphStyleInterface); + + /** + * Get the text alignment of the StyledString. + * + * @type { ?TextAlign } - the text alignment of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly textAlign?: TextAlign; + + /** + * Get the first line indentation of the StyledString. + * The unit is vp. + * + * @type { ?number } - the first line indentation of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly textIndent?: number; + + /** + * Get the maximum number of lines of the StyledString. + * + * @type { ?number } - the maximum number of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly maxLines?: number; + + /** + * Get the overflow mode of the StyledString. + * + * @type { ?TextOverflow } - the overflow mode of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly overflow?: TextOverflow; + + /** + * Get the wordBreak mode of the StyledString. + * + * @type { ?WordBreak } - the wordBreak mode of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly wordBreak?: WordBreak; + + /** + * Get the leading margin of the StyledString. + * + * @type { ?(number | LeadingMarginPlaceholder) } - the leading margin of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly leadingMargin?: number | LeadingMarginPlaceholder; +} + +/** + * ParagraphStyleInterface + * + * @interface ParagraphStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ParagraphStyleInterface { + /** + * Alignment of text. + * + * @type { ?TextAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textAlign?: TextAlign; + + /** + * Set the first line indentation. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textIndent?: LengthMetrics; + + /** + * The maximum number of lines of content. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maxLines?: number; + + /** + * The overflow mode of the content. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + overflow?: TextOverflow; + + /** + * Set word break type. + * + * @type { ?WordBreak } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + wordBreak?: WordBreak; + + /** + * Leading margin. + * + * @type { ?(LengthMetrics | LeadingMarginPlaceholder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + leadingMargin?: LengthMetrics | LeadingMarginPlaceholder; +} + +/** + * Defines LineHeightStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class LineHeightStyle { + + /** + * constructor. + * + * @param { LengthMetrics } lineHeight - line height value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(lineHeight: LengthMetrics); + + /** + * Get the lineHeight value of the StyledString. + * The unit is vp. + * + * @type { number } - the lineHeight value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly lineHeight: number; +} + +/** + * Defines the URLStyle hyperlink that allows setting a URL string. When clicking on the text to + * which the span is attached, the URLStyle will try to open the URL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare class UrlStyle { + + /** + * Constructor. + * + * @param { string } url - URL value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + constructor(url: string); + + /** + * Get the URL value of the StyledString. + * + * @type { string } - the URL value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + readonly url: string; +} + +/** + * Defines the Span Type. + * + * @typedef { TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | TextShadowStyle | + * GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | CustomSpan | + * UserDataSpan } StyledStringValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + +/** + * Defines the Span Type. + * + * @typedef { TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | TextShadowStyle | + * GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | UrlStyle | CustomSpan | + * UserDataSpan | BackgroundColorStyle } StyledStringValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type StyledStringValue = TextStyle_styled_string | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | +TextShadowStyle | GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | UrlStyle | CustomSpan | +UserDataSpan | BackgroundColorStyle; + +/** + * MutableStyledString + * + * @extends StyledString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class MutableStyledString extends StyledString { + /** + * Replace the string of the specified range. + * + * @param { number } start - the start position of the replacedString. + * @param { number } length - the length of the replacedString's characters. + * @param { string } other - must be unicode string. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replaceString(start: number, length: number, other: string): void; + + /** + * Insert the string at the specified location. + * + * @param { number } start - the start position of the insertedString. + * @param { string } other - must be unicode string. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + insertString(start: number, other: string): void; + + /** + * Remove the string of the specified range. + * + * @param { number } start - the start position of the removedString. + * @param { number } length - the length of the removedString's characters. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeString(start: number, length: number): void; + + /** + * Replace the specified range string attribute. + * + * @param { SpanStyle } spanStyle - the SpanStyle Object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replaceStyle(spanStyle: SpanStyle): void; + + /** + * Add attributes to the specified range string. + * + * @param { SpanStyle } spanStyle - the SpanStyle Object. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setStyle(spanStyle: SpanStyle): void; + + /** + * Delete the specified type attributes for the specified range string. + * + * @param { number } start - the start position of the removedAttributeStyledString. + * @param { number } length - the length of the removedAttributeStyledString's characters. + * @param { StyledStringKey } styledKey - the specified attribute type's key. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeStyle(start: number, length: number, styledKey: StyledStringKey): void; + + /** + * Delete all attributes for the specified range styledString. + * + * @param { number } start - the start position of the attributeRemovedStyledString's characters. + * @param { number } length - the length of the attributeRemovedStyledString's characters. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeStyles(start: number, length: number): void; + + /** + * Delete all attributes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + clearStyles(): void; + + /** + * Replace the StyledString of the specified range. + * + * @param { number } start - the start position of the replacedStyledString. + * @param { number } length - the length of the replacedStyledString's characters. + * @param { StyledString } other - new StyledString. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replaceStyledString(start: number, length: number, other: StyledString): void; + + /** + * Insert new StyledString at the specified location. + * + * @param { number } start - the start position of the insertedStyledString. + * @param { StyledString } other - new StyledString. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + insertStyledString(start: number, other: StyledString): void; + + /** + * Append new StyledString at the end. + * + * @param { StyledString } other - new StyledString. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + appendStyledString(other: StyledString): void; +} + + +/** + * the attribute type of the StyledString + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum StyledStringKey { + /** + * The key of TextStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FONT = 0, + + /** + * The key of DecorationStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DECORATION = 1, + + /** + * The key of BaselineOffsetStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BASELINE_OFFSET = 2, + + /** + * The key of LetterSpacingStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LETTER_SPACING = 3, + + /** + * The key of TextShadowStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TEXT_SHADOW = 4, + + /** + * The key of LineHeightStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LINE_HEIGHT = 5, + + /** + * The key of BackgroundColorStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + BACKGROUND_COLOR = 6, + + /** + * The key of UrlStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + URL = 7, + + /** + * The key of GestureStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + GESTURE = 100, + + /** + * The key of ParagraphStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PARAGRAPH_STYLE = 200, + + /** + * The key of ImageAttachment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IMAGE = 300, + + /** + * The key of CustomSpan. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CUSTOM_SPAN = 400, + + /** + * The key of UserDataSpan. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + USER_DATA = 500, +} + +/** + * Defines ImageAttachment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ImageAttachment { + + /** + * constructor. + * + * @param { ImageAttachmentInterface } value - image attachment object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: ImageAttachmentInterface); + + /** + * Get the image content of the StyledString. + * + * @type { PixelMap } - the image content of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly value: PixelMap; + + /** + * Get the imageSize of the StyledString. + * + * @type { ?SizeOptions } - the imageSize of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly size?: SizeOptions; + + /** + * Get the ImageSpanAlignment of the StyledString. + * + * @type { ?ImageSpanAlignment } - the ImageSpanAlignment of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly verticalAlign?: ImageSpanAlignment; + + /** + * Get the imageFit of the StyledString. + * + * @type { ?ImageFit } - the imageFit of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly objectFit?: ImageFit; + + /** + * Get the imageAttachmentLayoutStyle of the StyledString. + * + * @type { ?ImageAttachmentLayoutStyle } - the imageAttachmentLayoutStyle of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly layoutStyle?: ImageAttachmentLayoutStyle; +} + +/** + * Defines the ImageAttachmentInterface. + * + * @interface ImageAttachmentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ImageAttachmentInterface { + /** + * The content of the ImageAttachment. + * + * @type { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value: PixelMap; + + /** + * Image size. + * + * @type { ?SizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + size?: SizeOptions; + + /** + * Image vertical align. + * + * @type { ?ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + verticalAlign?: ImageSpanAlignment; + + /** + * Image fit. + * + * @type { ?ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + objectFit?: ImageFit; + + /** + * The Image Layout Style. + * + * @type { ?ImageAttachmentLayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + layoutStyle?: ImageAttachmentLayoutStyle; +} + +/** + * Defines the ImageAttachment Layout Style. + * + * @interface ImageAttachmentLayoutStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ImageAttachmentLayoutStyle { + /** + * Outer Margin. + * + * @type { ?(LengthMetrics | Margin) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + margin?: LengthMetrics | Margin; + + /** + * Inner margin. + * + * @type { ?(LengthMetrics | Padding) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + padding?: LengthMetrics | Padding; + + /** + * Border radius. + * + * @type { ?(LengthMetrics | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderRadius?: LengthMetrics | BorderRadiuses; +} + +/** + * Defines the CustomSpanMetrics interface. + * + * @interface CustomSpanMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CustomSpanMetrics { + /** + * CustomSpan Width. + * The unit is vp. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width: number; + + /** + * CustomSpan Height. + * The unit is vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + height?: number; +} + +/** + * Defines the CustomSpanDrawInfo interface. + * + * @interface CustomSpanDrawInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CustomSpanDrawInfo { + /** + * CustomSpan's offset relative to the parent component. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + x: number; + + /** + * The top position of the line where customSpan is located. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineTop: number; + + /** + * The bottom position of the line where customSpan is located. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineBottom: number; + + /** + * The baseline offset of the line where customSpan is located. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + baseline: number; +} + +/** + * Defines the CustomSpanMeasureInfo interface. + * + * @interface CustomSpanMeasureInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CustomSpanMeasureInfo { + /** + * Current component's fontSize value. + * The unit is fp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontSize: number; +} + +/** + * Defines CustomSpan. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare abstract class CustomSpan { + /** + * Measure the size of custom span. + * + * @param { CustomSpanMeasureInfo } measureInfo + * @returns { CustomSpanMetrics } - CustomSpan Size + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + abstract onMeasure(measureInfo: CustomSpanMeasureInfo) : CustomSpanMetrics; + + /** + * Draw the custom span. + * + * @param { DrawContext } context + * @param { CustomSpanDrawInfo } drawInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + abstract onDraw(context: DrawContext, drawInfo: CustomSpanDrawInfo): void; + + /** + * Invalidate all components that use the object, which will cause a re-render of all components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + invalidate(): void; +} + +/** + * Defines UserDataSpan. Used to store and obtain user data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare abstract class UserDataSpan {} \ No newline at end of file diff --git a/tests/arkts-sdk/ets/swiper.d.ts b/tests/arkts-sdk/ets/swiper.d.ts new file mode 100644 index 00000000..21165719 --- /dev/null +++ b/tests/arkts-sdk/ets/swiper.d.ts @@ -0,0 +1,2251 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides methods for switching components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides methods for switching components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides methods for switching components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class SwiperController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Called when the next child component is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the next child component is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the next child component is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + showNext(); + + /** + * Called when the previous subcomponent is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the previous subcomponent is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the previous subcomponent is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + showPrevious(); + + /** + * Controlling Swiper to change to the specified subcomponent. + * + * @param { number } index - the index of item to be redirected. + * @param { boolean } useAnimation - If true, swipe to index item with animation. If false, swipe to index item without animation. + * The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + changeIndex(index: number, useAnimation?: boolean); + + /** + * Called when need to stop the swiper animation. + * + * @param { function } callback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when need to stop the swiper animation. + * + * @param { function } callback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when need to stop the swiper animation. + * + * @param { function } callback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when need to stop the swiper animation. + * + * @param { ?VoidCallback } callback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + finishAnimation(callback?: VoidCallback); +} + +/** + * Defines the indicator class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the indicator class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class Indicator { + /** + * Set the indicator to the left. + * + * @param { Length } value - the indicator to the left. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator to the left. + * + * @param { Length } value - the indicator to the left. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + left(value: Length): T; + + /** + * Set the indicator to the top. + * + * @param { Length } value - the indicator to the top. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator to the top. + * + * @param { Length } value - the indicator to the top. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + top(value: Length): T; + + /** + * Set the indicator to the right. + * + * @param { Length } value - the indicator to the right. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator to the right. + * + * @param { Length } value - the indicator to the right. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + right(value: Length): T; + + /** + * Set the indicator to the bottom. + * + * @param { Length } value - the indicator to the bottom. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator to the bottom. + * + * @param { Length } value - the indicator to the bottom. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + bottom(value: Length): T; + + /** + * Set the indicator to the left in LTR + * Set the indicator to the right in RTL + * + * @param { LengthMetrics } value - the indicator to the right in LTR, indicator to the left in RTL + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + start(value: LengthMetrics): T; + + /** + * Set the indicator to the left in RTL + * Set the indicator to the right in LTR + * + * @param { LengthMetrics } value - the indicator to the left in RTL, Set the indicator to the right in LTR + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + end(value: LengthMetrics): T; + + /** + * DotIndicator class object. + * + * @returns { DotIndicator } + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * DotIndicator class object. + * + * @returns { DotIndicator } + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static dot(): DotIndicator; + + /** + * DigitIndicator class object. + * + * @returns { DigitIndicator } + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * DigitIndicator class object. + * + * @returns { DigitIndicator } + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static digit(): DigitIndicator; +} + +/** + * Define DotIndicator, the indicator type is dot. + * + * @extends Indicator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Define DotIndicator, the indicator type is dot. + * + * @extends Indicator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class DotIndicator extends Indicator { + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Set the indicator item width. + * + * @param { Length } value - the indicator item width. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator item width. + * + * @param { Length } value - the indicator item width. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + itemWidth(value: Length): DotIndicator; + + /** + * Set the indicator item height. + * + * @param { Length } value - the indicator item height. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator item height. + * + * @param { Length } value - the indicator item height. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + itemHeight(value: Length): DotIndicator; + + /** + * Set the indicator item width when selected. + * + * @param { Length } value - the indicator item width when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator item width when selected. + * + * @param { Length } value - the indicator item width when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedItemWidth(value: Length): DotIndicator; + + /** + * Set the indicator item height when selected. + * + * @param { Length } value - the indicator item height when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator item height when selected. + * + * @param { Length } value - the indicator item height when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedItemHeight(value: Length): DotIndicator; + + /** + * Setting indicator style mask. + * + * @param { boolean } value - the indicator item mask. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Setting indicator style mask. + * + * @param { boolean } value - the indicator item mask. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + mask(value: boolean): DotIndicator; + + /** + * Set the indicator color. + * + * @param { ResourceColor } value - the indicator item color. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator color. + * + * @param { ResourceColor } value - the indicator item color. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color(value: ResourceColor): DotIndicator; + + /** + * Set the navigation point color. + * + * @param { ResourceColor } value - the indicator item when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the navigation point color. + * + * @param { ResourceColor } value - the indicator item when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedColor(value: ResourceColor): DotIndicator; + + /** + * Set the Indicator maxDisplayCount when selected. + * + * @param { number } maxDisplayCount - the indicator item maxDisplayCount when selected. + * @returns { DotIndicator } return the DotIndicator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maxDisplayCount(maxDisplayCount: number): DotIndicator; +} + +/** + * Set Swiper column count adaptation. + * + * @typedef { object } SwiperAutoFill + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ +/** + * Set Swiper column count adaptation. + * + * @typedef { object } SwiperAutoFill + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ +/** + * Set Swiper column count adaptation. + * + * @typedef SwiperAutoFill + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 14 + */ +declare interface SwiperAutoFill { + /** + * Set minSize size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + * @form + */ + /** + * Set minSize size. + * + * @type { VP } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + * @form + */ + minSize: VP; +} + +/** + * Define DigitIndicator, the indicator type is digit. + * + * @extends Indicator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Define DigitIndicator, the indicator type is digit. + * + * @extends Indicator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class DigitIndicator extends Indicator { + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Set font color of the digital indicator. + * + * @param { ResourceColor } value - the indicator font color. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set font color of the digital indicator. + * + * @param { ResourceColor } value - the indicator font color. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): DigitIndicator; + + /** + * Set font color of the digital indicator when selected. + * + * @param { ResourceColor } value - the indicator font color when selected. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set font color of the digital indicator when selected. + * + * @param { ResourceColor } value - the indicator font color when selected. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedFontColor(value: ResourceColor): DigitIndicator; + + /** + * Set the digital indicator font (just support font size and weight). + * + * @param { Font } value - the indicator font size and weight. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the digital indicator font (just support font size and weight). + * + * @param { Font } value - the indicator font size and weight. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + digitFont(value: Font): DigitIndicator; + + /** + * Set the digital indicator font (just support font size and weight). + * + * @param { Font } value - the indicator font size and weight when selected. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the digital indicator font (just support font size and weight). + * + * @param { Font } value - the indicator font size and weight when selected. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedDigitFont(value: Font): DigitIndicator; +} + +/** + * Arrow object. + * + * @interface ArrowStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Arrow object. + * + * @interface ArrowStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ArrowStyle { + /** + * Is show the arrow background or not. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Is show the arrow background or not. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showBackground?: boolean; + + /** + * When the indicator show, set the arrow position is side of the indicator or in the middle of content area. + * The arrow is displayed on side of the indicator, if the value is false. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * When the indicator show, set the arrow position is side of the indicator or in the middle of content area. + * The arrow is displayed on side of the indicator, if the value is false. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + isSidebarMiddle?: boolean; + + /** + * The arrow background size. + * The size of the arrow is three-quarters of the background size, when the background is displayed. + * + * @type { ?Length } + * @default When isSidebarMiddle is false, the default value is 24vp, Otherwise,the default value is 32vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The arrow background size. + * The size of the arrow is three-quarters of the background size, when the background is displayed. + * + * @type { ?Length } + * @default When isSidebarMiddle is false, the default value is 24vp, Otherwise,the default value is 32vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundSize?: Length; + + /** + * The arrow background background color. + * + * @type { ?ResourceColor } + * @default When isSidebarMiddle is false, the default value is #00000000, Otherwise,the default value is #19182431 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The arrow background background color. + * + * @type { ?ResourceColor } + * @default When isSidebarMiddle is false, the default value is #00000000, Otherwise, the default value is #19182431 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundColor?: ResourceColor; + + /** + * The arrow size. + * The arrow size can be set, when the background is not displayed. + * The size of the arrow is three-quarters of the background size, when the background is displayed. + * + * @type { ?Length } + * @default When isSidebarMiddle is false, the default value is 18vp, Otherwise, the default value is 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The arrow size. + * The arrow size can be set, when the background is not displayed. + * The size of the arrow is three-quarters of the background size, when the background is displayed. + * + * @type { ?Length } + * @default When isSidebarMiddle is false, the default value is 18vp, Otherwise, the default value is 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowSize?: Length; + + /** + * The arrow color. + * + * @type { ?ResourceColor } + * @default #182431 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The arrow color. + * + * @type { ?ResourceColor } + * @default #182431 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowColor?: ResourceColor; +} + +/** + * Declare the size of the swiper on the spindle. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare the size of the swiper on the spindle. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare the size of the swiper on the spindle. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum SwiperDisplayMode { + /** + * Carousel map extension. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 7 + * @deprecated since 10 + * @useinstead SwiperDisplayMode#STRETCH + */ + Stretch, + + /** + * The rotation chart is self linear. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 7 + * @deprecated since 10 + * @useinstead SwiperDisplayMode#AUTO_LINEAR + */ + AutoLinear, + + /** + * Carousel map extension. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Carousel map extension. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + STRETCH, + + /** + * The rotation chart is self linear. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The rotation chart is self linear. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead Scroller#scrollTo + */ + AUTO_LINEAR, +} + +/** + * Provides an interface for sliding containers. + * + * @interface SwiperInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for sliding containers. + * + * @interface SwiperInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for sliding containers. + * + * @interface SwiperInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface SwiperInterface { + /** + * Called when a sliding container is set. + * + * @param { SwiperController } controller + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a sliding container is set. + * + * @param { SwiperController } controller + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when a sliding container is set. + * + * @param { SwiperController } controller + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (controller?: SwiperController): SwiperAttribute; +} + +/** + * Setting indicator style navigation. + * + * @interface IndicatorStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ +declare interface IndicatorStyle { + /** + * Set the indicator to the left. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + left?: Length; + + /** + * Set the indicator to the top. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + top?: Length; + + /** + * Set the indicator to the right. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + right?: Length; + + /** + * Set the indicator to the bottom. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + bottom?: Length; + + /** + * Set the indicator size. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + size?: Length; + + /** + * Setting indicator style mask. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + mask?: boolean; + + /** + * Set the indicator color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + color?: ResourceColor; + + /** + * Set the navigation point color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + selectedColor?: ResourceColor; +} + +/** + * Provides an interface for swiper animation. + * + * @interface SwiperAnimationEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for swiper animation. + * + * @interface SwiperAnimationEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SwiperAnimationEvent { + /** + * Offset of the current page to the start position of the swiper main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Offset of the current page to the start position of the swiper main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + currentOffset: number; + + /** + * Offset of the target page to the start position of the swiper main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Offset of the target page to the start position of the swiper main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + targetOffset: number; + + /** + * Start speed of the page-turning animation. The unit is vp/s. + * + * @type { number } + * @default 0.0 vp/s + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Start speed of the page-turning animation. The unit is vp/s. + * + * @type { number } + * @default 0.0 vp/s + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + velocity: number; +} + +/** + * Swiper nested scroll nested mode + + * @enum { number } SwiperNestedScrollMode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum SwiperNestedScrollMode { + /** + * Only Self response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SELF_ONLY = 0, + + /** + * Self priority response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SELF_FIRST = 1, +} + +/** + * Defines a swiper callback when onAnimationStart. + * + * @typedef { function } OnSwiperAnimationStartCallback + * @param { number } index - The index value of the swiper page that when animation start. + * @param { number } targetIndex - The target index value of the swiper page that when animation start. + * @param { SwiperAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare type OnSwiperAnimationStartCallback = (index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => void; + +/** + * Defines a swiper callback when onAnimationEnd. + * + * @typedef { function } OnSwiperAnimationEndCallback + * @param { number } index - The index value of the swiper page that when animation end. + * @param { SwiperAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare type OnSwiperAnimationEndCallback = (index: number, extraInfo: SwiperAnimationEvent) => void; + +/** + * Defines a swiper callback when onGestureSwipe. + * + * @typedef { function } OnSwiperGestureSwipeCallback + * @param { number } index - The index value of the swiper page before gesture swipe. + * @param { SwiperAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnSwiperGestureSwipeCallback = (index: number, extraInfo: SwiperAnimationEvent) => void; + +/** + * Defines the swiper attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the swiper attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the swiper attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class SwiperAttribute extends CommonMethod { + /** + * Called when the index value of the displayed subcomponent is set in the container. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the index value of the displayed subcomponent is set in the container. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the index value of the displayed subcomponent is set in the container. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + index(value: number): SwiperAttribute; + + /** + * Called when setting whether the subcomponent plays automatically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting whether the subcomponent plays automatically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting whether the subcomponent plays automatically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + autoPlay(value: boolean): SwiperAttribute; + + /** + * Called when the time interval for automatic playback is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the time interval for automatic playback is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the time interval for automatic playback is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + interval(value: number): SwiperAttribute; + + /** + * Called when you set whether the navigation point indicator is enabled. + * + * @param { boolean } value - show indicator of the swiper indicator. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set indicator is enabled, or set type style. + * + * @param { DotIndicator | DigitIndicator | boolean } value - the style value or show indicator of the swiper indicator. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set indicator is enabled, or set type style. + * + * @param { DotIndicator | DigitIndicator | boolean } value - the style value or show indicator of the swiper indicator. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + indicator(value: DotIndicator | DigitIndicator | boolean): SwiperAttribute; + + /** + * Use indicator component controller. + * + * @param { IndicatorComponentController } controller - indicator component controller. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + indicator(controller: IndicatorComponentController): SwiperAttribute; + + /** + * Set arrow is enabled, or set the arrow style. + * + * @param { ArrowStyle | boolean } value - arrow is displayed or set the arrow style. + * @param { boolean } isHoverShow - arrow is display when mouse hover in indicator hotspot. + * @returns { SwiperAttribute } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set arrow is enabled, or set the arrow style. + * + * @param { ArrowStyle | boolean } value - arrow is displayed or set the arrow style. + * @param { boolean } isHoverShow - arrow is display when mouse hover in indicator hotspot. + * @returns { SwiperAttribute } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + displayArrow(value: ArrowStyle | boolean, isHoverShow?: boolean): SwiperAttribute; + + /** + * Called when setting whether to turn on cyclic sliding. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting whether to turn on cyclic sliding. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting whether to turn on cyclic sliding. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + loop(value: boolean): SwiperAttribute; + + /** + * Called when the animation duration of the switch is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the animation duration of the switch is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the animation duration of the switch is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + duration(value: number): SwiperAttribute; + + /** + * Called when setting whether to slide vertically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting whether to slide vertically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting whether to slide vertically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + vertical(value: boolean): SwiperAttribute; + + /** + * Sets the space between child components. + * + * @param { number | string } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the space between child components. + * + * @param { number | string } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the space between child components. + * + * @param { number | string } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + itemSpace(value: number | string): SwiperAttribute; + + /** + * Called when setting the size of the swiper container on the spindle. + * + * @param { SwiperDisplayMode } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting the size of the swiper container on the spindle. + * + * @param { SwiperDisplayMode } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting the size of the swiper container on the spindle. + * + * @param { SwiperDisplayMode } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + displayMode(value: SwiperDisplayMode): SwiperAttribute; + + /** + * Sets the number of child components to be preloaded(cached). + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the number of child components to be preloaded(cached). + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the number of child components to be preloaded(cached). + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + cachedCount(value: number): SwiperAttribute; + + /** + * Sets the number of elements to display per page. + * + * @param { number | string } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the number of elements to display per page. + * + * @param { number | string | SwiperAutoFill } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the number of elements to display per page. + * + * If swipeByGroup is set to true: + * 1、All sub-items are grouped from index 0. + * 2、The number of sub-items in each group is the value of displayCount. + * 3、If the number of sub-items in the last group is less than displayCount, placeholder items are added to supplement the number of last group. + * 4、Placeholder items do not display any content and are only used as placeholders. + * 5、When turning pages, turn pages by group. + * + * @param { number | string | SwiperAutoFill } value + * @param { boolean } [swipeByGroup] - if swipe by group. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + displayCount(value: number | string | SwiperAutoFill, swipeByGroup?: boolean): SwiperAttribute; + + /** + * Invoked when setting the sliding effect + * + * @param { EdgeEffect } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Invoked when setting the sliding effect + * + * @param { EdgeEffect } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Invoked when setting the sliding effect + * + * @param { EdgeEffect } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + effectMode(value: EdgeEffect): SwiperAttribute; + + /** + * Sets whether to disable the swipe feature + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets whether to disable the swipe feature + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets whether to disable the swipe feature + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + disableSwipe(value: boolean): SwiperAttribute; + + /** + * Sets the animation curve + * + * @param { Curve | string } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the animation curve + * Curve is an enumeration type for common curves + * ICurve is a curve object + * + * @param { Curve | string | ICurve } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the animation curve + * Curve is an enumeration type for common curves + * ICurve is a curve object + * + * @param { Curve | string | ICurve } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + curve(value: Curve | string | ICurve): SwiperAttribute; + + /** + * Called when the index value changes. + * + * @param { function } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the index value changes. + * + * @param { function } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the index value changes. + * + * @param { function } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the index value changes. + * + * @param { Callback } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onChange(event: Callback): SwiperAttribute; + + /** + * Setting indicator style navigation. + * + * @param { IndicatorStyle } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + indicatorStyle(value?: IndicatorStyle): SwiperAttribute; + + /** + * The previous margin which can be used to expose a small portion of the previous item. + * + * @param { Length } value - The length of previous margin. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The previous margin which can be used to expose a small portion of the previous item. + * + * @param { Length } value - The length of previous margin. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * The previous margin which can be used to expose a small portion of the previous item. + * When the previous item is empty, do not display blank space. + * + * @param { Length } value - The length of previous margin. + * @param { boolean } [ignoreBlank] - Whether to hide(ignore) the previous margin on the first page in non-loop scenarios. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + prevMargin(value: Length, ignoreBlank?: boolean): SwiperAttribute; + + /** + * The next margin which can be used to expose a small portion of the latter item. + * + * @param { Length } value - The length of next margin. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The next margin which can be used to expose a small portion of the latter item. + * + * @param { Length } value - The length of next margin. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * The next margin which can be used to expose a small portion of the latter item. + * When the next item is empty, do not display blank space. + * + * @param { Length } value - The length of next margin. + * @param { boolean } [ignoreBlank] - Whether to hide(ignore) the next margin on the last page in non-loop scenarios. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + nextMargin(value: Length, ignoreBlank?: boolean): SwiperAttribute; + + /** + * Called when the swiper animation start. + * + * @param { function } event - the index value of the swiper page that when animation start. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the swiper animation start. + * + * @param { function } event + * "index": the index value of the swiper page that when animation start. + * "targetIndex": the target index value of the swiper page that when animation start. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the swiper animation start. + * + * @param { function } event + * "index": the index value of the swiper page that when animation start. + * "targetIndex": the target index value of the swiper page that when animation start. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the swiper animation start. + * + * @param { OnSwiperAnimationStartCallback } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onAnimationStart(event: OnSwiperAnimationStartCallback): SwiperAttribute; + + /** + * Called when the swiper animation end. + * + * @param { function } event - the index value of the swiper page that when animation end. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the swiper animation end. + * + * @param { function } event + * "index": the index value of the swiper page that when animation end. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the swiper animation end. + * + * @param { function } event + * "index": the index value of the swiper page that when animation end. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the swiper animation end. + * + * @param { OnSwiperAnimationEndCallback } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onAnimationEnd(event: OnSwiperAnimationEndCallback): SwiperAttribute; + + /** + * Called when the swiper swipe with the gesture. + * + * @param { function } event + * "index": the index value of the swiper page before gesture swipe. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the swiper swipe with the gesture. + * + * @param { function } event + * "index": the index value of the swiper page before gesture swipe. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the swiper swipe with the gesture. + * + * @param { OnSwiperGestureSwipeCallback } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onGestureSwipe(event: OnSwiperGestureSwipeCallback): SwiperAttribute; + + /** + * Called to setting the nested scroll mode. + * + * @param { SwiperNestedScrollMode } value - mode for nested scrolling. + * @returns { SwiperAttribute } the attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: SwiperNestedScrollMode): SwiperAttribute; + + /** + * Custom swiper content transition animation. + * + * @param { SwiperContentAnimatedTransition } transition - custom content transition animation. + * @returns { SwiperAttribute } the attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customContentTransition(transition: SwiperContentAnimatedTransition): SwiperAttribute; + + /** + * Called when the swiper content did scroll. + * + * @param { ContentDidScrollCallback } handler - callback of scroll, + * selectedIndex is the index value of the swiper content selected before animation start. + * index is the index value of the swiper content. + * position is the moving ratio of the swiper content from the start position of the swiper main axis. + * mainAxisLength is the swiper main axis length for calculating position. + * @returns { SwiperAttribute } the attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onContentDidScroll(handler: ContentDidScrollCallback): SwiperAttribute; + + /** + * Setting whether the indicator is interactive. + * + * @param { boolean } value - Whether the indicator is interactive. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + indicatorInteractive(value: boolean): SwiperAttribute; +} + +/** + * Defines the swiper content animated transition options. + * + * @interface SwiperContentAnimatedTransition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SwiperContentAnimatedTransition { + /** + * Defines the timeout of custom content transition animation after the page is moved out of the swiper. The unit is ms. + * If SwiperContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. + * + * @type { ?number } + * @default 0 ms + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + timeout?: number; + + /** + * Called when custom content transition animation start. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition: Callback; +} + +/** + * The proxy of SwiperContentAnimatedTransition. + * + * @interface SwiperContentTransitionProxy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SwiperContentTransitionProxy { + /** + * the index value of the swiper content selected before animation start. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedIndex: number; + + /** + * The index value of the swiper content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: number; + + /** + * the moving ratio of the swiper content from the start position of the swiper main axis. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + position: number; + + /** + * the swiper main axis length for calculating position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + mainAxisLength: number; + + /** + * Notifies Swiper page the custom content transition animation is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + finishTransition(): void; +} + +/** + * The callback of onContentDidScroll. + * + * @typedef { Function } ContentDidScrollCallback + * @param { number } selectedIndex - the index value of the swiper content selected before animation start. + * @param { number } index - the index value of the swiper content. + * @param { number } position - the moving ratio of the swiper content from the start position of the swiper main axis. + * @param { number } mainAxisLength - the swiper main axis length for calculating position. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ContentDidScrollCallback = (selectedIndex: number, index: number, position: number, mainAxisLength: number) => void; + +/** + * Defines Swiper Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Swiper Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Swiper Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Swiper: SwiperInterface; + +/** + * Defines Swiper Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Swiper Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Swiper Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const SwiperInstance: SwiperAttribute; diff --git a/tests/arkts-sdk/ets/symbol_span.d.ts b/tests/arkts-sdk/ets/symbol_span.d.ts new file mode 100644 index 00000000..4bd66bfb --- /dev/null +++ b/tests/arkts-sdk/ets/symbol_span.d.ts @@ -0,0 +1,239 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides an interface for SymbolSpan. + * + * @interface SymbolSpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Provides an interface for SymbolSpan. + * + * @interface SymbolSpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +interface SymbolSpanInterface { + /** + * Called when resource is entered in SymbolSpan. + * + * @param { Resource } value + * @returns { SymbolSpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when resource is entered in SymbolSpan. + * + * @param { Resource } value + * @returns { SymbolSpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + (value: Resource): SymbolSpanAttribute; +} + +/** + * Provides attribute for SymbolSpan. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Provides attribute for SymbolSpan. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class SymbolSpanAttribute extends CommonMethod { + /** + * Called when the SymbolSpan size is set. + * + * @param { number | string | Resource } value + * @returns { SymbolSpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the SymbolSpan size is set. + * + * @param { number | string | Resource } value + * @returns { SymbolSpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontSize(value: number | string | Resource): SymbolSpanAttribute; + + /** + * Called when the SymbolSpan color is set. + * + * @param { Array } value + * @returns { SymbolSpanAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the SymbolSpan color is set. + * + * @param { Array } value + * @returns { SymbolSpanAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontColor(value: Array): SymbolSpanAttribute; + + /** + * Called when the font SymbolSpan weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SymbolSpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the font SymbolSpan weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SymbolSpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontWeight(value: number | FontWeight | string): SymbolSpanAttribute; + + /** + * Called when the SymbolSpan effect is set. + * + * @param { SymbolEffectStrategy } value + * @returns { SymbolSpanAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the SymbolSpan effect is set. + * + * @param { SymbolEffectStrategy } value + * @returns { SymbolSpanAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + effectStrategy(value: SymbolEffectStrategy): SymbolSpanAttribute; + + /** + * Called when the SymbolSpan rendering strategy is set. + * + * @param { SymbolRenderingStrategy } value + * @returns { SymbolSpanAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the SymbolSpan rendering strategy is set. + * + * @param { SymbolRenderingStrategy } value + * @returns { SymbolSpanAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + renderingStrategy(value: SymbolRenderingStrategy): SymbolSpanAttribute; + + /** + * Sets the attribute modifier. + * + * @param { AttributeModifier } modifier - The instance of symbol span modifier. + * @returns { SymbolSpanAttribute } the attribute of the SymbolSpanAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + attributeModifier(modifier: AttributeModifier): SymbolSpanAttribute; +} + +/** + * Defines SymbolSpan Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines SymbolSpan Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const SymbolSpan: SymbolSpanInterface; + +/** + * Defines SymbolSpan Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines SymbolSpan Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const SymbolSpanInstance: SymbolSpanAttribute; diff --git a/tests/arkts-sdk/ets/symbolglyph.d.ts b/tests/arkts-sdk/ets/symbolglyph.d.ts new file mode 100644 index 00000000..a3aa24c8 --- /dev/null +++ b/tests/arkts-sdk/ets/symbolglyph.d.ts @@ -0,0 +1,770 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides an interface for SymbolGlyph. + * + * @interface SymbolGlyphInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Provides an interface for SymbolGlyph. + * + * @interface SymbolGlyphInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +interface SymbolGlyphInterface { + /** + * Called when resource is entered in SymbolGlyph. + * + * @param { Resource } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when resource is entered in SymbolGlyph. + * + * @param { Resource } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + (value?: Resource): SymbolGlyphAttribute; +} + +/** + * The symbol rendering strategy. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * The symbol rendering strategy. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum SymbolRenderingStrategy { + /** + * The single rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The single rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SINGLE = 0, + + /** + * The multiple color rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The multiple color rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + MULTIPLE_COLOR = 1, + + /** + * The multiple opacity rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The multiple opacity rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + MULTIPLE_OPACITY = 2, +} + +/** + * The symbol effect strategy. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * The symbol effect strategy. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum SymbolEffectStrategy { + /** + * There is no effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * There is no effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NONE = 0, + + /** + * The scale effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The scale effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SCALE = 1, + + /** + * The hierarchical effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The hierarchical effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + HIERARCHICAL = 2, +} + +/** + * The direction type of symbol effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum EffectDirection { + /** + * The scale down animation of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DOWN = 0, + /** + * The scale up animation of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + UP = 1, +} + +/** + * Declare scope type of the symbol effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum EffectScope { + /** + * The layered animation of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + LAYER = 0, + /** + * The whole animation of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + WHOLE = 1, +} + +/** + * Declare fill style of symbol + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum EffectFillStyle { + /** + * The cumulative fill style of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + CUMULATIVE = 0, + + /** + * The iterative fill style of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + ITERATIVE = 1, +} + +/** + * Defines SymbolEffect class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class SymbolEffect { +} + +/** + * Defines ScaleSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class ScaleSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectScope } [scope] - The scope type of symbol effect. + * @param { EffectDirection } [direction] - The direction of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(scope?: EffectScope, direction?: EffectDirection); + + /** + * The scope type of symbol effect + * + * @type { ?EffectScope } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + scope?: EffectScope; + + /** + * The direction of symbol effect + * + * @type { ?EffectDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + direction?: EffectDirection; +} + +/** + * Defines HierarchicalSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class HierarchicalSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectFillStyle } [fillStyle] - The fill style of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(fillStyle?: EffectFillStyle); + + /** + * The fill style of symbol effect + * + * @type { ?EffectFillStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fillStyle?: EffectFillStyle; +} + +/** + * Defines AppearSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class AppearSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectScope } [scope] - The scope type of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(scope?: EffectScope); + + /** + * The scope type of symbol effect + * + * @type { ?EffectScope } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + scope?: EffectScope; +} + +/** + * Defines DisappearSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class DisappearSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectScope } [scope] - The scope type of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(scope?: EffectScope); + + /** + * The scope type of symbol effect + * + * @type { ?EffectScope } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + scope?: EffectScope; +} + +/** + * Defines BounceSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class BounceSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectScope } [scope] - The scope type of symbol effect. + * @param { EffectDirection } [direction] - The direction of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(scope?: EffectScope, direction?: EffectDirection); + + /** + * The scope type of symbol effect + * + * @type { ?EffectScope } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + scope?: EffectScope; + + /** + * The direction of symbol effect + * + * @type { ?EffectDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + direction?: EffectDirection; +} + +/** + * Defines ReplaceSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class ReplaceSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectScope } [scope] - The scope type of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(scope?: EffectScope); + + /** + * The scope type of symbol effect + * + * @type { ?EffectScope } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + scope?: EffectScope; +} + +/** + * Defines PulseSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class PulseSymbolEffect extends SymbolEffect { +} + +/** + * Provides attribute for SymbolGlyph. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Provides attribute for SymbolGlyph. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class SymbolGlyphAttribute extends CommonMethod { + /** + * Called when the SymbolGlyph size is set. + * + * @param { number | string | Resource } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the SymbolGlyph size is set. + * + * @param { number | string | Resource } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontSize(value: number | string | Resource): SymbolGlyphAttribute; + + /** + * Called when the SymbolGlyph color is set. + * + * @param { Array } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the SymbolGlyph color is set. + * + * @param { Array } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontColor(value: Array): SymbolGlyphAttribute; + + /** + * Called when the font symbolGlyph weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the font symbolGlyph weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontWeight(value: number | FontWeight | string): SymbolGlyphAttribute; + + /** + * Called when the symbolGlyph effect is set. + * + * @param { SymbolEffectStrategy } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the symbolGlyph effect is set. + * + * @param { SymbolEffectStrategy } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + effectStrategy(value: SymbolEffectStrategy): SymbolGlyphAttribute; + + /** + * Called when the symbolGlyph rendering strategy is set. + * + * @param { SymbolRenderingStrategy } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the symbolGlyph rendering strategy is set. + * + * @param { SymbolRenderingStrategy } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + renderingStrategy(value: SymbolRenderingStrategy): SymbolGlyphAttribute; + + /** + * Define effect options for SymbolGlyph. + * + * @param { SymbolEffect } [symbolEffect] - The symbol effect type + * @param { boolean } [isActive] - The active state of the effect + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + symbolEffect(symbolEffect: SymbolEffect, isActive?: boolean): SymbolGlyphAttribute; + + /** + * Define effect options for SymbolGlyph. + * + * @param { SymbolEffect } [symbolEffect] - The symbol effect type + * @param { number } [triggerValue] - The trigger of the effect + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + symbolEffect(symbolEffect: SymbolEffect, triggerValue?: number): SymbolGlyphAttribute; +} + +/** + * Defines SymbolGlyph Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines SymbolGlyph Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const SymbolGlyph: SymbolGlyphInterface; + +/** + * Defines SymbolGlyph Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines SymbolGlyph Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const SymbolGlyphInstance: SymbolGlyphAttribute; diff --git a/tests/arkts-sdk/ets/tab_content.d.ts b/tests/arkts-sdk/ets/tab_content.d.ts new file mode 100644 index 00000000..b60d0307 --- /dev/null +++ b/tests/arkts-sdk/ets/tab_content.d.ts @@ -0,0 +1,1289 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Enum for the mode of the tab bar when selected. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum for the mode of the tab bar when selected. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SelectedMode { + /** + * The value of indicator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of indicator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + INDICATOR, + + /** + * The value of board + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of board + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOARD +} + +/** + * Enum for the layout mode of the content in the tab bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum for the layout mode of the content in the tab bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum LayoutMode { + + /** + * The the content is laid vertically or horizontally, according to its width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The the content is laid vertically or horizontally, according to its width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + AUTO = 0, + /** + * The the content is laid vertically + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The the content is laid vertically + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + VERTICAL = 1, + + /** + * The the content is laid horizontally + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The the content is laid horizontally + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + HORIZONTAL = 2 +} + + +/** + * Provide an interface for the style of an indicator including color, height, width, border radius + * and margin top + * + * @interface IndicatorStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provide an interface for the style of an indicator including color, height, width, border radius + * and margin top + * + * @interface IndicatorStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface IndicatorStyle { + /** + * Define the color of the indicator + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the color of the indicator + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + + /** + * Define the height of the indicator + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the height of the indicator + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + height?: Length; + + /** + * Define the width of the indicator. + * If it is 0, the width will be equal to the width of the content + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the width of the indicator. + * If it is 0, the width will be equal to the width of the content + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + width?: Length; + + /** + * Define the border radius of the indicator + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the border radius of the indicator + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + borderRadius?: Length; + + /** + * Define the margin top of the indicator + * + * @type { ?Length } + * @default 8 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the margin top of the indicator + * + * @type { ?Length } + * @default 8 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + marginTop?: Length; +} + +/** + * Provide an interface for the style of an indicator including border radius + * + * @interface BoardStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provide an interface for the style of an indicator including border radius + * + * @interface BoardStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface BoardStyle { + /** + * Define the border radius of the board + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the border radius of the board + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + borderRadius?: Length; +} + +/** + * LabelStyle object. + * + * @interface LabelStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * LabelStyle object. + * + * @interface LabelStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface LabelStyle { + /** + * overflow mode. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * overflow mode. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + overflow?: TextOverflow; + + /** + * Label max lines. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Label max lines. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxLines?: number; + + /** + * Min font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Min font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + minFontSize?: number | ResourceStr; + + /** + * Max font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Max font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxFontSize?: number | ResourceStr; + + /** + * Adapt text height option. + * + * @type { ?TextHeightAdaptivePolicy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Adapt text height option. + * + * @type { ?TextHeightAdaptivePolicy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + heightAdaptivePolicy?: TextHeightAdaptivePolicy; + + /** + * Font style. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Font style. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font?: Font; + + /** + * The text color of the selected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedColor?: ResourceColor; + + /** + * The text color of the unselected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + unselectedColor?: ResourceColor; +} + +/** + * TabBarIconStyle object. + * + * @interface TabBarIconStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TabBarIconStyle { + /** + * The icon color of the selected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedColor?: ResourceColor; + + /** + * The icon color of the unselected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + unselectedColor?: ResourceColor; +} + +/** + * TabBarSymbol object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TabBarSymbol { + /** + * The properties of the symbol icon in the tab bar need to be unselected. + * + * @type { SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + normal: SymbolGlyphModifier; + + /** + * The properties of the symbol icon in the tab bar need to be selected. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selected?: SymbolGlyphModifier; +} + +/** + * Icon and text for TabBar. + * + * @typedef TabBarOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface TabBarOptions { + /** + * TabBar icon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * TabBar icon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * TabBar icon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + icon?: string | Resource; + + /** + * TabBar text. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * TabBar text. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * TabBar text. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + text?: string | Resource +} + +/** + * Define SubTabBarStyle, the style is text and underline. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Define SubTabBarStyle, the style is text and underline. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define SubTabBarStyle, the style is text and underline. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class SubTabBarStyle { + /** + * constructor. + * + * @param { ResourceStr } content - indicates the content of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * constructor. + * + * @param { ResourceStr } content - indicates the content of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @param { ResourceStr } content - indicates the content of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(content: ResourceStr); + /** + * constructor. + * + * @param { ResourceStr | ComponentContent } content - indicates the content of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(content: ResourceStr | ComponentContent); + + /** + * constructor + * + * @param { ResourceStr } content - indicates the content of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor + * + * @param { ResourceStr } content - indicates the content of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + static of(content: ResourceStr): SubTabBarStyle; + /** + * Create a content object of the sub tab bar + * + * @param { ResourceStr | ComponentContent } content - indicates the content of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + static of(content: ResourceStr | ComponentContent): SubTabBarStyle; + + /** + * Set the style of the indicator when selected + * + * @param { IndicatorStyle } value - indicates the indicator style of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the style of the indicator when selected + * + * @param { IndicatorStyle } value - indicates the indicator style of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + indicator(value: IndicatorStyle): SubTabBarStyle; + + /** + * Set the mode of the indicator when selected + * + * @param { SelectedMode } value - indicates the selected mode of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the mode of the indicator when selected + * + * @param { SelectedMode } value - indicates the selected mode of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedMode(value: SelectedMode): SubTabBarStyle; + + /** + * Set the style of the board when selected + * + * @param { BoardStyle } value - indicates the board style of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the style of the board when selected + * + * @param { BoardStyle } value - indicates the board style of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + board(value: BoardStyle): SubTabBarStyle; + + /** + * Set the label style of the indicator + * + * @param { LabelStyle } value - indicates the label style of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the label style of the indicator + * + * @param { LabelStyle } value - indicates the label style of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + labelStyle(value: LabelStyle): SubTabBarStyle; + + /** + * Set the padding of the sub tab bar + * + * @param { Padding | Dimension } value - indicates the padding of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the padding of the sub tab bar + * + * @param { Padding | Dimension } value - indicates the padding of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + padding(value: Padding | Dimension): SubTabBarStyle; + + /** + * Set the padding of the sub tab bar + * + * @param { LocalizedPadding } padding - indicates the padding of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + padding(padding: LocalizedPadding): SubTabBarStyle; + + /** + * Set an id to the sub tab bar to identify it + * + * @param { string } value - id of the sub tab bar to identify it + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set an id to the sub tab bar to identify it + * + * @param { string } value - id of the sub tab bar to identify it + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id(value: string): SubTabBarStyle; +} + +/** + * Define BottomTabBarStyle, the style is icon and text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Define BottomTabBarStyle, the style is icon and text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define BottomTabBarStyle, the style is icon and text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class BottomTabBarStyle { + /** + * constructor. + * + * @param { ResourceStr } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * constructor. + * + * @param { ResourceStr } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @param { ResourceStr } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * constructor. + * + * @param { ResourceStr | TabBarSymbol } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(icon: ResourceStr | TabBarSymbol, text: ResourceStr); + + /** + * of. + * + * @param { ResourceStr } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * of. + * + * @param { ResourceStr } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * of. + * + * @param { ResourceStr | TabBarSymbol } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + static of(icon: ResourceStr | TabBarSymbol, text: ResourceStr): BottomTabBarStyle; + + /** + * Set the label style of the indicator + * + * @param { LabelStyle } value - indicates the label style of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the label style of the indicator + * + * @param { LabelStyle } value - indicates the label style of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + labelStyle(value: LabelStyle): BottomTabBarStyle; + + /** + * Set the padding of the bottom tab bar + * + * @param { Padding | Dimension } value - indicates the padding of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the padding of the bottom tab bar + * + * @param { Padding | Dimension } value - indicates the padding of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Set the padding of the bottom tab bar + * + * @param { Padding | Dimension | LocalizedPadding } value - indicates the padding of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + padding(value: Padding | Dimension | LocalizedPadding): BottomTabBarStyle; + + /** + * Set the layout mode of the bottom tab bar + * + * @param { LayoutMode } value - indicates the layout mode of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the layout mode of the bottom tab bar + * + * @param { LayoutMode } value - indicates the layout mode of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + layoutMode(value: LayoutMode): BottomTabBarStyle; + + /** + * Set the vertical alignment style of the bottom tab bar + * + * @param { VerticalAlign } value - indicates the vertical alignment of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the vertical alignment style of the bottom tab bar + * + * @param { VerticalAlign } value - indicates the vertical alignment of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + verticalAlign(value: VerticalAlign): BottomTabBarStyle; + + /** + * Set the symmetric extensible of the bottom tab bar + * + * @param { boolean } value - indicates whether the bottom tab bar is extensible + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the symmetric extensible of the bottom tab bar + * + * @param { boolean } value - indicates whether the bottom tab bar is extensible + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + symmetricExtensible(value: boolean): BottomTabBarStyle; + + /** + * Set an id to the bottom tab bar to identify it + * + * @param { string } value - id of the bottom tab bar to identify it + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set an id to the bottom tab bar to identify it + * + * @param { string } value - id of the bottom tab bar to identify it + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id(value: string): BottomTabBarStyle; + + /** + * Set the icon style of the bottom tab bar + * + * @param { TabBarIconStyle } style - indicates the icon style of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + iconStyle(style: TabBarIconStyle): BottomTabBarStyle; +} + +/** + * Provides an interface for switching the content view on a tab page. + * + * @interface TabContentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for switching the content view on a tab page. + * + * @interface TabContentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for switching the content view on a tab page. + * + * @interface TabContentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface TabContentInterface { + /** + * Called when the content view of the switch tab is set. + * + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the content view of the switch tab is set. + * + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the content view of the switch tab is set. + * + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (): TabContentAttribute; +} + +/** + * Defines the attribute functions of TabContent. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the attribute functions of TabContent. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the attribute functions of TabContent. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TabContentAttribute extends CommonMethod { + /** + * Called when tabbar is entered. + * + * @param { string | Resource | { icon?: string | Resource; text?: string | Resource } } value + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when tabbar is entered. + * + * @param { string | Resource | CustomBuilder | { icon?: string | Resource; text?: string | Resource } } value + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when tabbar is entered. + * + * @param { string | Resource | CustomBuilder | { icon?: string | Resource; text?: string | Resource } } value + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when tabbar is entered. + * + * @param { string | Resource | CustomBuilder | { icon?: string | Resource; text?: string | Resource } } value + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when tabbar is entered. + * + * @param { string | Resource | CustomBuilder | TabBarOptions } options - TabBar options. + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + tabBar(options: string | Resource | CustomBuilder | TabBarOptions): TabContentAttribute; + + /** + * Called when tabbar is entered. + * + * @param { SubTabBarStyle | BottomTabBarStyle } value + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when tabbar is entered. + * + * @param { SubTabBarStyle | BottomTabBarStyle } value + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when tabbar is entered. + * + * @param { SubTabBarStyle | BottomTabBarStyle } value + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + tabBar(value: SubTabBarStyle | BottomTabBarStyle): TabContentAttribute; + + /** + * Called when the tab content will show. + * @param { VoidCallback } event + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillShow(event: VoidCallback): TabContentAttribute; + + /** + * Called when the tab content will hide. + * @param { VoidCallback } event + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillHide(event: VoidCallback): TabContentAttribute; +} + +/** + * Defines TabContent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TabContent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TabContent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TabContent: TabContentInterface; + +/** + * Defines TabContent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TabContent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TabContent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TabContentInstance: TabContentAttribute; diff --git a/tests/arkts-sdk/ets/tabs.d.ts b/tests/arkts-sdk/ets/tabs.d.ts new file mode 100644 index 00000000..149be96f --- /dev/null +++ b/tests/arkts-sdk/ets/tabs.d.ts @@ -0,0 +1,1871 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Declare the graphic format of the bar chart. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare the graphic format of the bar chart. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the graphic format of the bar chart. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum BarMode { + /** + * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Scrollable = 0, + + /** + * The width of all TabBars is evenly allocated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The width of all TabBars is evenly allocated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The width of all TabBars is evenly allocated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Fixed = 1, +} + +/** + * Declare the animation mode of tab content. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum AnimationMode { + /** + * Start animation after tabcontent is fully measured. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CONTENT_FIRST = 0, + + /** + * Start animation before tabcontent is fully measured. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ACTION_FIRST = 1, + + /** + * Disable default animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NO_ANIMATION = 2, +} + +/** + * Declare the location of the bar chart. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare the location of the bar chart. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the location of the bar chart. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + End, +} + +/** + * Declare the layout style of the tab bar items. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the layout style of the tab bar items. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum LayoutStyle { + /** + * The tab bar items are laid in the center of the tab bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The tab bar items are laid in the center of the tab bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ALWAYS_CENTER = 0, + /** + * The tab bar items are laid in the tab bar by an average split. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The tab bar items are laid in the tab bar by an average split. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ALWAYS_AVERAGE_SPLIT = 1, + /** + * The tab bar items are laid in the center of the bar when their total length is more than half of the tab bar. + * Otherwise, they are laid in the center half of the tab bar with the same space between them. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The tab bar items are laid in the center of the bar when their total length is more than half of the tab bar. + * Otherwise, they are laid in the center half of the tab bar with the same space between them. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SPACE_BETWEEN_OR_CENTER = 2 +} + +/** + * Provides methods for switching tabs. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides methods for switching tabs. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides methods for switching tabs. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TabsController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Called when the tab is switched. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the tab is switched. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the tab is switched. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + changeIndex(value: number): void; + + /** + * Called when need to preload specified tab content. + * + * @param { Optional> } indices - Indices of tab content to be preloaded. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter invalid. Possible causes: + *
1. The parameter type is not Array. + *
2. The parameter is an empty array. + *
3. The parameter contains an invalid index. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preloadItems(indices: Optional>): Promise; + + /** + * Set tab bar translate. + * + * @param { TranslateOptions } translate - translate options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + setTabBarTranslate(translate: TranslateOptions): void; + + /** + * Set tab bar opacity. + * + * @param { number } opacity - opacity + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + setTabBarOpacity(opacity: number): void; +} + +/** + * Options used to create Tabs. + * + * @typedef TabsOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface TabsOptions { + /** + * Set the tab location for Tabs. + * + * @type { ?BarPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the tab location for Tabs. + * + * @type { ?BarPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the tab location for Tabs. + * + * @type { ?BarPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barPosition?: BarPosition; + + /** + * Set the index of the currently displayed tab. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the index of the currently displayed tab. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the index of the currently displayed tab. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + index?: number; + + /** + * Set the Tabs controller. + * + * @type { ?TabsController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the Tabs controller. + * + * @type { ?TabsController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the Tabs controller. + * + * @type { ?TabsController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + controller?: TabsController +} + +/** + * Provides an interface for switching views. + * + * @interface TabsInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for switching views. + * + * @interface TabsInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for switching views. + * + * @interface TabsInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface TabsInterface { + /** + * Called when the view is switched. + * + * @param { object } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the view is switched. + * + * @param { object } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the view is switched. + * + * @param { object } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the view is switched. + * + * @param { TabsOptions } [options] - Tabs options. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + (options?: TabsOptions): TabsAttribute; +} + +/** + * Provides an interface for the style of an divider including stroke width, color, start margin + * and end margin + * + * @interface DividerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for the style of an divider including stroke width, color, start margin + * and end margin + * + * @interface DividerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface DividerStyle { + /** + * Define the stroke width of the divider + * + * @type { Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the stroke width of the divider + * + * @type { Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeWidth: Length; + + /** + * Define the color of the divider + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the color of the divider + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + + /** + * Define the start margin of the divider + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the start margin of the divider + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + startMargin?: Length; + + /** + * Define the end margin of the divider + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the end margin of the divider + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + endMargin?: Length; +} + +/** + * Provides an interface for tabs animation. + * + * @interface TabsAnimationEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Provides an interface for tabs animation. + * + * @interface TabsAnimationEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TabsAnimationEvent { + /** + * Offset of the current page to the start position of the tabs main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Offset of the current page to the start position of the tabs main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + currentOffset: number; + + /** + * Offset of the target page to the start position of the tabs main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Offset of the target page to the start position of the tabs main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + targetOffset: number; + + /** + * Start speed of the page-turning animation. The unit is vp/s. + * + * @type { number } + * @default 0.0 vp/s + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Start speed of the page-turning animation. The unit is vp/s. + * + * @type { number } + * @default 0.0 vp/s + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + velocity: number; +} + +/** + * Provides an interface for the grid column options of an tab bar including sm, md, lg, margin and gutter. + * + * @interface BarGridColumnOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for the grid column options of an tab bar including sm, md, lg, margin and gutter. + * + * @interface BarGridColumnOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface BarGridColumnOptions { + /** + * Define the occupied column number when the screen is of small size + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the occupied column number when the screen is of small size + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + sm?: number; + + /** + * Define the occupied column number when the screen is of middle size + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the occupied column number when the screen is of middle size + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + md?: number; + + /** + * Define the occupied column number when the screen is of large size + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the occupied column number when the screen is of large size + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + lg?: number; + + /** + * Define the margin size of the columns + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the margin size of the columns + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + margin?: Dimension; + + /** + * Define the gutter size of the columns + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the gutter size of the columns + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + gutter?: Dimension; +} + +/** + * Provides an interface for the options for the scrollable bar mode including margin and nonScrollableLayoutStyle. + * + * @interface ScrollableBarModeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for the options for the scrollable bar mode including margin and nonScrollableLayoutStyle. + * + * @interface ScrollableBarModeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface ScrollableBarModeOptions { + /** + * Define the margin size of the bar items when the tab bar is scrollable. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the margin size of the bar items when the tab bar is scrollable. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + margin?: Dimension; + + /** + * Define the layout style of the bar items when the tab bar is not scrollable. + * + * @type { ?LayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the layout style of the bar items when the tab bar is not scrollable. + * + * @type { ?LayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nonScrollableLayoutStyle?: LayoutStyle; +} + +/** + * Defines a tabs callback when onAnimationStart. + * + * @typedef { function } OnTabsAnimationStartCallback + * @param { number } index - The index value of the tab that when animation start. + * @param { number } targetIndex - The target index value of the tab that when animation start. + * @param { TabsAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnTabsAnimationStartCallback = (index: number, targetIndex: number, extraInfo: TabsAnimationEvent) => void; + +/** + * Defines a tabs callback when onAnimationEnd. + * + * @typedef { function } OnTabsAnimationEndCallback + * @param { number } index - The index value of the tab that when animation end. + * @param { TabsAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnTabsAnimationEndCallback = (index: number, extraInfo: TabsAnimationEvent) => void; + +/** + * Defines a tabs callback when onGestureSwipe. + * + * @typedef { function } OnTabsGestureSwipeCallback + * @param { number } index - The index value of the tab before gesture swipe. + * @param { TabsAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnTabsGestureSwipeCallback = (index: number, extraInfo: TabsAnimationEvent) => void; + +/** + * Defines a tabs callback when customContentTransition. + * + * @typedef { function } TabsCustomContentTransitionCallback + * @param { number } from - The index value of the current tab when the animation begins. + * @param { number } to - The index value of the target tab when the animation begins. + * @returns { TabContentAnimatedTransition | undefined } Returns animated transition options of tab or undefined. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type TabsCustomContentTransitionCallback = (from: number, to: number) => TabContentAnimatedTransition | undefined; + +/** + * Defines a tabs callback when onContentWillChange. + * + * @typedef { function } OnTabsContentWillChangeCallback + * @param { number } currentIndex - The index value of the current tab. + * @param { number } comingIndex - The index value of the tab that will change. + * @returns { boolean } + * Tabs can change from currentIndex to comingIndex if function return true. + * Tabs can not change from currentIndex to comingIndex if function return false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnTabsContentWillChangeCallback = (currentIndex: number, comingIndex: number) => boolean; + +/** + * Defines the tabs attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the tabs attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the tabs attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TabsAttribute extends CommonMethod { + /** + * Called when determining whether the tab is vertical. + * + * @param { boolean } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when determining whether the tab is vertical. + * + * @param { boolean } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when determining whether the tab is vertical. + * + * @param { boolean } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + vertical(value: boolean): TabsAttribute; + + /** + * Called when determining the location of the bar chart. + * + * @param { BarPosition } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when determining the location of the bar chart. + * + * @param { BarPosition } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when determining the location of the bar chart. + * + * @param { BarPosition } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barPosition(value: BarPosition): TabsAttribute; + + /** + * Called when judging whether page switching can be performed by sliding left and right. + * + * @param { boolean } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when judging whether page switching can be performed by sliding left and right. + * + * @param { boolean } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether page switching can be performed by sliding left and right. + * + * @param { boolean } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollable(value: boolean): TabsAttribute; + + /** + * Called when the graphic format of the bar chart is selected as fixed mode. + * + * @param { BarMode.Fixed } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the graphic format of the bar chart is selected as fixed mode. + * + * @param { BarMode.Fixed } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barMode(value: BarMode.Fixed): TabsAttribute; + + /** + * Called when the graphic format of the bar chart is selected as scrollable mode. + * + * @param { BarMode.Scrollable } value + * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the graphic format of the bar chart is selected as scrollable mode. + * + * @param { BarMode.Scrollable } value + * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barMode(value: BarMode.Scrollable, options: ScrollableBarModeOptions): TabsAttribute; + + /** + * Called when the graphic format of the bar chart is selected. + * + * @param { BarMode } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the graphic format of the bar chart is selected. + * + * @param { BarMode } value + * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the graphic format of the bar chart is selected. + * + * @param { BarMode } value + * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barMode(value: BarMode, options?: ScrollableBarModeOptions): TabsAttribute; + + /** + * Called when the width of the bar graph is set. + * Notice: barWidth only supports Number type. + * + * @param { number } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the width of the bar graph is set. + * Notice: barWidth only supports Number type on 7, supports Length type since 8. + * + * @param { Length } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the width of the bar graph is set. + * Notice: barWidth only supports Number type on 7, supports Length type since 8. + * + * @param { Length } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the width of the bar graph is set. + * Notice: barWidth only supports Number type on 7, supports Length type since 8. + * + * @param { Length } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barWidth(value: Length): TabsAttribute; + + /** + * Called when the height of the bar graph is set. + * Notice: barHeight only supports Number type. + * + * @param { number } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the height of the bar graph is set. + * Notice: barHeight only supports Number type on 7, supports Length type since 8. + * + * @param { Length } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the height of the bar graph is set. + * Notice: barHeight only supports Number type on 7, supports Length type since 8. + * + * @param { Length } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the height of the bar graph is set. + * Notice: barHeight only supports Number type on 7, supports Length type since 8. + * + * @param { Length } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barHeight(value: Length): TabsAttribute; + + /** + * Called when the animation duration of the bar graph is set. + * + * @param { number } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the animation duration of the bar graph is set. + * + * @param { number } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the animation duration of the bar graph is set. + * + * @param { number } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + animationDuration(value: number): TabsAttribute; + + /** + * Set animation mode. + * + * @param { Optional } mode - animation mode for tabs switch animation + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + animationMode(mode: Optional): TabsAttribute; + + /** + * Set the effect used when the component is at one of the edges. + * + * @param { Optional } edgeEffect - the effect used when the component is at one of the edges + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + edgeEffect(edgeEffect: Optional): TabsAttribute; + + /** + * Called when the tab is switched. + * + * @param { function } event + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the tab is switched. + * + * @param { function } event + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the tab is switched. + * + * @param { function } event + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the tab is switched. + * + * @param { Callback } event + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onChange(event: Callback): TabsAttribute; + + /** + * Called when the tab is clicked. + * + * @param { function } event + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the tab is clicked. + * + * @param { function } event + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the tab is clicked. + * + * @param { Callback } event + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onTabBarClick(event: Callback): TabsAttribute; + + /** + * Called when the tab content flip animation start. + * + * @param { function } handler - + * "index": the index value of the tab that when animation start. + * "targetIndex": the target index value of the tab that when animation start. + * "event": the animation event callback info. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the tab content flip animation start. + * + * @param { function } handler - + * "index": the index value of the tab that when animation start. + * "targetIndex": the target index value of the tab that when animation start. + * "event": the animation event callback info. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Called when the tab content flip animation start. + * + * @param { OnTabsAnimationStartCallback } handler + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onAnimationStart(handler: OnTabsAnimationStartCallback): TabsAttribute; + + /** + * Called when the tab content flip animation end. + * + * @param { function } handler - + * "index": the index value of the tab that when animation start. + * "event": the animation event callback info. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the tab content flip animation end. + * + * @param { function } handler - + * "index": the index value of the tab that when animation start. + * "event": the animation event callback info. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Called when the tab content flip animation end. + * + * @param { OnTabsAnimationEndCallback } handler + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onAnimationEnd(handler: OnTabsAnimationEndCallback): TabsAttribute; + + /** + * Called when swiping the tab content with the gesture. + * + * @param { function } handler - + * "index": the index value of the tab that when animation start. + * "event": the animation event callback info. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when swiping the tab content with the gesture. + * + * @param { function } handler - + * "index": the index value of the tab that when animation start. + * "event": the animation event callback info. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Called when swiping the tab content with the gesture. + * + * @param { OnTabsGestureSwipeCallback } handler + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onGestureSwipe(handler: OnTabsGestureSwipeCallback): TabsAttribute; + + /** + * Set whether the edges of tab bar are fading. + * + * @param { boolean } value - indicates whether the edges of tab bar are fading. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set whether the edges of tab bar are fading. + * + * @param { boolean } value - indicates whether the edges of tab bar are fading. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fadingEdge(value: boolean): TabsAttribute; + + /** + * Set the divider between tab bar and tab content. + * + * @param { DividerStyle | null } value - indicates the style of the indicator. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the divider between tab bar and tab content. + * + * @param { DividerStyle | null } value - indicates the style of the indicator. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + divider(value: DividerStyle | null): TabsAttribute; + + /** + * Set whether the tab bar overlaps with the tab content. + * + * @param { boolean } value - indicates whether the tab bar overlaps with the tab content. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set whether the tab bar overlaps with the tab content. + * + * @param { boolean } value - indicates whether the tab bar overlaps with the tab content. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barOverlap(value: boolean): TabsAttribute; + + /** + * Set the background color of the tab bar. + * + * @param { ResourceColor } value - indicates the background color of the tab bar. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set the background color of the tab bar. + * + * @param { ResourceColor } value - indicates the background color of the tab bar. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barBackgroundColor(value: ResourceColor): TabsAttribute; + + /** + * Set the grid alignment options of the tab bar. + * + * @param { BarGridColumnOptions } value - indicates the bar grid alignment options. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the grid alignment options of the tab bar. + * + * @param { BarGridColumnOptions } value - indicates the bar grid alignment options. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barGridAlign(value: BarGridColumnOptions): TabsAttribute; + + /** + * Custom tab content transition animation. + * When undefined is set, this interface does not take effect. + * + * @param { function } delegate - custom content transition animation. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Custom tab content transition animation. + * When undefined is set, this interface does not take effect. + * + * @param { function } delegate - custom content transition animation. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + /** + * Custom tab content transition animation. + * When undefined is set, this interface does not take effect. + * + * @param { TabsCustomContentTransitionCallback } delegate - Custom content transition animation. + * @returns { TabsAttribute } The attribute of the tabs. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + customContentTransition(delegate: TabsCustomContentTransitionCallback): TabsAttribute; + + /** + * Set the BlurStyle of the tab bar. + * + * @param { BlurStyle } value - indicates the BlurStyle of the tab bar. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + barBackgroundBlurStyle(value: BlurStyle): TabsAttribute; + + /** + * Set the BlurStyle of the tab bar. + * + * @param { BlurStyle } style - style indicate the blur style for the tab bar + * @param { BackgroundBlurStyleOptions } options - options indicate the options for the tab bar + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + barBackgroundBlurStyle(style: BlurStyle, options: BackgroundBlurStyleOptions): TabsAttribute; + + /** + * Set the BackgroundEffect of the tab bar. + * + * @param { BackgroundEffectOptions } options - options indicate the options for the tab bar + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + barBackgroundEffect(options: BackgroundEffectOptions): TabsAttribute; + + /** + * Called when content will change. + * + * @param { function } handler + * "currentIndex": the index value of the current tab. + * "comingIndex": the index value of the tab that will change. + * Tabs can change from currentIndex to comingIndex if function return true. + * Tabs can not change from currentIndex to comingIndex if function return false. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Called when content will change. + * + * @param { OnTabsContentWillChangeCallback } handler + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onContentWillChange(handler: OnTabsContentWillChangeCallback): TabsAttribute; +} + +/** + * Defines the Tab Content animated transition options. + * + * @interface TabContentAnimatedTransition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the Tab Content animated transition options. + * + * @interface TabContentAnimatedTransition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface TabContentAnimatedTransition { + /** + * Defines the timeout of custom content transition animation. The unit is ms. + * If TabContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. + * + * @type { ?number } + * @default 1000 ms + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the timeout of custom content transition animation. The unit is ms. + * If TabContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. + * + * @type { ?number } + * @default 1000 ms + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + timeout?: number; + + /** + * Called when custom content transition animation start. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Called when custom content transition animation start. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + /** + * Called when custom content transition animation start. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + transition: Callback; +} + +/** + * The proxy of TabContentAnimatedTransition. + * + * @interface TabContentTransitionProxy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * The proxy of TabContentAnimatedTransition. + * + * @interface TabContentTransitionProxy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface TabContentTransitionProxy { + /** + * The index of current tab content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * The index of current tab content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + from: number; + + /** + * The index of target tab content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * The index of target tab content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + to: number; + + /** + * Notifies Tabs component the custom content transition animation is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Notifies Tabs component the custom content transition animation is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + finishTransition(): void; +} + +/** + * Defines Tabs Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Tabs Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Tabs Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Tabs: TabsInterface; + +/** + * Defines Tabs Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Tabs Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Tabs Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TabsInstance: TabsAttribute; diff --git a/tests/arkts-sdk/ets/text.d.ts b/tests/arkts-sdk/ets/text.d.ts new file mode 100644 index 00000000..2e96750f --- /dev/null +++ b/tests/arkts-sdk/ets/text.d.ts @@ -0,0 +1,1548 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Text overflow options. + * + * @interface TextOverflowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface TextOverflowOptions { + /** + * Text overflow option. + * + * @type { TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text overflow option. + * + * @type { TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text overflow option. + * + * @type { TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text overflow option. + * + * @type { TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + overflow: TextOverflow; +} + +/** + * Provides an interface for writing texts. + * + * @interface TextInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for writing texts. + * + * @interface TextInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides an interface for writing texts. + * + * @interface TextInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for writing texts. + * + * @interface TextInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface TextInterface { + /** + * Called when writing text. + * + * @param { string | Resource } content + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when writing text. + * + * @param { string | Resource } content + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when writing text. + * + * @param { string | Resource } content + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when writing text. + * + * @param { string | Resource } content + * @param { TextOptions } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (content?: string | Resource, value?: TextOptions): TextAttribute; + } + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class TextAttribute extends CommonMethod { + /** + * Called when the font is set. + * + * @param { Font } value - the text font size and weight and family and style. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the font is set. + * + * @param { Font } value - the text font size and weight and family and style. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font(value: Font): TextAttribute; + + /** + * Called when the font is set. + * + * @param { Font } fontValue - the text font size and weight and family and style. + * @param { FontSettingOptions } options - font setting options. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + font(fontValue: Font, options?: FontSettingOptions): TextAttribute; + + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): TextAttribute; + + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontSize(value: number | string | Resource): TextAttribute; + + /** + * Called when the minimum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the minimum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the minimum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the minimum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + minFontSize(value: number | string | Resource): TextAttribute; + + /** + * Called when the maximum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the maximum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the maximum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the maximum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + maxFontSize(value: number | string | Resource): TextAttribute; + + /** + * Called when the minimum font scale of the font is set. + * + * @param { number | Resource } scale + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + minFontScale(scale: number | Resource): TextAttribute; + + /** + * Called when the maximum font scale of the font is set. + * + * @param { number | Resource } scale + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + maxFontScale(scale: number | Resource): TextAttribute; + + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): TextAttribute; + + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): TextAttribute; + + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } weight + * @param { FontSettingOptions } options - font setting options. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontWeight(weight: number | FontWeight | string, options?: FontSettingOptions): TextAttribute; + + /** + * Set font line spacing. + * + * @param { LengthMetrics } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineSpacing(value: LengthMetrics): TextAttribute; + + /** + * Called when the horizontal center mode of the font is set. + * + * @param { TextAlign } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the horizontal center mode of the font is set. + * + * @param { TextAlign } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the horizontal center mode of the font is set. + * + * @param { TextAlign } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the horizontal center mode of the font is set. + * + * @param { TextAlign } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + textAlign(value: TextAlign): TextAttribute; + + /** + * Called when the vertical center mode of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the vertical center mode of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the vertical center mode of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the vertical center mode of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lineHeight(value: number | string | Resource): TextAttribute; + + /** + * Called when the overflow mode of the font is set. + * + * @param { object } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the overflow mode of the font is set. + * + * @param { object } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the overflow mode of the font is set. + * + * @param { object } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the overflow mode of the font is set. + * + * @param { object } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the overflow mode of the font is set. + * + * @param { TextOverflowOptions } options - Text overflow options. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + textOverflow(options: TextOverflowOptions): TextAttribute; + + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontFamily(value: string | Resource): TextAttribute; + + /** + * Called when the maximum number of lines of text is set. + * + * @param { number } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the maximum number of lines of text is set. + * + * @param { number } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the maximum number of lines of text is set. + * + * @param { number } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the maximum number of lines of text is set. + * + * @param { number } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + maxLines(value: number): TextAttribute; + + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { DecorationStyleInterface } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + decoration(value: DecorationStyleInterface): TextAttribute; + + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + letterSpacing(value: number | string): TextAttribute; + + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + textCase(value: TextCase): TextAttribute; + + /** + * Called when the baseline offset is set. + * + * @param { number | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the baseline offset is set. + * + * @param { number | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the baseline offset is set. + * + * @param { number | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the baseline offset is set. + * + * @param { number | string } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + baselineOffset(value: number | string): TextAttribute; + + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + copyOption(value: CopyOptions): TextAttribute; + + /** + * Enable the selectable area can be dragged. + * + * @param { boolean } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Enable the selectable area can be dragged. + * + * @param { boolean } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + draggable(value: boolean): TextAttribute; + + /** + * Called when the text shadow is set. + * + * @param { ShadowOptions } value - The shadow options. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the text shadow is set. + * + * @param { ShadowOptions | Array } value - The shadow options. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + textShadow(value: ShadowOptions | Array): TextAttribute; + + /** + * Called when the height adaptive policy is set. + * + * @param { TextHeightAdaptivePolicy } value - The height adaptive policy. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the height adaptive policy is set. + * + * @param { TextHeightAdaptivePolicy } value - The height adaptive policy. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + heightAdaptivePolicy(value: TextHeightAdaptivePolicy): TextAttribute; + + /** + * Specify the indentation of the first line in a text-block. + * + * @param { Length } value - The length of text indent. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specify the indentation of the first line in a text-block. + * + * @param { Length } value - The length of text indent. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textIndent(value: Length): TextAttribute; + + /** + * Set the word break type. + * + * @param { WordBreak } value - The word break type. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + wordBreak(value: WordBreak): TextAttribute; + + /** + * Set the text line break strategy type. + * + * @param { LineBreakStrategy } strategy - The text line break strategy type. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineBreakStrategy(strategy: LineBreakStrategy): TextAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback - callback of the listened event. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onCopy(callback: (value: string) => void): TextAttribute; + + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selection(selectionStart: number, selectionEnd: number): TextAttribute; + + /** + * Set the caret color for the selected text. + * + * @param { ResourceColor } color - The color of the selected text caret. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + caretColor(color: ResourceColor): TextAttribute; + + /** + * Set the selected background color of the text. + * + * @param { ResourceColor } color - The color of the selected text background. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + selectedBackgroundColor(color: ResourceColor): TextAttribute; + + /** + * Set the ellipsis mode. + * + * @param { EllipsisMode } value - The ellipsis mode. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the ellipsis mode. + * + * @param { EllipsisMode } value - The ellipsis mode. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ellipsisMode(value: EllipsisMode): TextAttribute; + + /** + * Enable data detector. + * + * @param { boolean } enable - Enable data detector. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Enable data detector. + * + * @param { boolean } enable - Enable data detector. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableDataDetector(enable: boolean): TextAttribute; + + /** + * Data detector with config. + * + * @param { TextDataDetectorConfig } config - The config of text data detector. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Data detector with config. + * + * @param { TextDataDetectorConfig } config - The config of text data detector. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + dataDetectorConfig(config: TextDataDetectorConfig): TextAttribute; + + /** + * Bind to the selection menu. + * + * @param { TextSpanType } spanType - Indicates the type of selection menu. + * @param { CustomBuilder } content - Indicates the content of selection menu. + * @param { TextResponseType } responseType - Indicates response type of selection menu. + * @param { SelectionMenuOptions } [options] - Indicates the options of selection menu. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Bind to the selection menu. + * + * @param { TextSpanType } spanType - Indicates the type of selection menu. + * @param { CustomBuilder } content - Indicates the content of selection menu. + * @param { TextResponseType } responseType - Indicates response type of selection menu. + * @param { SelectionMenuOptions } [options] - Indicates the options of selection menu. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindSelectionMenu(spanType: TextSpanType, content: CustomBuilder, responseType: TextResponseType, + options?: SelectionMenuOptions): TextAttribute; + + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { TextAttribute } returns the instance of the TextAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { TextAttribute } returns the instance of the TextAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onTextSelectionChange(callback: (selectionStart: number, selectionEnd: number) => void): TextAttribute; + + /** + * Set font feature. + * + * @param { string } value - The fontFeature. + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * the values of reference to doc of text component + * number of can be single or multiple, and separated by comma ','. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontFeature(value: string): TextAttribute; + + /** + * Whether to support sensitive privacy information + * + * @param { boolean } supported - Whether to support sensitive privacy information. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 12 + */ + privacySensitive(supported: boolean): TextAttribute; + + /** + * set text selectable and focusable + * + * @param { TextSelectableMode } mode + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textSelectable(mode: TextSelectableMode): TextAttribute; + + /** + * Set the custom text menu. + * + * @param { EditMenuOptions } editMenu - Customize text menu options. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + editMenuOptions(editMenu: EditMenuOptions): TextAttribute; + + /** + * Set the text with half leading. + * + * @param { boolean } halfLeading + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + halfLeading(halfLeading: boolean): TextAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { TextAttribute } returns the instance of the TextAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): TextAttribute; +} + +/** + * Defines Text Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Text Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Text Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Text Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const TextInstance: TextAttribute; + +/** + * Defines Text Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Text Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Text Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Text Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Text: TextInterface; + +/** + * Defines span type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines span type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum TextSpanType { + /** + * Only contains text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Only contains text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TEXT = 0, + + /** + * Only contains image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Only contains image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IMAGE = 1, + + /** + * Contains both text and image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Contains both text and image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + MIXED = 2, +} + +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum TextResponseType { + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + RIGHT_CLICK = 0, + + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LONG_PRESS = 1, + + /** + * Selected by mouse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Selected by mouse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SELECT = 2, +} + +/** + * Defines the options of Text. + * + * @interface TextOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the options of Text. + * + * @interface TextOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextOptions { + /** + * Text controller. + * + * @type { TextController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Text controller. + * + * @type { TextController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + controller: TextController; +} + +/** + * Defines the controller of Text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the controller of Text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TextController { + /** + * Close the select menu when menu is on. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Close the select menu when menu is on. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + closeSelectionMenu(): void; + + /** + * Update the styles of StyledString by setStyledString. + * + * @param { StyledString } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setStyledString(value: StyledString): void; + + /** + * Get LayoutManager. + * + * @returns { LayoutManager } - Return the LayoutManager. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getLayoutManager(): LayoutManager; +} diff --git a/tests/arkts-sdk/ets/text_area.d.ts b/tests/arkts-sdk/ets/text_area.d.ts new file mode 100644 index 00000000..eb79c8c6 --- /dev/null +++ b/tests/arkts-sdk/ets/text_area.d.ts @@ -0,0 +1,1733 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @since 8 + */ +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TextAreaController extends TextContentControllerBase { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretPosition(value: number): void; + + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @param { SelectionOptions } [options] - Indicates the options of the text selection. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setTextSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; + + /** + * Exit edit state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Exit edit state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stopEditing(): void; +} + +/** + * Defines the options of TextArea. + * + * @interface TextAreaOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of TextArea. + * + * @interface TextAreaOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of TextArea. + * + * @interface TextAreaOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TextAreaOptions { + /** + * The place holder text string. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The place holder text string. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The place holder text string. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholder?: ResourceStr; + + /** + * Sets the current value of TextArea. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the current value of TextArea. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the current value of TextArea. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + text?: ResourceStr; + + /** + * Called when the position of the insertion cursor is set. + * + * @type { ?TextAreaController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @type { ?TextAreaController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @type { ?TextAreaController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + controller?: TextAreaController; +} + +/** + * Provides an interface for the multi-line text input component. + * + * @interface TextAreaInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for the multi-line text input component. + * + * @interface TextAreaInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for the multi-line text input component. + * + * @interface TextAreaInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface TextAreaInterface { + /** + * Called when writing multiple lines of text. + * + * @param { TextAreaOptions } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when writing multiple lines of text. + * + * @param { TextAreaOptions } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when writing multiple lines of text. + * + * @param { TextAreaOptions } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: TextAreaOptions): TextAreaAttribute; +} + +/** + * Declare the type of input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Declare the type of input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum TextAreaType { + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NORMAL = 0, + + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NUMBER = 2, + + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PHONE_NUMBER = 3, + + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + EMAIL = 5, + + /** + * Number decimal entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NUMBER_DECIMAL = 12, + + /** + * URL entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + URL = 13, +} + +/** + * Declare the content type of input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum ContentType { + /** + * User name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + USER_NAME = 0, + + /** + * Password content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PASSWORD = 1, + + /** + * New password content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + NEW_PASSWORD = 2, + + /** + * Full street address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + FULL_STREET_ADDRESS = 3, + + /** + * House number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + HOUSE_NUMBER = 4, + + /** + * District address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + DISTRICT_ADDRESS = 5, + + /** + * City address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + CITY_ADDRESS = 6, + + /** + * Province address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PROVINCE_ADDRESS = 7, + + /** + * Country address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + COUNTRY_ADDRESS = 8, + + /** + * Person full name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PERSON_FULL_NAME = 9, + + /** + * Person last name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PERSON_LAST_NAME = 10, + + /** + * Person first name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PERSON_FIRST_NAME = 11, + + /** + * Phone number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PHONE_NUMBER = 12, + + /** + * Phone country code content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PHONE_COUNTRY_CODE = 13, + + /** + * Full phone number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + FULL_PHONE_NUMBER = 14, + + /** + * Email address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + EMAIL_ADDRESS = 15, + + /** + * Bank card number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + BANK_CARD_NUMBER = 16, + + /** + * ID card number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ID_CARD_NUMBER = 17, + + /** + * Nickname content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + NICKNAME = 23, + + /** + * Detail info without street content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + DETAIL_INFO_WITHOUT_STREET = 24, + + /** + * Format address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + FORMAT_ADDRESS = 25 +} + +/** + * Declare the event listener callback of the enter key. + * + * @typedef { function } TextAreaSubmitCallback + * @param { EnterKeyType } enterKeyType - The enter key type of soft keyboard. + * @param { SubmitEvent } [event] - Provides the method of keeping textArea editable state when submitted. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type TextAreaSubmitCallback = (enterKeyType: EnterKeyType, event?: SubmitEvent) => void; + +/** + * Defines the attribute functions of TextArea. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the attribute functions of TextArea. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the attribute functions of TextArea. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TextAreaAttribute extends CommonMethod { + /** + * Called when the color of the placeholder is set. + * + * @param { ResourceColor } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the color of the placeholder is set. + * + * @param { ResourceColor } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the color of the placeholder is set. + * + * @param { ResourceColor } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholderColor(value: ResourceColor): TextAreaAttribute; + + /** + * Called when the font property of the placeholder is set. + * + * @param { Font } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font property of the placeholder is set. + * + * @param { Font } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font property of the placeholder is set. + * + * @param { Font } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholderFont(value: Font): TextAreaAttribute; + + /** + * Called when the type of soft keyboard input button is set. + * + * @param { EnterKeyType } value the type of soft keyboard + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the type of soft keyboard input button is set. + * + * @param { EnterKeyType } value the type of soft keyboard + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enterKeyType(value: EnterKeyType): TextAreaAttribute; + + /** + * Called when the alignment of the contents of a multiline text box is set. + * + * @param { TextAlign } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the alignment of the contents of a multiline text box is set. + * + * @param { TextAlign } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the alignment of the contents of a multiline text box is set. + * + * @param { TextAlign } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textAlign(value: TextAlign): TextAreaAttribute; + + /** + * Called when the insertion cursor color is set. + * + * @param { ResourceColor } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the insertion cursor color is set. + * + * @param { ResourceColor } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the insertion cursor color is set. + * + * @param { ResourceColor } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretColor(value: ResourceColor): TextAreaAttribute; + + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): TextAreaAttribute; + + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontSize(value: Length): TextAreaAttribute; + + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): TextAreaAttribute; + + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): TextAreaAttribute; + + /** + * Called when the font list of text is set. + * + * @param { ResourceStr } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font list of text is set. + * + * @param { ResourceStr } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font list of text is set. + * + * @param { ResourceStr } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontFamily(value: ResourceStr): TextAreaAttribute; + + /** + * Called when the overflow mode of the font is set. + * + * @param { TextOverflow } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textOverflow(value: TextOverflow): TextAreaAttribute; + + /** + * Specify the indentation of the first line in a text-block. + * + * @param { Dimension } value - The length of text indent. + * @returns { TextAreaAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textIndent(value: Dimension): TextAreaAttribute; + + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { function } error + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { function } error + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { function } error + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + inputFilter(value: ResourceStr, error?: (value: string) => void): TextAreaAttribute; + + /** + * Define the caret style of the text input + * + * @param { CaretStyle } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + caretStyle(value: CaretStyle): TextAreaAttribute; + + /** + * Define the text selected background color of the text input. + * + * @param { ResourceColor } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedBackgroundColor(value: ResourceColor): TextAreaAttribute; + + /** + * Called when submitted. + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when submitted. + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onSubmit(callback: (enterKey: EnterKeyType) => void): TextAreaAttribute; + /** + * Called when submitted. + * + * @param { TextAreaSubmitCallback } callback - callback of the listened event. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSubmit(callback: TextAreaSubmitCallback): TextAreaAttribute; + + /** + * Called when the input changes. + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the input changes. + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the input changes. + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the input changes. + * + * @param { EditableTextOnChangeCallback } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onChange(callback: EditableTextOnChangeCallback): TextAreaAttribute; + + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onTextSelectionChange(callback: (selectionStart: number, selectionEnd: number) => void): TextAreaAttribute; + + /** + * Called when the content scrolls. + * + * @param { function } callback - callback of the listened event. + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the content scrolls. + * + * @param { function } callback - callback of the listened event. + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onContentScroll(callback: (totalOffsetX: number, totalOffsetY: number) => void): TextAreaAttribute; + + /** + * Called when judging whether the text editing change finished. + * + * @param { function } callback - Triggered when the text area status changes. + * If the value of isEditing is true, text area is in progress. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether the text editing change finished. + * + * @param { function } callback - Triggered when the text area status changes. + * If the value of isEditing is true, text area is in progress. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onEditChange(callback: (isEditing: boolean) => void): TextAreaAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onCopy(callback: (value: string) => void): TextAreaAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onCut(callback: (value: string) => void): TextAreaAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * Executed when a paste operation is performed. + * { string } value - The text content to be pasted. + * { PasteEvent } event - The user-defined paste event. + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onPaste(callback: (value: string, event: PasteEvent) => void): TextAreaAttribute; + + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + copyOption(value: CopyOptions): TextAreaAttribute; + + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } value + * @returns { TextAreaAttribute } Returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } value + * @returns { TextAreaAttribute } Returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableKeyboardOnFocus(value: boolean): TextAreaAttribute; + + /** + * Define the max length content of the text area. + * + * @param { number } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the max length content of the text area. + * + * @param { number } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxLength(value: number): TextAreaAttribute; + + /** + * Define show counter of the text area. + * + * @param { boolean } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define show counter of the text area. + * + * @param { boolean } value - Set showcounter of the text area. + * @param { InputCounterOptions } options - Set the percentage of counter. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showCounter(value: boolean, options?: InputCounterOptions): TextAreaAttribute; + + /** + * Define style of the text area. + * + * @param { TextContentStyle } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define style of the text area. + * + * @param { TextContentStyle } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style(value: TextContentStyle): TextAreaAttribute; + + /** + * Define bar state of the text area. + * + * @param { BarState } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define bar state of the text area. + * + * @param { BarState } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + barState(value: BarState): TextAreaAttribute; + + /** + * Controls whether the selection menu pops up. + * + * @param { boolean } value + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Controls whether the selection menu pops up. + * + * @param { boolean } value + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectionMenuHidden(value: boolean): TextAreaAttribute; + + /** + * Called when the minimum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + minFontSize(value: number | string | Resource): TextAreaAttribute; + + /** + * Called when the maximum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maxFontSize(value: number | string | Resource): TextAreaAttribute; + + /** + * Called when the height adaptive policy is set. + * + * @param { TextHeightAdaptivePolicy } value - The height adaptive policy. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + heightAdaptivePolicy(value: TextHeightAdaptivePolicy): TextAreaAttribute; + + /** + * Define max lines of the text area. + * + * @param { number } value + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define max lines of the text area. + * + * @param { number } value + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxLines(value: number): TextAreaAttribute; + + /** + * Set the word break type. + * + * @param { WordBreak } value - The word break type. + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + wordBreak(value: WordBreak): TextAreaAttribute; + + /** + * Set the text line break strategy type. + * + * @param { LineBreakStrategy } strategy - The text line break strategy type. + * @returns { TextAreaAttribute } The attribute of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineBreakStrategy(strategy: LineBreakStrategy): TextAreaAttribute; + + /** + * Define custom keyboard of the text area. + * + * @param { CustomBuilder } value + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define custom keyboard of the text area. + * + * @param { CustomBuilder } value + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Define custom keyboard of the text area. + * + * @param { CustomBuilder } value - Set up a custom keyboard of TextArea + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of TextArea + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customKeyboard(value: CustomBuilder, options?: KeyboardOptions): TextAreaAttribute; + + /** + * Called when the text decoration of the text is set. + * + * @param { TextDecorationOptions } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + decoration(value: TextDecorationOptions): TextAreaAttribute; + + /** + * Called when the distance between text fonts is set. + * + * @param { number | string | Resource } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + letterSpacing(value: number | string | Resource): TextAreaAttribute; + + /** + * Set font line spacing. + * + * @param { LengthMetrics } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineSpacing(value: LengthMetrics): TextAreaAttribute; + + /** + * Called when the line height of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineHeight(value: number | string | Resource): TextAreaAttribute; + + /** + * Called when the input type is set. + * + * @param { TextAreaType } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the input type is set. + * + * @param { TextAreaType } value + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type(value: TextAreaType): TextAreaAttribute; + + /** + * Sets whether enable auto fill or not. + * + * @param { boolean } value - Indicates the flag whether autofill is enabled. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableAutoFill(value: boolean): TextAreaAttribute; + + /** + * Called when the auto fill type is set. + * + * @param { ContentType } contentType - Indicates autofill type. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + contentType(contentType: ContentType): TextAreaAttribute; + + /** + * Set font feature. + * + * @param { string } value - The fontFeature. + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * the values of reference to doc of TextArea component + * number of can be single or multiple, and separated by comma ','. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFeature(value: string): TextAreaAttribute; + + /** + * Get text value information when about to input. + * + * @param { Callback } callback - The triggered function when text content is about to insert. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillInsert(callback: Callback): TextAreaAttribute; + + /** + * Get text value information when completed input. + * + * @param { Callback } callback - The triggered function when text content has been inserted. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidInsert(callback: Callback): TextAreaAttribute; + + /** + * Get text value information when about to delete. + * + * @param { Callback } callback - The triggered function when text content is about to delete. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDelete(callback: Callback): TextAreaAttribute; + + /** + * Get text value information when the deletion has been completed + * + * @param { Callback } callback - The triggered function when text content has been deleted. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidDelete(callback: Callback): TextAreaAttribute; + + /** + * Set the custom text menu. + * + * @param { EditMenuOptions } editMenu - Customize text menu options. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + editMenuOptions(editMenu: EditMenuOptions): TextAreaAttribute; + + /** + * Define the preview text mode of the text input. + * + * @param { boolean } enable - Indicates the preview text mode. + * @returns { TextAreaAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enablePreviewText(enable: boolean): TextAreaAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): TextAreaAttribute; +} + +/** + * Defines TextArea Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TextArea Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextArea Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TextArea: TextAreaInterface; + +/** + * Defines TextArea Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TextArea Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextArea Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TextAreaInstance: TextAreaAttribute; diff --git a/tests/arkts-sdk/ets/text_clock.d.ts b/tests/arkts-sdk/ets/text_clock.d.ts new file mode 100644 index 00000000..284a6bbe --- /dev/null +++ b/tests/arkts-sdk/ets/text_clock.d.ts @@ -0,0 +1,697 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides a way to control the textclock status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides a way to control the textclock status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides a way to control the textclock status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class TextClockController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(); + /** + * Provides a start event for textclock. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Provides a start event for textclock. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provides a start event for textclock. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + start(); + /** + * Provides a stop event for textclock. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Provides a stop event for textclock. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provides a stop event for textclock. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stop(); +} + +/** + * TextClockConfiguration used by text clock content modifier + * + * @interface TextClockConfiguration + * @extends CommonConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextClockConfiguration extends CommonConfiguration { + /** + * Specifies the current time zone. + * The valid value is an integer ranging from - 14 to 12, + * Where a negative value indicates the eastern time zone, for example, -8. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + timeZoneOffset: number; + + /** + * TextClock is started or not. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + started: boolean; + + /** + * The time of the TextClock. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + timeValue: number; +} + +/** + * Options to construct TextClock component. + * + * @interface TextClockOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface TextClockOptions { + /** + * Time zone offset. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Time zone offset. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Time zone offset. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + timeZoneOffset?: number; + + /** + * TextClock controller. + * + * @type { ?TextClockController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * TextClock controller. + * + * @type { ?TextClockController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * TextClock controller. + * + * @type { ?TextClockController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + controller?: TextClockController +} + +/** + * TextClock component, which provides the text clock capability. + * + * @interface TextClockInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * TextClock component, which provides the text clock capability. + * + * @interface TextClockInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * TextClock component, which provides the text clock capability. + * + * @interface TextClockInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface TextClockInterface { + /** + * Construct the text clock component. + * Specifies the current time zone. + * The valid value is an integer ranging from - 14 to 12, + * Where a negative value indicates the eastern time zone, for example, -8. + * + * @param { object } options + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Construct the text clock component. + * Specifies the current time zone. + * The valid value is an integer ranging from - 14 to 12, + * Where a negative value indicates the eastern time zone, for example, -8. + * + * @param { object } options + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Construct the text clock component. + * Specifies the current time zone. + * The valid value is an integer ranging from - 14 to 12, + * Where a negative value indicates the eastern time zone, for example, -8. + * + * @param { object } options + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Construct the text clock component. + * Specifies the current time zone. + * The valid value is an integer ranging from - 14 to 12, + * Where a negative value indicates the eastern time zone, for example, -8. + * + * @param { TextClockOptions } [options] - TextClock options. + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options?: TextClockOptions): TextClockAttribute; +} + +/** + * Provides attribute for TextClock. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides attribute for TextClock. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides attribute for TextClock. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class TextClockAttribute extends CommonMethod { + /** + * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd". + * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English), + * dd,ddd(English Week abbreviation),dddd(Full name of the week in English), + * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second). + * + * @param { string } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd". + * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English), + * dd,ddd(English Week abbreviation),dddd(Full name of the week in English), + * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second). + * + * @param { string } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd". + * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English), + * dd,ddd(English Week abbreviation),dddd(Full name of the week in English), + * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second). + * The default value is "hh:mm:ss" when TextClock is not in a form. + * The default value is "hh:mm" when TextClock is in a form. + * If the value has second or millisecond, the value will be set to the default value. + * + * @param { string } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + format(value: string): TextClockAttribute; + + /** + * Provides a date change callback. + * The callback parameter is Unix Time Stamp, + * The number of milliseconds that have elapsed since January 1, 1970 (UTC). + * The minimum callback interval for this event is seconds. + * You can listen to this callback, + * Use the format attribute method to customize data display in the callback. + * + * @param { function } event - Listening date event callback. + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Provides a date change callback. + * The callback parameter is Unix Time Stamp, + * The number of milliseconds that have elapsed since January 1, 1970 (UTC). + * The minimum callback interval for this event is seconds. + * You can listen to this callback, + * Use the format attribute method to customize data display in the callback. + * + * @param { function } event - Listening date event callback. + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provides a date change callback. + * The callback parameter is Unix Time Stamp, + * The number of milliseconds that have elapsed since January 1, 1970 (UTC). + * The minimum callback interval for this event default is seconds when TextClock is not in a form. + * The minimum callback interval for this event is minutes when TextClock is in a form. + * If visibility is Hidden the callback be disabled when TextClock is in a form. + * You can listen to this callback, + * Use the format attribute method to customize data display in the callback. + * + * @param { function } event - Listening date event callback. + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onDateChange(event: (value: number) => void): TextClockAttribute; + + /** + * Called when the value of TextClock fontColor is set + * + * @param { ResourceColor } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the value of TextClock fontColor is set + * + * @param { ResourceColor } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the value of TextClock fontColor is set + * + * @param { ResourceColor } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): TextClockAttribute; + + /** + * Called when the value of TextClock fontSize is set + * + * @param { Length } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the value of TextClock fontSize is set + * + * @param { Length } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the value of TextClock fontSize is set + * + * @param { Length } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontSize(value: Length): TextClockAttribute; + + /** + * Called when the value of TextClock fontStyle is set + * + * @param { FontStyle } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the value of TextClock fontStyle is set + * + * @param { FontStyle } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the value of TextClock fontStyle is set + * + * @param { FontStyle } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): TextClockAttribute; + + /** + * Called when the value of TextClock fontWeight is set + * + * @param { number | FontWeight | string } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the value of TextClock fontWeight is set + * + * @param { number | FontWeight | string } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the value of TextClock fontWeight is set + * + * @param { number | FontWeight | string } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): TextClockAttribute; + + /** + * Called when the value of TextClock fontFamily is set + * + * @param { ResourceStr } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the value of TextClock fontFamily is set + * + * @param { ResourceStr } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the value of TextClock fontFamily is set + * + * @param { ResourceStr } value + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontFamily(value: ResourceStr): TextClockAttribute; + + /** + * Called when the text shadow is set. + * + * @param { ShadowOptions | Array } value - The shadow options. + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Called when the text shadow is set. + * + * @param { ShadowOptions | Array } value - The shadow options. + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + textShadow(value: ShadowOptions | Array): TextClockAttribute; + + /** + * Called when the text fontFeature is set. + * + * @param { string } value - The fontFeature. + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * number of can be single or multiple, and separated by comma ','. + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Called when the text fontFeature is set. + * + * @param { string } value - The fontFeature. + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * number of can be single or multiple, and separated by comma ','. + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontFeature(value: string): TextClockAttribute; + + /** + * Set the content modifier of textclock. + * + * @param { ContentModifier } modifier - The content modifier of textclock. + * @returns { TextClockAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): TextClockAttribute; + + /** + * Set hour format + * + * @param { Optional } dateTimeOptions - Indicates whether a leading 0 is required for the hour. + * @returns { TextClockAttribute } the attribute of the text clock + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + dateTimeOptions(dateTimeOptions: Optional): TextClockAttribute; +} + +/** + * Defines TextClock Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines TextClock Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextClock Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const TextClock: TextClockInterface; + +/** + * Defines TextClock Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines TextClock Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextClock Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const TextClockInstance: TextClockAttribute; diff --git a/tests/arkts-sdk/ets/text_common.d.ts b/tests/arkts-sdk/ets/text_common.d.ts new file mode 100644 index 00000000..7dd353ed --- /dev/null +++ b/tests/arkts-sdk/ets/text_common.d.ts @@ -0,0 +1,1098 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the text data detector type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Defines the text data detector type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum TextDataDetectorType { + /** + * Detector type phone number. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Detector type phone number. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PHONE_NUMBER = 0, + + /** + * Detector type URL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Detector type URL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + URL = 1, + + /** + * Detector type email. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Detector type email. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + EMAIL = 2, + + /** + * Detector type address. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Detector type address. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ADDRESS = 3, + + /** + * Detector type datetime. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + DATE_TIME = 4, +} + +/** + * Text data detector config. + * + * @interface TextDataDetectorConfig + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Text data detector config. + * + * @interface TextDataDetectorConfig + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface TextDataDetectorConfig { + /** + * Text data detector types. + * + * @type { TextDataDetectorType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Text data detector types. + * + * @type { TextDataDetectorType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + types: TextDataDetectorType[] + + /** + * Text data detect result callback. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Text data detect result callback. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + onDetectResultUpdate?: (result: string) => void + + /** + * The color of AI entity. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + color?: ResourceColor, + + /** + * The decoration of AI entity. + * + * @type { ?DecorationStyleInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + decoration?: DecorationStyleInterface +} + +/** + * Defines range of text type component. + * + * @interface TextRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextRange { + /** + * Start offset. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start?: number; + + /** + * End offset. + * + * @type { ?number } + * @default text length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + end?: number; +} + +/** + * Defines the inserted text value info. + * + * @interface InsertValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface InsertValue { + /** + * The location info where the value will be inserted. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + insertOffset: number; + + /** + * The inserted value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + insertValue: string; +} + +/** + * Defines delete text direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum TextDeleteDirection { + /** + * Delete backward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BACKWARD = 0, + + /** + * Delete forward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FORWARD = 1, +} + +/** + * Defines menu type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare enum MenuType { + /** + * Selection menu. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + SELECTION_MENU = 0, + + /** + * Preview menu, only for image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + PREVIEW_MENU = 1, +} + +/** + * Provides an interface for deleting value from text. + * + * @interface DeleteValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DeleteValue { + /** + * The location info where the value will be deleted. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + deleteOffset: number; + + /** + * The deleted direction. + * + * @type { TextDeleteDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + direction: TextDeleteDirection; + + /** + * The deleted value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + deleteValue: string; +} + +/** + * Callback after content changed. + * + * @typedef { function } OnDidChangeCallback + * @param { TextRange } rangeBefore - Range of content that had been replaced. + * @param { TextRange } rangeAfter - Range of content that newly added. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type OnDidChangeCallback = (rangeBefore: TextRange, rangeAfter: TextRange) => void; + +/** + * Callback when input sometimes has info of previewText. + * + * @typedef { function } EditableTextOnChangeCallback + * @param { string } value - Value of body text, without previewText value. + * @param { PreviewText } [previewText] - info of previewText, contains previewText value and start index. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type EditableTextOnChangeCallback = (value: string, previewText?: PreviewText) => void; + +/** + * Define the text selection controller. + * + * @interface TextBaseController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextBaseController { + /** + * Set selection to select a range of content. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @param { SelectionOptions } [options] - Indicates the options of selection. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; + + /** + * Close the select menu when menu is on. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + closeSelectionMenu(): void; + + /** + * Get LayoutManager. + * + * @returns { LayoutManager } - Return the LayoutManager. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getLayoutManager(): LayoutManager; +} + +/** + * Define the text extended editing controller. + * + * @interface TextEditControllerEx + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextEditControllerEx { + /** + * Judge whether is in editing state + * + * @returns { boolean } - true means that the component is in editing state, false means is non in editing status + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isEditing(): boolean; + + /** + * Stop editing state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + stopEditing(): void; + + /** + * Set caret offset. + * + * @param { number } offset - caret offset. + * @returns { boolean } - Return true if the caret offset was successfully set, false otherwise. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setCaretOffset(offset: number): boolean; + + /** + * Get caret offset from controller. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getCaretOffset(): number; + + /** + * Get PreviewText. + * + * @returns { PreviewText } - Return the PreviewText. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getPreviewText?(): PreviewText; +} + +/** + * Define the StyledString controller. + * + * @interface StyledStringController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface StyledStringController { + /** + * Set the StyledString of the component. + * + * @param { StyledString } styledString - StyledString. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setStyledString(styledString: StyledString): void; + + /** + * Get the StyledString of the component. + * + * @returns { MutableStyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getStyledString(): MutableStyledString; +} + +/** + * Define the StyledString changed listener. + * + * @interface StyledStringChangedListener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface StyledStringChangedListener { + /** + * Called before text changed. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillChange?: Callback; + + /** + * Called after text changed. + * + * @type { ?OnDidChangeCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidChange?: OnDidChangeCallback; +} + +/** + * Define the StyledString changed value. + * + * @interface StyledStringChangeValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface StyledStringChangeValue { + /** + * Range of the content to be replaced. + * + * @type { TextRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + range: TextRange; + + /** + * StyledString to replace. + * + * @type { StyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacementString: StyledString; + + /** + * Preview StyledString + * + * @type { ?StyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + previewText?: StyledString; +} + +/** + * Define the LayoutManager for querying layout information. + * + * @interface LayoutManager + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LayoutManager { + /** + * Get the line count. + * + * @returns { number } The line count value returned to the caller. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getLineCount(): number; + + /** + * Get the glyph position at coordinate. + * + * @param { number } x - the positionX of typography. + * @param { number } y - the positionY of typography. + * @returns { PositionWithAffinity } TextBlob object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getGlyphPositionAtCoordinate(x: number, y: number): PositionWithAffinity; + + /** + * Get LineMetrics. + * + * @param { number } lineNumber - the number of line. + * @returns { LineMetrics } The line Metrics. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getLineMetrics(lineNumber: number): LineMetrics; + + /** + * Get the rects for range. + * @param { TextRange } range - The range to set. + * @param { RectWidthStyle } widthStyle - Width style to set. + * @param { RectHeightStyle } heightStyle - Height style to set. + * @returns { Array } The rects for range. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + getRectsForRange(range: TextRange, widthStyle: RectWidthStyle, heightStyle: RectHeightStyle): Array; +} + +/** + * Position and affinity. + * + * @typedef PositionWithAffinity + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PositionWithAffinity { + /** + * Position of text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + position: number; + + /** + * Affinity of text. + * + * @type { Affinity } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + affinity: Affinity; +} + +/** + * Define the Affinity type. + * + * @typedef { import('../api/@ohos.graphics.text').default.Affinity } Affinity + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type Affinity = import('../api/@ohos.graphics.text').default.Affinity; + +/** + * Define the LineMetrics type. + * + * @typedef { import('../api/@ohos.graphics.text').default.LineMetrics } LineMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type LineMetrics = import('../api/@ohos.graphics.text').default.LineMetrics; + +/** + * Define the RectWidthStyle type. + * + * @typedef { import('../api/@ohos.graphics.text').default.RectWidthStyle } RectWidthStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type RectWidthStyle = import('../api/@ohos.graphics.text').default.RectWidthStyle; + +/** + * Define the RectHeightStyle type. + * + * @typedef { import('../api/@ohos.graphics.text').default.RectHeightStyle } RectHeightStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type RectHeightStyle = import('../api/@ohos.graphics.text').default.RectHeightStyle; + +/** + * Define the TextBox type. + * + * @typedef { import('../api/@ohos.graphics.text').default.TextBox } TextBox + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type TextBox = import('../api/@ohos.graphics.text').default.TextBox; + +/** + * Defines the cursor style + * + * @interface CaretStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the cursor style + * + * @interface CaretStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface CaretStyle { + /** + * Set the cursor width + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the cursor width + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + width?: Length, + + /** + * Set the cursor color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the cursor color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color?: ResourceColor, +} + +/** + * Defines the TextMenuItemId. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TextMenuItemId { + /** + * Init a TextMenuItemId with id. + * + * @param { ResourceStr } id - The id of the TextMenuItemId. + * @returns { TextMenuItemId } - Returns the TextMenuItemId object. + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + static of(id: ResourceStr): TextMenuItemId; + + /** + * Judge if two TextMenuItemId are equal. + * + * @param { TextMenuItemId } id - id TextMenuItemId. + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + equals(id: TextMenuItemId): boolean; + + /** + * Indicates the TextMenuItemId to copy and delete the currently selected text. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly CUT: TextMenuItemId; + + /** + * Indicates the TextMenuItemId to copy the currently selected text to the clipboard. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly COPY: TextMenuItemId; + + /** + * Indicates the TextMenuItemId to copy the current contents of the clipboard into the text view. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly PASTE: TextMenuItemId; + + /** + * Indicates the TextMenuItemId to select all text in a text view. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly SELECT_ALL: TextMenuItemId; + + /** + * Indicates the TextMenuItemId for collaboration service menu items. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly COLLABORATION_SERVICE: TextMenuItemId; + + /** + * Indicates the TextMenuItemId to recognize the text in the picture and input it into the text view. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly CAMERA_INPUT: TextMenuItemId; + + /** + * Indicates the TextMenuItemId to help with text creation by invoking large models. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + static readonly AI_WRITER: TextMenuItemId; +} + +/** + * The previewText. + * @interface PreviewText + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface PreviewText { + /** + * Start offset of the previewText + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offset: number; + + /** + * Value of the previewText. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value: string; +} + +/** + * TextMenuItem + * + * @interface TextMenuItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextMenuItem { + /** + * Customize what the menu displays. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + content: ResourceStr; + /** + * Customize the icon before the menu displays content. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + icon?: ResourceStr; + /** + * Distinguish clicked menu content by Id. + * + * @type { TextMenuItemId } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id: TextMenuItemId; +} + +/** + * EditMenuOptions + * + * @interface EditMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface EditMenuOptions { + /** + * Passes the default menu, invokes before every display to generate a menu for triggering click events. + * + * @param { Array } menuItems - current default menu array. + * @returns { Array } - Return the menu after operations. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onCreateMenu(menuItems: Array): Array; + /** + * Invoke upon clicking an item, capable of intercepting the default system menu execution behavior. + * + * @param { TextMenuItem } menuItem - current default menu. + * @param { TextRange } range - current selected range. + * @returns { boolean } - Return True, the event is consumed, false otherwise. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onMenuItemClick(menuItem: TextMenuItem, range: TextRange): boolean; +} + +/** + * Defines the font decoration result. + * + * @interface DecorationStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface DecorationStyleResult { + /** + * Font decoration type. + * + * @type { TextDecorationType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: TextDecorationType; + + /** + * Font decoration color. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color: ResourceColor; + + /** + * The style value of the decoration property object. + * + * @type { ?TextDecorationStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: TextDecorationStyle; +} + +/** + * Defines the options of font. + * + * @interface FontSettingOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface FontSettingOptions { + /** + * Define weather VariableFontWeight is supported. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + enableVariableFontWeight?: boolean; + } \ No newline at end of file diff --git a/tests/arkts-sdk/ets/text_input.d.ts b/tests/arkts-sdk/ets/text_input.d.ts new file mode 100644 index 00000000..b064a30b --- /dev/null +++ b/tests/arkts-sdk/ets/text_input.d.ts @@ -0,0 +1,2664 @@ +/* + * Copyright (c) 2021-2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Declare the type of input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare the type of input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the type of input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum InputType { + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Normal, + + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Number, + + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + PhoneNumber, + + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Email, + + /** + * Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Password, + + /** + * Number Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Number Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NUMBER_PASSWORD = 8, + + /** + * Screen Lock Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + SCREEN_LOCK_PASSWORD = 9, + + /** + * UserName entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * UserName entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + USER_NAME = 10, + + /** + * NewPassword entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * NewPassword entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + NEW_PASSWORD = 11, + + /** + * Number decimal entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NUMBER_DECIMAL = 12, + + /** + * URL entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + URL = 13, +} + +/** + * Declare the type of input content + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum ContentType { + /** + * User name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + USER_NAME = 0, + + /** + * Password content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PASSWORD = 1, + + /** + * New password content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + NEW_PASSWORD = 2, + + /** + * Full street address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + FULL_STREET_ADDRESS = 3, + + /** + * House number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + HOUSE_NUMBER = 4, + + /** + * District address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + DISTRICT_ADDRESS = 5, + + /** + * City address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + CITY_ADDRESS = 6, + + /** + * Province address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PROVINCE_ADDRESS = 7, + + /** + * Country address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + COUNTRY_ADDRESS = 8, + + /** + * Person full name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PERSON_FULL_NAME = 9, + + /** + * Person last name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PERSON_LAST_NAME = 10, + + /** + * Person first name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PERSON_FIRST_NAME = 11, + + /** + * Phone number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PHONE_NUMBER = 12, + + /** + * Phone country code content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PHONE_COUNTRY_CODE = 13, + + /** + * Full phone number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + FULL_PHONE_NUMBER = 14, + + /** + * Email address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + EMAIL_ADDRESS = 15, + + /** + * Bank card number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + BANK_CARD_NUMBER = 16, + + /** + * ID card number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ID_CARD_NUMBER = 17, + + /** + * Nickname content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + NICKNAME = 23, + + /** + * Detail info without street content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + DETAIL_INFO_WITHOUT_STREET = 24, + + /** + * Format address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + FORMAT_ADDRESS = 25 +} + +/** + * Declare the type of soft keyboard. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare the type of soft keyboard. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the type of soft keyboard. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum EnterKeyType { + /** + * Go. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Go. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Go. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Go = 2, + + /** + * Search. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Search. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Search. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Search = 3, + + /** + * Send. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Send. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Send. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Send = 4, + + /** + * Next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Next = 5, + + /** + * Done. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Done. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Done. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Done = 6, + + /** + * Showed as 'previous' pattern. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Showed as 'previous' pattern. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PREVIOUS = 7, + + /** + * Showed as 'new line' pattern. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Showed as 'new line' pattern. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NEW_LINE = 8, +} + +/** + * Defines the underline color width property. + * + * @interface UnderlineColor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface UnderlineColor { + /** + * Typing underline color width property. + * + * @type { ?(ResourceColor | undefined) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + typing?: ResourceColor | undefined; + /** + * Normal underline color width property. + * + * @type { ?(ResourceColor | undefined) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + normal?: ResourceColor | undefined; + /** + * Error underline color width property. + * + * @type { ?(ResourceColor | undefined) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + error?: ResourceColor | undefined; + /** + * Disable underline color width property. + * + * @type { ?(ResourceColor | undefined) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + disable?: ResourceColor | undefined; +} + +/** + * Provides the method of keeping TextInput editable state when submitted. + * + * @interface SubmitEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SubmitEvent { + /** + * Keeps TextInput editable state when submitted + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + keepEditableState(): void; + + /** + * Sets the current value of TextInput. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + text: string; +} + +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @since 8 + */ +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TextInputController extends TextContentControllerBase { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretPosition(value: number): void; + + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @param { SelectionOptions } [options] - Indicates the options of the text selection. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setTextSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; + + /** + * Exit edit state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Exit edit state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stopEditing(): void; +} + +/** + * Defines the options of TextInput. + * + * @interface TextInputOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of TextInput. + * + * @interface TextInputOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of TextInput. + * + * @interface TextInputOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TextInputOptions { + /** + * The place holder text string. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The place holder text string. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The place holder text string. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholder?: ResourceStr; + + /** + * Sets the current value of TextInput. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the current value of TextInput. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the current value of TextInput. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + text?: ResourceStr; + + /** + * Called when the position of the insertion cursor is set. + * + * @type { ?TextInputController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @type { ?TextInputController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @type { ?TextInputController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + controller?: TextInputController; +} + +/** + * Text input style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Text input style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Text input style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum TextInputStyle { + /** + * Text input default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Text input default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text input default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Default, + + /** + * Text input inline style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Text input inline style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text input inline style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Inline +} + +/** + * Provides a single-line text input component interface. + * + * @interface TextInputInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides a single-line text input component interface. + * + * @interface TextInputInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides a single-line text input component interface. + * + * @interface TextInputInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface TextInputInterface { + /** + * Called when writing a single line of text. + * + * @param { TextInputOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when writing a single line of text. + * + * @param { TextInputOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when writing a single line of text. + * + * @param { TextInputOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: TextInputOptions): TextInputAttribute; +} + +/** + * PasswordIcon object. + * + * @interface PasswordIcon + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * PasswordIcon object. + * + * @interface PasswordIcon + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface PasswordIcon { + /** + * Define the on icon source of PasswordIcon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the on icon source of PasswordIcon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onIconSrc?: string | Resource; + + /** + * Define the off icon source of PasswordIcon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the off icon source of PasswordIcon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offIconSrc?: string | Resource; +} + +/** + * Defines a TextInput callback when onSubmit. + * + * @typedef { function } OnSubmitCallback + * @param { EnterKeyType } enterKey - Input method Enter key type. + * @param { SubmitEvent } event - The event submitted. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnSubmitCallback = (enterKey: EnterKeyType, event: SubmitEvent) => void; + +/** + * Defines a TextInput callback when onTextSelectionChange. + * + * @typedef { function } OnTextSelectionChangeCallback + * @param { number } selectionStart - The starting position of the selected text, the starting position of the text is 0. + * @param { number } selectionEnd - The end location of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnTextSelectionChangeCallback = (selectionStart: number, selectionEnd: number) => void; + +/** + * Defines a TextInput callback when onContentScroll. + * + * @typedef { function } OnContentScrollCallback + * @param { number } totalOffsetX - The text is offset in px on the horizontal axis of the content area. + * @param { number } totalOffsetY - The text is offset in px on the vertical axis of the content area. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnContentScrollCallback = (totalOffsetX: number, totalOffsetY: number) => void; + + +/** + * Defines a TextInput callback when onPaste. + * + * @typedef { function } OnPasteCallback + * @param { string } content - The text content of the paste. + * @param { PasteEvent } event - User-defined paste event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnPasteCallback = (content: string, event: PasteEvent) => void; + +/** + * Defines the TextInput attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the TextInput attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the TextInput attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TextInputAttribute extends CommonMethod { + /** + * Called when the input type is set. + * + * @param { InputType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the input type is set. + * + * @param { InputType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the input type is set. + * + * @param { InputType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type(value: InputType): TextInputAttribute; + + /** + * Called when the content type is set. + * + * @param { ContentType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + contentType(value: ContentType): TextInputAttribute; + + /** + * Called when the color of the placeholder is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the color of the placeholder is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the color of the placeholder is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholderColor(value: ResourceColor): TextInputAttribute; + + /** + * Called when the overflow mode of the font is set. + * + * @param { TextOverflow } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textOverflow(value: TextOverflow): TextInputAttribute; + + /** + * Specify the indentation of the first line in a text-block. + * + * @param { Dimension } value - The length of text indent. + * @returns { TextInputAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textIndent(value: Dimension): TextInputAttribute; + + /** + * Called when the font property of the placeholder is set. + * + * @param { Font } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font property of the placeholder is set. + * + * @param { Font } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font property of the placeholder is set. + * + * @param { Font } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholderFont(value?: Font): TextInputAttribute; + + /** + * Called when the type of soft keyboard input button is set. + * + * @param { EnterKeyType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the type of soft keyboard input button is set. + * + * @param { EnterKeyType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the type of soft keyboard input button is set. + * + * @param { EnterKeyType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enterKeyType(value: EnterKeyType): TextInputAttribute; + + /** + * Called when the color of the insertion cursor is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the color of the insertion cursor is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the color of the insertion cursor is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretColor(value: ResourceColor): TextInputAttribute; + + /** + * Called when judging whether the text editing change finished. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 8 + * @useinstead onEditChange + */ + onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute; + + /** + * Called when judging whether the text editing change finished. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when judging whether the text editing change finished. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether the text editing change finished. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when judging whether the text editing change finished. + * + * @param { Callback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onEditChange(callback: Callback): TextInputAttribute; + + /** + * Called when submitted. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when submitted. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when submitted. + * + * @param { function } callback - callback of the listened event. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when submitted. + * + * @param { OnSubmitCallback } callback - Callback of the listened event. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSubmit(callback: OnSubmitCallback): TextInputAttribute; + + /** + * Called when the input of the input box changes. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the input of the input box changes. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the input of the input box changes. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the input of the input box changes. + * + * @param { EditableTextOnChangeCallback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onChange(callback: EditableTextOnChangeCallback): TextInputAttribute; + + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the text selection changes. + * + * @param { OnTextSelectionChangeCallback } callback - Callback of the listened event. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onTextSelectionChange(callback: OnTextSelectionChangeCallback): TextInputAttribute; + + /** + * Called when the content scrolls. + * + * @param { function } callback - callback of the listened event. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the content scrolls. + * + * @param { function } callback - callback of the listened event. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the content scrolls. + * + * @param { OnContentScrollCallback } callback - Callback of the listened event. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onContentScroll(callback: OnContentScrollCallback): TextInputAttribute; + + /** + * Called when the input of maximum text length is set. + * + * @param { number } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the input of maximum text length is set. + * + * @param { number } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the input of maximum text length is set. + * + * @param { number } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxLength(value: number): TextInputAttribute; + + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): TextInputAttribute; + + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontSize(value: Length): TextInputAttribute; + + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): TextInputAttribute; + + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): TextInputAttribute; + + /** + * Called when the font list of text is set. + * + * @param { ResourceStr } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font list of text is set. + * + * @param { ResourceStr } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font list of text is set. + * + * @param { ResourceStr } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontFamily(value: ResourceStr): TextInputAttribute; + + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { function } error + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { function } error + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { function } error + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { Callback } [error] + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + inputFilter(value: ResourceStr, error?: Callback): TextInputAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCopy(callback: Callback): TextInputAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCut(callback: Callback): TextInputAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * Executed when a paste operation is performed. + * { string } value - The text content to be pasted. + * { PasteEvent } event - The user-defined paste event. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { OnPasteCallback } callback - Executed when a paste operation is performed. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPaste(callback: OnPasteCallback): TextInputAttribute; + + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + copyOption(value: CopyOptions): TextInputAttribute; + + /** + * Called when the password show/hide icon is set. + * + * @param { boolean } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the password show/hide icon is set. + * + * @param { boolean } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the password show/hide icon is set. + * + * @param { boolean } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showPasswordIcon(value: boolean): TextInputAttribute; + + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textAlign(value: TextAlign): TextInputAttribute; + + /** + * Text input style + * + * @param { TextInputStyle | TextContentStyle } value - Text input style + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Text input style + * + * @param { TextInputStyle | TextContentStyle } value - Text input style + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text input style + * + * @param { TextInputStyle | TextContentStyle } value - Text input style + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style(value: TextInputStyle | TextContentStyle): TextInputAttribute; + + /** + * Define the caret style of the text input + * + * @param { CaretStyle } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the caret style of the text input + * + * @param { CaretStyle } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretStyle(value: CaretStyle): TextInputAttribute; + + /** + * Define the text selected background color of the text input. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the text selected background color of the text input. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedBackgroundColor(value: ResourceColor): TextInputAttribute; + + /** + * Define the caret position of the text input. + * + * @param { number } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the caret position of the text input. + * + * @param { number } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretPosition(value: number): TextInputAttribute; + + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } value + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } value + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableKeyboardOnFocus(value: boolean): TextInputAttribute; + + /** + * Define the password icon of the text input. + * + * @param { PasswordIcon } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the password icon of the text input. + * + * @param { PasswordIcon } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + passwordIcon(value: PasswordIcon): TextInputAttribute; + + /** + * Define the show error of the text input. + * + * @param { string | undefined } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the show error of the text input. + * + * @param { string | undefined } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Define the show error of the text input. + * + * @param { ResourceStr | undefined } [value] + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showError(value?: ResourceStr | undefined): TextInputAttribute; + + /** + * Define the show unit of the text input. + * + * @param { CustomBuilder } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the show unit of the text input. + * + * @param { CustomBuilder } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showUnit(value: CustomBuilder): TextInputAttribute; + + /** + * Define the show underline of the text input. + * + * @param { boolean } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the show underline of the text input. + * + * @param { boolean } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showUnderline(value: boolean): TextInputAttribute; + + /** + * Define the underline color of the text input. + * + * @param { ResourceColor | UnderlineColor | undefined } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + underlineColor(value: ResourceColor | UnderlineColor | undefined): TextInputAttribute; + + /** + * Controls whether the selection menu pops up. + * + * @param { boolean } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Controls whether the selection menu pops up. + * + * @param { boolean } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectionMenuHidden(value: boolean): TextInputAttribute; + + /** + * Define bar state of the text input. + * + * @param { BarState } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define bar state of the text input. + * + * @param { BarState } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + barState(value: BarState): TextInputAttribute; + + /** + * Define max lines of the text input. + * + * @param { number } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define max lines of the text input. + * + * @param { number } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxLines(value: number): TextInputAttribute; + + /** + * Set the text inline style word break type. + * + * @param { WordBreak } value - The word break type. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + wordBreak(value: WordBreak): TextInputAttribute; + + /** + * Set the text line break strategy type. + * + * @param { LineBreakStrategy } strategy - The text line break strategy type. + * @returns { TextInputAttribute } The attribute of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineBreakStrategy(strategy: LineBreakStrategy): TextInputAttribute; + + /** + * Define custom keyboard of the text input. + * + * @param { CustomBuilder } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define custom keyboard of the text input. + * + * @param { CustomBuilder } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + + /** + * Define custom keyboard of the text input. + * + * @param { CustomBuilder } value - Set up a custom keyboard of TextInput + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of TextInput + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customKeyboard(value: CustomBuilder, options?: KeyboardOptions): TextInputAttribute; + + /** + * Show the counter when the number of characters entered exceeds the threshold through InputCounterOptions. + * + * @param { boolean } value - Set showcounter of the text input. + * @param { InputCounterOptions } options - Set the percentage of counter. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showCounter(value: boolean, options?: InputCounterOptions): TextInputAttribute; + + /** + * Set the cancel button style + * + * @param { object } value - indicates the style of the cancel button. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the cancel button style + * + * @param { object } value - indicates the style of the cancel button. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Set the cancel button style. + * + * @param { CancelButtonOptions } options - Indicates the style of the cancel button. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + cancelButton(options: CancelButtonOptions): TextInputAttribute; + + /** + * Set the cancel button style + * + * @param { CancelButtonSymbolOptions } symbolOptions - indicates the style of the cancel button. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + cancelButton(symbolOptions: CancelButtonSymbolOptions): TextInputAttribute; + + /** + * Sets selection when on focus. + * + * @param { boolean } value - Sets selection or not. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets selection when on focus. + * + * @param { boolean } value - Sets selection or not. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectAll(value: boolean): TextInputAttribute; + + /** + * Called when the minimum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + minFontSize(value: number | string | Resource): TextInputAttribute; + + /** + * Called when the maximum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maxFontSize(value: number | string | Resource): TextInputAttribute; + + /** + * Called when the height adaptive policy is set. + * + * @param { TextHeightAdaptivePolicy } value - The height adaptive policy. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + heightAdaptivePolicy(value: TextHeightAdaptivePolicy): TextInputAttribute; + + /** + * Sets whether enable auto fill or not. + * + * @param { boolean } value - Indicates the flag whether autofill is enabled. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Sets whether enable auto fill or not. + * + * @param { boolean } value - Indicates the flag whether autofill is enabled. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableAutoFill(value: boolean): TextInputAttribute; + + /** + * Called when the text decoration of the text is set. + * + * @param { TextDecorationOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + decoration(value: TextDecorationOptions): TextInputAttribute; + + /** + * Called when the distance between text fonts is set. + * + * @param { number | string | Resource } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + letterSpacing(value: number | string | Resource): TextInputAttribute; + + /** + * Called when the line height of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineHeight(value: number | string | Resource): TextInputAttribute; + + /** + * Define the password rules of the text input. + * + * @param { string } value - Indicates the password rules. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Define the password rules of the text input. + * + * @param { string } value - Indicates the password rules. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + passwordRules(value: string): TextInputAttribute; + + /** + * Set font feature. + * + * @param { string } value - The fontFeature. + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * the values of reference to doc of TextInput component + * number of can be single or multiple, and separated by comma ','. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFeature(value: string): TextInputAttribute; + + /** + * Define the password visible mode of the text input. + * + * @param { boolean } visible - Indicates the password visible mode. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showPassword(visible: boolean): TextInputAttribute; + + /** + * Called when changing the password visible mode of the text input. + * + * @param { Callback } callback - callback of the password visible mode change event. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onSecurityStateChange(callback: Callback): TextInputAttribute; + + /** + * Get text value information when about to input. + * + * @param { Callback } callback - The triggered function when text content is about to insert. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillInsert(callback: Callback): TextInputAttribute; + + /** + * Get text value information when completed input. + * + * @param { Callback } callback - The triggered function when text content has been inserted. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidInsert(callback: Callback): TextInputAttribute; + + /** + * Get text value information when about to delete. + * + * @param { Callback } callback - The triggered function when text content is about to delete. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDelete(callback: Callback): TextInputAttribute; + + /** + * Get text value information when the deletion has been completed + * + * @param { Callback } callback - The triggered function when text content has been deleted. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidDelete(callback: Callback): TextInputAttribute; + + /** + * Set the custom text menu. + * + * @param { EditMenuOptions } editMenu - Customize text menu options. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + editMenuOptions(editMenu: EditMenuOptions): TextInputAttribute; + + /** + * Define the preview text mode of the text input. + * + * @param { boolean } enable - Indicates the preview text mode. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enablePreviewText(enable: boolean): TextInputAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): TextInputAttribute; +} + +/** + * Defines TextInput Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TextInput Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextInput Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TextInput: TextInputInterface; + +/** + * Defines TextInput Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TextInput Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextInput Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TextInputInstance: TextInputAttribute; diff --git a/tests/arkts-sdk/ets/text_picker.d.ts b/tests/arkts-sdk/ets/text_picker.d.ts new file mode 100644 index 00000000..61e82f4b --- /dev/null +++ b/tests/arkts-sdk/ets/text_picker.d.ts @@ -0,0 +1,1205 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Define the contents of each selector item. + * + * @interface TextPickerRangeContent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define the contents of each selector item. + * + * @interface TextPickerRangeContent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TextPickerRangeContent { + /** + * Specifies the icon content. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specifies the icon content. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + icon: string | Resource; + + /** + * Specifies the text content. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specifies the text content. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + text?: string | Resource; +} + +/** + * Define the contents of text cascade picker. + * + * @interface TextCascadePickerRangeContent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Define the contents of text cascade picker. + * + * @interface TextCascadePickerRangeContent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TextCascadePickerRangeContent { + /** + * Specifies the text content. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Specifies the text content. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + text: string | Resource; + + /** + * Defines the text cascade picker children. + * + * @type { ?TextCascadePickerRangeContent[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Defines the text cascade picker children. + * + * @type { ?TextCascadePickerRangeContent[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + children?: TextCascadePickerRangeContent[]; +} + +/** + * Defines the options of TextPicker. + * + * @interface TextPickerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the options of TextPicker. + * + * @interface TextPickerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of TextPicker. + * + * @interface TextPickerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TextPickerOptions { + /** + * Specifies the range of the text selector. + * + * @type {string[] | Resource} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Specifies the range of the selector. + * Support the display of pictures, text and pictures plus text, or multi column plain text. + * + * @type {string[] | string[][] | Resource | TextPickerRangeContent[] | TextCascadePickerRangeContent[]} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specifies the range of the selector. + * Support the display of pictures, text and pictures plus text, or multi column plain text. + * + * @type {string[] | string[][] | Resource | TextPickerRangeContent[] | TextCascadePickerRangeContent[]} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + range: string[] | string[][] | Resource | TextPickerRangeContent[] | TextCascadePickerRangeContent[]; + + /** + * Value of the current selection. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Value of the current selection. + * Only valid when only text is displayed. + * + * @type { ?(string | string[]) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Value of the current selection. + * Only valid when only text is displayed. + * + * @type { ?(string | string[]) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value?: string | string[]; + + /** + * Current selected subscript. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Current selected subscript. + * + * @type { ?(number | number[]) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Current selected subscript. + * + * @type { ?(number | number[]) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selected?: number | number[]; +} + +/** + * TextPickerInterface + * + * @interface TextPickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * TextPickerInterface + * + * @interface TextPickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * TextPickerInterface + * + * @interface TextPickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface TextPickerInterface { + /** + * Defines the TextPicker constructor. + * + * @param { TextPickerOptions } options + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the TextPicker constructor. + * + * @param { TextPickerOptions } options + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the TextPicker constructor. + * + * @param { TextPickerOptions } options + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (options?: TextPickerOptions): TextPickerAttribute; +} + +/** + * Defines the struct of DividerOptions. + * + * @interface DividerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DividerOptions { + /** + * The strokeWidth of Divider. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + strokeWidth?: Dimension; + + /** + * The color of Divider. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * The startMargin of Divider. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + startMargin?: Dimension; + + /** + * The endMargin of Divider. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + endMargin?: Dimension; +} + +/** + * Callback of the listened scroll stop event. + * + * @typedef {function} TextPickerScrollStopCallback + * @param { string | string[] } value - Value of the selected item. + * @param { number | number[] } index - Index of the selected item. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type TextPickerScrollStopCallback = (value: string | string[], index: number | number[]) => void; + +/** + * Style the text selector. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Style the text selector. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Style the text selector. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TextPickerAttribute extends CommonMethod { + /** + * Called when the default height of the selected element is set. + * + * @param { number | string } value + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the default height of the selected element is set. + * + * @param { number | string } value + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the default height of the selected element is set. + * + * @param { number | string } value + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + defaultPickerItemHeight(value: number | string): TextPickerAttribute; + + /** + * Can scroll loop if true is set, on the contrary it can not. + * + * @param { boolean } value + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Can scroll loop if true is set, on the contrary it can not. + * + * @param { boolean } value + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + canLoop(value: boolean): TextPickerAttribute; + + /** + * Sets the text style of disappearing items + * + * @param { PickerTextStyle } value - indicates the text style of disappearing items. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of disappearing items + * + * @param { PickerTextStyle } value - indicates the text style of disappearing items. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + disappearTextStyle(value: PickerTextStyle): TextPickerAttribute; + + /** + * Sets the text style of normal items + * + * @param { PickerTextStyle } value - indicates the text style of normal items. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of normal items + * + * @param { PickerTextStyle } value - indicates the text style of normal items. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle(value: PickerTextStyle): TextPickerAttribute; + + /** + * Sets the text style of selected items + * + * @param { PickerTextStyle } value - indicates the text style of selected items. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of selected items + * + * @param { PickerTextStyle } value - indicates the text style of selected items. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedTextStyle(value: PickerTextStyle): TextPickerAttribute; + + /** + * Called when the pop-up value is returned. + * + * @param { function } callback + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + onAccept(callback: (value: string, index: number) => void): TextPickerAttribute; + + /** + * Called when the Cancel button in the pop-up window is clicked. + * + * @param { function } callback + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + onCancel(callback: () => void): TextPickerAttribute; + + /** + * Called when the OK button in the pop-up window is clicked. + * + * @param { function } callback - the callback of onChange. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * This event is triggered when a TextPicker item is selected. + * Only valid when only text is displayed. When picture or picture plus text is displayed, the value is "". + * + * @param { function } callback - the callback of onChange. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This event is triggered when a TextPicker item is selected. + * Only valid when only text is displayed. When picture or picture plus text is displayed, the value is "". + * + * @param { function } callback - the callback of onChange. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onChange(callback: (value: string | string[], index: number | number[]) => void): TextPickerAttribute; + + /** + * This event is triggered when a TextPicker item is selected and scrolling has stopped. + * Only valid when only text is displayed. When picture or picture plus text is displayed, the value is "". + * + * @param { TextPickerScrollStopCallback } callback - the callback of onScrollStop. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollStop(callback: TextPickerScrollStopCallback): TextPickerAttribute; + + /** + * Set the selected indices. + * The array size is the total number of columns. + * + * @param { number | number[] } value - the selected indices. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the selected indices. + * The array size is the total number of columns. + * + * @param { number | number[] } value - the selected indices. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedIndex(value: number | number[]): TextPickerAttribute; + + /** + * Set the divider of TextPicker + * + * @param { DividerOptions | null } value + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + divider(value: DividerOptions | null): TextPickerAttribute; + + /** + * Called when set the height of gradient + * + * @param { Dimension } value - The value the gradient height + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + gradientHeight(value: Dimension): TextPickerAttribute; +} + +/** + * Defines the struct of TextPickerResult. + * + * @interface TextPickerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the struct of TextPickerResult. + * + * @interface TextPickerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the struct of TextPickerResult. + * + * @interface TextPickerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TextPickerResult { + /** + * The currently selected value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The currently selected value. + * Only valid when only text is displayed.When picture or picture plus text is displayed, the value of value is "". + * + * @type { string | string[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The currently selected value. + * Only valid when only text is displayed.When picture or picture plus text is displayed, the value of value is "". + * + * @type { string | string[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string | string[]; + + /** + * The subscript of the current selection. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The subscript of the current selection. + * + * @type { number | number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The subscript of the current selection. + * + * @type { number | number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + index: number | number[]; +} + +/** + * Defines the TextPickerDialogOptions for Text Picker Dialog. + * + * @interface TextPickerDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the TextPickerDialogOptions for Text Picker Dialog. + * + * @interface TextPickerDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the TextPickerDialogOptions for Text Picker Dialog. + * + * @interface TextPickerDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TextPickerDialogOptions extends TextPickerOptions { + /** + * Called when the default height of the selected element is set. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the default height of the selected element is set. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the default height of the selected element is set. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + defaultPickerItemHeight?: number | string; + + /** + * Can scroll loop if true is set, on the contrary it can not. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Can scroll loop if true is set, on the contrary it can not. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + canLoop?: boolean; + + /** + * Text style of disappearing items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text style of disappearing items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + disappearTextStyle?: PickerTextStyle; + + /** + * Text style of normal items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text style of normal items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle?: PickerTextStyle; + + /** + * Style of accept button. + * + * @type { ?PickerDialogButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + acceptButtonStyle?: PickerDialogButtonStyle; + + /** + * Style of cancel button. + * + * @type { ?PickerDialogButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cancelButtonStyle?: PickerDialogButtonStyle; + + /** + * Text style of selected items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text style of selected items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedTextStyle?: PickerTextStyle; + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAccept?: (value: TextPickerResult) => void; + + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onCancel?: () => void; + + /** + * This event is triggered when a TextPicker text is selected in dialog. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * This event is triggered when a TextPicker text is selected in dialog. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This event is triggered when a TextPicker text is selected in dialog. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onChange?: (value: TextPickerResult) => void; + + /** + * This event is triggered when a TextPicker text is selected and scrolling has stopped in dialog. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollStop?: Callback; + + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maskRect?: Rectangle; + + /** + * Defines the dialog alignment of the screen. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the dialog alignment of the screen. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + alignment?: DialogAlignment; + + /** + * Defines the dialog offset. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the dialog offset. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Offset; + + /** + * Defines the textPickerDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the textPickerDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Defines the textPickerDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the textPickerDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Callback function when the dialog appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidAppear?: () => void; + + /** + * Callback function when the dialog disappears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidDisappear?: () => void; + + /** + * Callback function before the dialog openAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillAppear?: () => void; + + /** + * Callback function before the dialog closeAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDisappear?: () => void; + + /** + * Defines the dialog's shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the dialog's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; +} + +/** + * Defines TextPickerDialog which uses show method to show TextPicker dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines TextPickerDialog which uses show method to show TextPicker dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextPickerDialog which uses show method to show TextPicker dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TextPickerDialog { + /** + * Invoking method display. + * + * @param { TextPickerDialogOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Invoking method display. + * + * @param { TextPickerDialogOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoking method display. + * + * @param { TextPickerDialogOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + static show(options?: TextPickerDialogOptions); +} + +/** + * Defines TextPicker Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines TextPicker Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextPicker Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TextPicker: TextPickerInterface; + +/** + * Defines TextPicker Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines TextPicker Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextPicker Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TextPickerInstance: TextPickerAttribute; + diff --git a/tests/arkts-sdk/ets/text_timer.d.ts b/tests/arkts-sdk/ets/text_timer.d.ts new file mode 100644 index 00000000..b5e2bea6 --- /dev/null +++ b/tests/arkts-sdk/ets/text_timer.d.ts @@ -0,0 +1,708 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides a way to control the process. + * + * @since 8 + */ +/** + * Provides a way to control the process. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides a way to control the process. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class TextTimerController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Provides a start event for timer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Provides a start event for timer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Provides a start event for timer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + start(); + + /** + * Provides a pause event for timer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Provides a pause event for timer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Provides a pause event for timer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + pause(); + + /** + * Provides an event to reset timer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Provides an event to reset timer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Provides an event to reset timer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + reset(); +} + +/** + * TextTimerConfiguration used by content modifier. + * + * @interface TextTimerConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextTimerConfiguration extends CommonConfiguration { + /** + * Specifies the timer range. + * In the non-countDown scenario, a negative value indicates that the timer is not limited. + * The unit is millisecond. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + count: number; + + /** + * Texttimer is isCountDown or not. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isCountDown: boolean; + + /** + * Texttimer is started or not. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + started: boolean; + + /** + * Elapsed time of the timer, readonly. + * The unit is millisecond. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + elapsedTime: number; +} + +/** + * Defines the options of TextTimer. + * + * @interface TextTimerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the options of TextTimer. + * + * @interface TextTimerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of TextTimer. + * + * @interface TextTimerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface TextTimerOptions { + /** + * Sets whether to countdown.The default value is false. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets whether to countdown.The default value is false. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets whether to countdown.The default value is false. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + isCountDown?: boolean; + + /** + * Specifies the timer range. + * In the non-countDown scenario, a negative value indicates that the timer is not limited. + * The unit is millisecond. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Specifies the timer range. + * In the non-countDown scenario, a negative value indicates that the timer is not limited. + * The unit is millisecond. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies the timer range. + * In the non-countDown scenario, a negative value indicates that the timer is not limited. + * The unit is millisecond. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + count?: number; + + /** + * Controller of Texttimer. + * + * @type { ?TextTimerController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Controller of Texttimer. + * + * @type { ?TextTimerController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Controller of Texttimer. + * + * @type { ?TextTimerController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + controller?: TextTimerController; +} + +/** + * Provides an interface for texttimer containers. + * + * @interface TextTimerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides an interface for texttimer containers. + * + * @interface TextTimerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for texttimer containers. + * + * @interface TextTimerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface TextTimerInterface { + /** + * Defines the TextTimer constructor. + * + * @param { TextTimerOptions } options + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the TextTimer constructor. + * + * @param { TextTimerOptions } options + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the TextTimer constructor. + * + * @param { TextTimerOptions } options + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (options?: TextTimerOptions): TextTimerAttribute; +} + +/** + * Defines the TextTimer attribute functions. + * + * @extends CommonMethod + * @since 8 + */ +/** + * Defines the TextTimer attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the TextTimer attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class TextTimerAttribute extends CommonMethod { + /** + * Set the display time format, for example, now is hh/mm/ss/ms and current: hh-mm-ss-ms. + * The time format string can be hh, mm, ss, or ms. + * + * @param { string } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the display time format, for example, now is hh/mm/ss/ms and current: hh-mm-ss-ms. + * The time format string can be hh, mm, ss, or ms. + * + * @param { string } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the display time format, for example, now is hh/mm/ss/ms and current: hh-mm-ss-ms. + * The time format string can be hh, mm, ss, or ms. + * + * @param { string } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + format(value: string): TextTimerAttribute; + + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): TextTimerAttribute; + + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontSize(value: Length): TextTimerAttribute; + + /** + * Called when the fontStyle is set + * + * @param { FontStyle } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the fontStyle is set + * + * @param { FontStyle } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the fontStyle is set + * + * @param { FontStyle } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): TextTimerAttribute; + + /** + * Called when the fontWeight is set + * + * @param { number | FontWeight | string } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the fontWeight is set + * + * @param { number | FontWeight | string } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the fontWeight is set + * + * @param { number | FontWeight | string } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): TextTimerAttribute; + + /** + * Called when the fontFamily is set + * + * @param { ResourceStr } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the fontFamily is set + * + * @param { ResourceStr } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the fontFamily is set + * + * @param { ResourceStr } value + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontFamily(value: ResourceStr): TextTimerAttribute; + + /** + * Called when the timer value is returned. + * + * @param { function } event + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the timer value is returned. + * + * @param { function } event + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the timer value is returned. + * + * @param { function } event + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onTimer(event: (utc: number, elapsedTime: number) => void): TextTimerAttribute; + + /** + * Called when the text shadow is set. + * + * @param { ShadowOptions | Array } value - The shadow options. + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the text shadow is set. + * + * @param { ShadowOptions | Array } value - The shadow options. + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textShadow(value: ShadowOptions | Array): TextTimerAttribute; + + /** + * Set the content modifier of texttimer. + * + * @param { ContentModifier } modifier - The content modifier of texttimer. + * @returns { TextTimerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): TextTimerAttribute; +} + +/** + * Defines TextTimer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines TextTimer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines TextTimer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const TextTimer: TextTimerInterface; + +/** + * Defines TextTimer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines TextTimer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines TextTimer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const TextTimerInstance: TextTimerAttribute; diff --git a/tests/arkts-sdk/ets/time_picker.d.ts b/tests/arkts-sdk/ets/time_picker.d.ts new file mode 100644 index 00000000..64f92e5e --- /dev/null +++ b/tests/arkts-sdk/ets/time_picker.d.ts @@ -0,0 +1,975 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the struct of TimePickerResult. + * + * @interface TimePickerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the struct of TimePickerResult. + * + * @interface TimePickerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the struct of TimePickerResult. + * + * @interface TimePickerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TimePickerResult { + /** + * Application hour + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Application hour + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Hour portion of the selected time. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hour: number; + + /** + * Application minute + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Application minute + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Minute portion of the selected time. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + minute: number; + + /** + * Second portion of the selected time. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + second: number; +} + +/** + * Type of the TimePicker that need to be displayed. + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Type of the TimePicker that need to be displayed. + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum TimePickerFormat { + /** + * Hour and minute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Hour and minute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HOUR_MINUTE, + + /** + * Hour and minute and second + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Hour and minute and second + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HOUR_MINUTE_SECOND, +} + +/** + * Defines the options of TimePicker. + * + * @interface TimePickerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the options of TimePicker. + * + * @interface TimePickerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of TimePicker. + * + * @interface TimePickerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TimePickerOptions { + /** + * Specifies the time selector check time. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Specifies the time selector check time. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Specifies the time selector check time. + * + * @type { ?Date } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selected?: Date; + + /** + * Specifies the format of the TimePicker that need to be displayed. + * + * @type { ?TimePickerFormat } + * @default HOUR_MINUTE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Specifies the format of the TimePicker that need to be displayed. + * + * @type { ?TimePickerFormat } + * @default HOUR_MINUTE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + format?: TimePickerFormat; +} + +/** + * Defines the TimePicker Component. + * + * @interface TimePickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the TimePicker Component. + * + * @interface TimePickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the TimePicker Component. + * + * @interface TimePickerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface TimePickerInterface { + /** + * Defines the TimePicker constructor. + * + * @param { TimePickerOptions } options + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the TimePicker constructor. + * + * @param { TimePickerOptions } options + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the TimePicker constructor. + * + * @param { TimePickerOptions } options + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (options?: TimePickerOptions): TimePickerAttribute; +} +/** + * Define the internationalization parameter format. + * + * @typedef { import('../api/@ohos.intl').default.DateTimeOptions } DateTimeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type DateTimeOptions = import('../api/@ohos.intl').default.DateTimeOptions + +/** + * Defines the TimePicker attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the TimePicker attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the TimePicker attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TimePickerAttribute extends CommonMethod { + /** + * Time Selector: indicates whether to display the 24-hour clock. + * + * @param { boolean } value + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Time Selector: indicates whether to display the 24-hour clock. + * + * @param { boolean } value + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Time Selector: indicates whether to display the 24-hour clock. + * + * @param { boolean } value + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + useMilitaryTime(value: boolean): TimePickerAttribute; + + /** + * Sets whether to enable the wheel mode. + * @param { boolean } value - indicates whether to enable the wheel mode. + * @returns { TimePickerAttribute } the attribute of the time picker + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets whether to enable the wheel mode. + * @param { boolean } value - indicates whether to enable the wheel mode. + * @returns { TimePickerAttribute } the attribute of the time picker + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + loop(value: boolean): TimePickerAttribute; + + /** + * Sets the text style of disappearing items + * + * @param { PickerTextStyle } value - indicates the text style of disappearing items. + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of disappearing items + * + * @param { PickerTextStyle } value - indicates the text style of disappearing items. + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + disappearTextStyle(value: PickerTextStyle): TimePickerAttribute; + + /** + * Sets the text style of normal items + * + * @param { PickerTextStyle } value - indicates the text style of normal items. + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of normal items + * + * @param { PickerTextStyle } value - indicates the text style of normal items. + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle(value: PickerTextStyle): TimePickerAttribute; + + /** + * Sets the text style of selected items + * + * @param { PickerTextStyle } value - indicates the text style of selected items. + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the text style of selected items + * + * @param { PickerTextStyle } value - indicates the text style of selected items. + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedTextStyle(value: PickerTextStyle): TimePickerAttribute; + + /** + * Set time format + * + * @param { DateTimeOptions } value - indicates the format of the time display. + * @returns { TimePickerAttribute } the attribute of the time picker + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dateTimeOptions(value: DateTimeOptions): TimePickerAttribute; + + /** + * This event is triggered when a TimePicker time is selected. + * + * @param { function } callback + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * This event is triggered when a TimePicker time is selected. + * + * @param { function } callback + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This event is triggered when a TimePicker time is selected. + * + * @param { function } callback + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onChange(callback: (value: TimePickerResult) => void): TimePickerAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } enable - Default value is true, set false to disable haptic feedback. + * @returns { TimePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableHapticFeedback(enable: boolean): TimePickerAttribute; +} + +/** + * Defines the TimePickerDialogOptions for Data Picker Dialog. + * + * @interface TimePickerDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the TimePickerDialogOptions for Data Picker Dialog. + * + * @interface TimePickerDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the TimePickerDialogOptions for Data Picker Dialog. + * + * @interface TimePickerDialogOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TimePickerDialogOptions extends TimePickerOptions { + /** + * Time Selector: indicates whether to display the 24-hour clock. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Time Selector: indicates whether to display the 24-hour clock. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Time Selector: indicates whether to display the 24-hour clock. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + useMilitaryTime?: boolean; + + /** + * Text style of disappearing items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text style of disappearing items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + disappearTextStyle?: PickerTextStyle; + + /** + * Text style of normal items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text style of normal items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle?: PickerTextStyle; + + /** + * Style of accept button. + * + * @type { ?PickerDialogButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + acceptButtonStyle?: PickerDialogButtonStyle; + + /** + * Style of cancel button. + * + * @type { ?PickerDialogButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cancelButtonStyle?: PickerDialogButtonStyle; + + /** + * Text style of selected items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text style of selected items + * + * @type { ?PickerTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedTextStyle?: PickerTextStyle; + + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maskRect?: Rectangle; + + /** + * Defines the dialog alignment of the screen. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the dialog alignment of the screen. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + alignment?: DialogAlignment; + + /** + * Defines the dialog offset. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the dialog offset. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Offset; + + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAccept?: (value: TimePickerResult) => void; + + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onCancel?: () => void; + + /** + * This event is triggered when a TimePicker Time or time is selected in dialog. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * This event is triggered when a TimePicker Time or time is selected in dialog. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This event is triggered when a TimePicker Time or time is selected in dialog. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onChange?: (value: TimePickerResult) => void; + + /** + * Defines the timePickerDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the timePickerDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Defines the timePickerDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the timePickerDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Callback function when the dialog appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidAppear?: () => void; + + /** + * Callback function when the dialog disappears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidDisappear?: () => void; + + /** + * Callback function before the dialog openAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillAppear?: () => void; + + /** + * Callback function before the dialog closeAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDisappear?: () => void; + + /** + * Defines the dialog's shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Set time format + * + * @type { ?DateTimeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dateTimeOptions?: DateTimeOptions; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the dialog's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; +} + +/** + * Defines TimePickerDialog which uses show method to show TimePicker dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines TimePickerDialog which uses show method to show TimePicker dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TimePickerDialog which uses show method to show TimePicker dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TimePickerDialog { + /** + * Invoking method display. + * + * @param { TimePickerDialogOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Invoking method display. + * + * @param { TimePickerDialogOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoking method display. + * + * @param { TimePickerDialogOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + static show(options?: TimePickerDialogOptions); +} + +/** + * Defines TimePicker Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines TimePicker Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TimePicker Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TimePicker: TimePickerInterface; + +/** + * Defines TimePicker Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines TimePicker Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TimePicker Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TimePickerInstance: TimePickerAttribute; diff --git a/tests/arkts-sdk/ets/toggle.d.ts b/tests/arkts-sdk/ets/toggle.d.ts new file mode 100644 index 00000000..f09c16c1 --- /dev/null +++ b/tests/arkts-sdk/ets/toggle.d.ts @@ -0,0 +1,666 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * 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 + * @form + * @since 9 + */ +/** + * Declare the type of status button + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare the type of status button + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ToggleType { + /** + * Checkbox + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Checkbox + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Checkbox + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Checkbox + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Checkbox, + + /** + * Switch + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Switch + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Switch + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Switch + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Switch, + + /** + * Button + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Button + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Button + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Button + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Button, +} + +/** + * Defines the switch style. + * + * @interface SwitchStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SwitchStyle { + /** + * Set the radius of the point of the switch. + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pointRadius?: number | Resource; + + /** + * Set the color of the unselected switch. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + unselectedColor?: ResourceColor; + + /** + * Set the color of the point of the switch. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pointColor?: ResourceColor; + + /** + * Set the border radius of the track of the switch. + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + trackBorderRadius?: number | Resource; +} + +/** + * ToggleConfiguration used by toggle Modifier + * + * @interface ToggleConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ToggleConfiguration extends CommonConfiguration { + + /** + * Indicates whether the Toggle is on. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isOn: boolean; + + /** + * Indicates whether the Toggle is enabled. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enabled: boolean; + + /** + * Trigger toggle select change + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + triggerChange: Callback; +} + +/** + * Defines the toggle options. + * + * @interface ToggleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface ToggleOptions { + /** + * Type of the toggle. + * + * @type { ToggleType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Type of the toggle. + * + * @type { ToggleType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Type of the toggle. + * + * @type { ToggleType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Type of the toggle. + * + * @type { ToggleType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + type: ToggleType; + + /** + * Whether the toggle is on. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Whether the toggle is on. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Whether the toggle is on. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Whether the toggle is on. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + isOn?: boolean +} + +/** + * Defines the toggle interface. + * + * @interface ToggleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the toggle interface. + * + * @interface ToggleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the toggle interface. + * + * @interface ToggleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the toggle interface. + * + * @interface ToggleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +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 + * @form + * @since 9 + */ + /** + * Set parameters to obtain the toggle. + * + * @param { object } options + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set parameters to obtain the toggle. + * + * @param { object } options + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Set parameters to obtain the toggle. + * + * @param { ToggleOptions } options - toggle options + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options: ToggleOptions): ToggleAttribute; +} + +/** + * Defines the toggle attribute functions + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the toggle attribute functions + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the toggle attribute functions + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the toggle attribute functions + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +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 + * @form + * @since 9 + */ + /** + * Called when the selected state of the component changes. + * + * @param { function } callback + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the selected state of the component changes. + * + * @param { function } callback + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onChange(callback: (isOn: boolean) => void): ToggleAttribute; + + /** + * Set the content modifier of toggle. + * + * @param { ContentModifier } modifier - The content modifier of toggle. + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): 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 + * @form + * @since 9 + */ + /** + * Called when the color of the selected button is set. + * + * @param { ResourceColor } value + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the color of the selected button is set. + * + * @param { ResourceColor } value + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + 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 + * @form + * @since 9 + */ + /** + * Called when the color of the selected button is set. + * + * @param { ResourceColor } color + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the color of the selected button is set. + * + * @param { ResourceColor } color + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + switchPointColor(color: ResourceColor): ToggleAttribute; + + /** + * Set the style of the switch. + * + * @param { SwitchStyle } value + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + switchStyle(value: SwitchStyle): ToggleAttribute; +} + +/** + * Defines Toggle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Toggle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Toggle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Toggle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Toggle: ToggleInterface; + +/** + * Defines Toggle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Toggle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Toggle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Toggle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ToggleInstance: ToggleAttribute; diff --git a/tests/arkts-sdk/ets/ui_extension_component.d.ts b/tests/arkts-sdk/ets/ui_extension_component.d.ts new file mode 100644 index 00000000..52906d1b --- /dev/null +++ b/tests/arkts-sdk/ets/ui_extension_component.d.ts @@ -0,0 +1,427 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Enumeration of different types of DpiFollowStrategy. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare enum DpiFollowStrategy { + /** + * Followed the host DPI. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + FOLLOW_HOST_DPI = 0, + + /** + * Followed the UIExtensionAbility. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + FOLLOW_UI_EXTENSION_ABILITY_DPI = 1, +} + +/** + * This interface is used to set the options for UIExtensionComponentAttribute during construction + * + * @interface UIExtensionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ +declare interface UIExtensionOptions { + /** + * Set whether the current capability is used as a Caller.
+ * If set to true, as a Caller, the current token of UIExtensionComponent is set to rootToken. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + isTransferringCaller?: boolean; + + /** + * Set placeholder. + * If set placeholder ComponentContent, show placeholder node when connection is not established. + * + * @type { ?ComponentContent } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + placeholder?: ComponentContent; + + /** + * Set Areachange placeholder. + * If the Areachange placeholder ComponentContent is set, the placeholder node is displayed until + * the UIExtensionComponent size change is complete. + * + * @type { ?Record } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + areaChangePlaceholder?: Record; + + /** + * Set UIExtensionComponent Content Dpi Follow Strategy. + * + * @type { ?DpiFollowStrategy } + * @default DpiFollowStrategy.FOLLOW_UI_EXTENSION_ABILITY_DPI + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + dpiFollowStrategy?: DpiFollowStrategy; +} + +/** + * Indicates the information when the provider of the embedded UI is terminated. + * + * @interface TerminationInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare interface TerminationInfo { + /** + * Defines the termination code. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + code: number; + + /** + * Defines the additional termination information. + * + * @type { ?import('../api/@ohos.app.ability.Want').default } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + want?: import('../api/@ohos.app.ability.Want').default; +} + +/** + * Get Callback from @ohos.base. + * + * @typedef { import('../api/@ohos.base').Callback> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ +declare type ReceiveCallback = import('../api/@ohos.base').Callback>; + +/** + * This interface is used for send data to the UIExtensionAbility.
+ * It is returned from onRemoteReady callback of UIExtensionComponent
+ * when UIExtensionAbility connects successfully + * + * @interface UIExtensionProxy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare interface UIExtensionProxy { + /** + * This function is for sending data to the UIExtensionAbility. + * + * @param { object } data + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + /** + * This function is for sending data to the UIExtensionAbility. + * + * @param { Record } data + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + send(data: Record): void; + + /** + * This function is for sending data to the UIExtensionAbility and waiting the result in blocking mode. + * + * @param { object } data - data send to the UIExtensionAbility + * @returns { object } data - data transferred from the UIExtensionAbility + * @throws { BusinessError } 100011 - No callback has been registered to response this request. + * @throws { BusinessError } 100012 - Transferring data failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + /** + * This function is for sending data to the UIExtensionAbility and waiting the result in blocking mode. + * + * @param { Record } data - Data send to the UIExtensionAbility. + * @returns { Record } data - Data transferred from the UIExtensionAbility. + * @throws { BusinessError } 100011 - No callback has been registered to response this request. + * @throws { BusinessError } 100012 - Transferring data failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + sendSync(data: Record): Record; + + /** + * Register the listener that watches for async data receiver callback being registered by UIExtensionAbility. + * + * @param { 'asyncReceiverRegister' } type - Indicates the type of event. + * @param { function } callback - callback of the listened event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + /** + * Register the listener that watches for async data receiver callback being registered by UIExtensionAbility. + * + * @param { 'asyncReceiverRegister' } type - Indicates the type of event. + * @param { Callback } callback - Callback of the listened event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + on(type: 'asyncReceiverRegister', callback: Callback): void; + + /** + * Register the listener that watches for sync data receiver callback being registered by UIExtensionAbility. + * + * @param { 'syncReceiverRegister' } type - Indicates the type of event. + * @param { function } callback - callback of the listened event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + /** + * Register the listener that watches for sync data receiver callback being registered by UIExtensionAbility. + * + * @param { 'syncReceiverRegister' } type - Indicates the type of event. + * @param { Callback } callback - Callback of the listened event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + on(type: 'syncReceiverRegister', callback: Callback): void; + + /** + * Deregisters the listener that watches for async data receiver callback being registered by UIExtensionAbility. + * + * @param { 'asyncReceiverRegister' } type - type of the listened event. + * @param { function } callback - callback of the listened event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + /** + * Deregisters the listener that watches for async data receiver callback being registered by UIExtensionAbility. + * + * @param { 'asyncReceiverRegister' } type - Type of the listened event. + * @param { Callback } [callback] - Callback of the listened event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + off(type: 'asyncReceiverRegister', callback?: Callback): void; + + /** + * Deregisters the listener that watches for sync data receiver callback being registered by UIExtensionAbility. + * + * @param { 'syncReceiverRegister' } type - type of the listened event. + * @param { function } callback - callback of the listened event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + /** + * Deregisters the listener that watches for sync data receiver callback being registered by UIExtensionAbility. + * + * @param { 'syncReceiverRegister' } type - Type of the listened event. + * @param { Callback } [callback] - Callback of the listened event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + off(type: 'syncReceiverRegister', callback?: Callback): void; +} + +/** + * Provide an interface for the UIExtensionComponent, which is used + *
to render UI of a remote UIExtensionAbility + * + * @interface UIExtensionComponentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +interface UIExtensionComponentInterface { + /** + * Construct the UIExtensionComponent.
+ * Called when the UIExtensionComponent is used. + * + * @param { import('../api/@ohos.app.ability.Want').default } want - indicates the want of UIExtensionAbility + * @returns { UIExtensionComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + /** + * Construct the UIExtensionComponent.
+ * Called when the UIExtensionComponent is used. + * + * @param { import('../api/@ohos.app.ability.Want').default } want - indicates the want of UIExtensionAbility + * @param { UIExtensionOptions } [options] - Construction configuration of UIExtensionComponentAttribute + * @returns { UIExtensionComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + ( + want: import('../api/@ohos.app.ability.Want').default, + options?: UIExtensionOptions + ): UIExtensionComponentAttribute; +} + +/** + * Define the attribute functions of UIExtensionComponent. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare class UIExtensionComponentAttribute extends CommonMethod { + /** + * @param { import('../api/@ohos.base').Callback } callback + * - callback called when remote UIExtensionAbility object is + *
ready for receive data + * @returns { UIExtensionComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + onRemoteReady( + callback: import('../api/@ohos.base').Callback + ): UIExtensionComponentAttribute; + + /** + * @param { import('../api/@ohos.base').Callback<{ [key: string]: Object }> } callback + * - called when data received from UIExtensionAbility + * @returns { UIExtensionComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + /** + * @param { ReceiveCallback } callback - Called when data received from UIExtensionAbility + * @returns { UIExtensionComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + onReceive(callback: ReceiveCallback): UIExtensionComponentAttribute; + + /** + * @param { import('../api/@ohos.base').Callback<{code: number;want?: import('../api/@ohos.app.ability.Want').default;}> } callback + * - called when the UIExtensionAbility is terminated with result data. + * @returns { UIExtensionComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + * @deprecated since 12 + * @useinstead UIExtensionComponentAttribute#onTerminated + */ + onResult( + callback: import('../api/@ohos.base').Callback<{ + code: number; + want?: import('../api/@ohos.app.ability.Want').default; + }> + ): UIExtensionComponentAttribute; + + /** + * @param { import('../api/@ohos.base').Callback } callback + * - number returned from callback function if disconnected from UIExtensionAbility, 0 means the + *
UIExtensionAbility is terminate by itself, otherwise the connect is broken abnormal. + * @returns { UIExtensionComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + * @deprecated since 12 + * @useinstead UIExtensionComponentAttribute#onTerminated or UIExtensionComponentAttribute#onError + */ + onRelease( + callback: import('../api/@ohos.base').Callback + ): UIExtensionComponentAttribute; + + /** + * @param { import('../api/@ohos.base').ErrorCallback } callback + * - called when some error occurred except disconnected from UIExtensionAbility. + * @returns { UIExtensionComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + onError( + callback: import('../api/@ohos.base').ErrorCallback + ): UIExtensionComponentAttribute; + + /** + * Called when the provider of the embedded UI is terminated. + * + * @param { Callback } callback + * @returns { UIExtensionComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + onTerminated(callback: Callback): UIExtensionComponentAttribute; +} + +/** + * Defines UIExtensionComponent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare const UIExtensionComponent: UIExtensionComponentInterface; + +/** + * Defines UIExtensionComponent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare const UIExtensionComponentInstance: UIExtensionComponentAttribute; diff --git a/tests/arkts-sdk/ets/units.d.ts b/tests/arkts-sdk/ets/units.d.ts new file mode 100644 index 00000000..02be5d05 --- /dev/null +++ b/tests/arkts-sdk/ets/units.d.ts @@ -0,0 +1,3492 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the data type of the interface restriction. + * + * @typedef { import('../api/global/resource').Resource } Resource + * @interface Resource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the data type of the interface restriction. + * + * @typedef { import('../api/global/resource').Resource } Resource + * @interface Resource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the data type of the interface restriction. + * + * @typedef { import('../api/global/resource').Resource } Resource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the data type of the interface restriction. + * + * @typedef { import('../api/global/resource').Resource } Resource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type Resource = import('../api/global/resource').Resource; + +/** + * Defines the length property with string, number and resource unit. + * + * @typedef { string | number | Resource } Length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the length property with string, number and resource unit. + * + * @typedef { string | number | Resource } Length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the length property with string, number and resource unit. + * + * @typedef { string | number | Resource } Length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the length property with string, number and resource unit. + * + * @typedef { string | number | Resource } Length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type Length = string | number | Resource; + +/** + * Defines the length property with number in units of px. + * + * @typedef { `${number}px` } PX + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the length property with number in units of px. + * + * @typedef { `${number}px` } PX + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type PX = `${number}px`; + +/** + * Defines the length property with number or number in units of vp. + * + * @typedef { `${number}vp` | number } VP + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the length property with number or number in units of vp. + * + * @typedef { `${number}vp` | number } VP + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type VP = `${number}vp` | number; + +/** + * Defines the length property with number in units of fp. + * + * @typedef { `${number}fp` } FP + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the length property with number in units of fp. + * + * @typedef { `${number}fp` } FP + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type FP = `${number}fp`; + +/** + * Defines the length property with number in units of lpx. + * + * @typedef { `${number}lpx` } LPX + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the length property with number in units of lpx. + * + * @typedef { `${number}lpx` } LPX + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type LPX = `${number}lpx`; + +/** + * Defines the length property with number in units of Percentage. + * + * @typedef { `${number}%` } Percentage + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the length property with number in units of Percentage. + * + * @typedef { `${number}%` } Percentage + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type Percentage = `${number}%`; + +/** + * Defines the angle property with number in units of deg. + * + * @typedef { `${number}deg` } Degree + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the angle property with number in units of deg. + * + * @typedef { `${number}deg` } Degree + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type Degree = `${number}deg`; + +/** + * Defines the dimension property with number with units(vp|px|fp|lpx|%), and resource. + * + * @typedef { PX | VP | FP | LPX | Percentage | Resource } Dimension + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the dimension property with number with units(vp|px|fp|lpx|%), and resource. + * + * @typedef { PX | VP | FP | LPX | Percentage | Resource } Dimension + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type Dimension = PX | VP | FP | LPX | Percentage | Resource; + +/** + * Defines the string which can use resource. + * + * @typedef { string | Resource } ResourceStr + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the string which can use resource. + * + * @typedef { string | Resource } ResourceStr + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the string which can use resource. + * + * @typedef { string | Resource } ResourceStr + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the string which can use resource. + * + * @typedef { string | Resource } ResourceStr + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type ResourceStr = string | Resource; + +/** + * Defines the padding property. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the padding property. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the padding property. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the padding property. + * + * @typedef { object } Padding + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type Padding = { + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + top?: Length; + + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + right?: Length; + + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottom?: Length; + + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + left?: Length; +}; + +/** + * Defines the localized padding property. + * + * @interface LocalizedPadding + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface LocalizedPadding { + /** + * top property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top?: LengthMetrics; + + /** + * end property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + end?: LengthMetrics; + + /** + * bottom property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom?: LengthMetrics; + + /** + * start property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + start?: LengthMetrics; +}; + +/** + * Defines the margin property. + * + * @typedef { Padding } Margin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the margin property. + * + * @typedef { Padding } Margin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the margin property. + * + * @typedef { Padding } Margin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the margin property. + * + * @typedef { Padding } Margin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type Margin = Padding; + +/** + * Defines the border width property. + * + * @typedef { EdgeWidths } EdgeWidth + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the border width property. + * + * @typedef { EdgeWidths } EdgeWidth + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type EdgeWidth = EdgeWidths; + +/** + * Defines the border width property. + * + * @typedef { object } EdgeWidths + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the border width property. + * + * @typedef { object } EdgeWidths + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the border width property. + * + * @typedef { object } EdgeWidths + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type EdgeWidths = { + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + top?: Length; + + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + right?: Length; + + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottom?: Length; + + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + left?: Length; +}; + +/** + * Defines the localized border width property. + * + * @interface LocalizedEdgeWidths + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface LocalizedEdgeWidths { + /** + * top property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top?: LengthMetrics; + + /** + * end property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + end?: LengthMetrics; + + /** + * bottom property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom?: LengthMetrics; + + /** + * start property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + start?: LengthMetrics; +}; + +/** + * Defines the outline width property. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the outline width property. + * + * @typedef { object } EdgeOutlineWidths + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type EdgeOutlineWidths = { + /** + * top outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * top outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top?: Dimension; + + /** + * right outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * right outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + right?: Dimension; + + /** + * bottom outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * bottom outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom?: Dimension; + + /** + * left outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * left outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + left?: Dimension; +}; + +/** + * Defines the border radius property. + * + * @typedef { object } BorderRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the border radius property. + * + * @typedef { object } BorderRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the border radius property. + * + * @typedef { object } BorderRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type BorderRadiuses = { + /** + * top-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + topLeft?: Length; + + /** + * top-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + topRight?: Length; + + /** + * bottom-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottomLeft?: Length; + + /** + * bottom-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottomRight?: Length; +}; + +/** + * Defines the localized border radius property. + * + * @interface LocalizedBorderRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface LocalizedBorderRadiuses { + /** + * top-start property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + topStart?: LengthMetrics; + + /** + * top-end property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + topEnd?: LengthMetrics; + + /** + * bottom-start property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottomStart?: LengthMetrics; + + /** + * bottom-end property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottomEnd?: LengthMetrics; +}; + +/** + * Defines the outline radius property. + * + * @typedef { object } OutlineRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the outline radius property. + * + * @typedef { object } OutlineRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type OutlineRadiuses = { + /** + * top-left property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * top-left property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + topLeft?: Dimension; + + /** + * top-right property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * top-right property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + topRight?: Dimension; + + /** + * bottom-left property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * bottom-left property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottomLeft?: Dimension; + + /** + * bottom-right property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * bottom-right property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottomRight?: Dimension; +}; + +/** + * Defines the border color property. + * + * @typedef { object } EdgeColors + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the border color property. + * + * @typedef { object } EdgeColors + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the border color property. + * + * @typedef { object } EdgeColors + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type EdgeColors = { + /** + * top property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + top?: ResourceColor; + + /** + * right property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * right property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * right property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + right?: ResourceColor; + + /** + * bottom property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottom?: ResourceColor; + + /** + * left property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * left property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * left property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + left?: ResourceColor; +}; + +/** + * Defines the localized border color property. + * + * @interface LocalizedEdgeColors + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface LocalizedEdgeColors { + /** + * top property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top?: ResourceColor; + + /** + * end property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + end?: ResourceColor; + + /** + * bottom property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom?: ResourceColor; + + /** + * start property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + start?: ResourceColor; +}; + +/** + * Defines the localized margin property. + * + * @typedef { LocalizedPadding } LocalizedMargin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 +*/ +declare type LocalizedMargin = LocalizedPadding; + +/** + * Defines the border style property. + * + * @typedef { object } EdgeStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the border style property. + * + * @typedef { object } EdgeStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the border style property. + * + * @typedef { object } EdgeStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type EdgeStyles = { + /** + * top property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + top?: BorderStyle; + + /** + * right property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * right property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * right property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + right?: BorderStyle; + + /** + * bottom property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottom?: BorderStyle; + + /** + * left property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * left property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * left property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + left?: BorderStyle; +}; + +/** + * Defines the outline style property. + * + * @typedef { object } EdgeOutlineStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the outline style property. + * + * @typedef { object } EdgeOutlineStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type EdgeOutlineStyles = { + /** + * top property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * top property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top?: OutlineStyle; + + /** + * right property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * right property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + right?: OutlineStyle; + + /** + * bottom property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * bottom property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom?: OutlineStyle; + + /** + * left property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * left property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + left?: OutlineStyle; +}; + +/** + * Defines the offset property. + * + * @typedef { object } Offset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the offset property. + * + * @typedef { object } Offset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the offset property. + * + * @typedef { object } Offset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type Offset = { + /** + * dx property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * dx property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * dx property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + dx: Length; + + /** + * dy property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * dy property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * dy property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + dy: Length; +}; + +/** + * Defines the color which can use resource. + * + * @typedef { Color | number | string | Resource } ResourceColor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the color which can use resource. + * + * @typedef { Color | number | string | Resource } ResourceColor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the color which can use resource. + * + * @typedef { Color | number | string | Resource } ResourceColor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the color which can use resource. + * + * @typedef { Color | number | string | Resource } ResourceColor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type ResourceColor = Color | number | string | Resource; + +/** + * Defines the length constrain property. + * + * @typedef { object } LengthConstrain + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the length constrain property. + * + * @typedef { object } LengthConstrain + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the length constrain property. + * + * @typedef { object } LengthConstrain + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type LengthConstrain = { + /** + * minimum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * minimum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * minimum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + minLength: Length; + + /** + * maximum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * maximum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * maximum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + maxLength: Length; +}; + +/** + * Defines VoidCallback. + * + * @typedef { function } VoidCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type VoidCallback = () => void; + +/** + * Defines length metrics unit. + * + * @typedef { import('../api/arkui/Graphics').LengthMetricsUnit } LengthMetricsUnit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type LengthMetricsUnit = import('../api/arkui/Graphics').LengthMetricsUnit; + +/** + * Defines LengthMetrics. + * + * @typedef { import('../api/arkui/Graphics').LengthMetrics } LengthMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type LengthMetrics = import('../api/arkui/Graphics').LengthMetrics; + +/** + * Defines ColorMetrics. + * + * @typedef { import('../api/arkui/Graphics').ColorMetrics } ColorMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ColorMetrics = import('../api/arkui/Graphics').ColorMetrics; + +/** + * Defines the font used for text. + * + * @interface Font + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the font used for text. + * + * @interface Font + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the font used for text. + * + * @interface Font + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface Font { + /** + * font size. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * font size. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * font size. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size?: Length; + + /** + * font weight. + * + * @type { ?(FontWeight | number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * font weight. + * + * @type { ?(FontWeight | number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * font weight. + * + * @type { ?(FontWeight | number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + weight?: FontWeight | number | string; + + /** + * font family. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * font family. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * font family. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + family?: string | Resource; + + /** + * font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style?: FontStyle; +} + +/** + * Defines the area property. + * + * @interface Area + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the area property. + * + * @interface Area + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the area property. + * + * @interface Area + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the area property. + * + * @interface Area + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface Area { + /** + * Defines the width property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the width property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the width property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the width property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width: Length; + + /** + * Defines the height property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the height property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the height property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the height property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height: Length; + + /** + * Defines the local position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the local position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the local position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the local position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + position: Position; + + /** + * Defines the global position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the global position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the global position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the global position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + globalPosition: Position; +} + +/** + * Defines the position. + * + * @interface Position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the position. + * + * @interface Position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the position. + * + * @interface Position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the position. + * + * @interface Position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface Position { + /** + * Coordinate x of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Coordinate x of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Coordinate x of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Coordinate x of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: Length; + + /** + * Coordinate y of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Coordinate y of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Coordinate y of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Coordinate y of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: Length; +} + +/** + * Defines the LocalizedPosition. + * + * @interface LocalizedPosition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LocalizedPosition { + /** + * Coordinate start of the Position. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start?: LengthMetrics; + + /** + * Coordinate top of the Position. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + top?: LengthMetrics; +} + +/** + * Defines the Edges. + * + * @interface Edges + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface Edges { + /** + * top property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top?: Dimension; + + /** + * left property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + left?: Dimension; + + /** + * bottom property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom?: Dimension; + + /** + * right property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + right?: Dimension; +} + +/** + * Defines the LocalizedEdges. + * + * @interface LocalizedEdges + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LocalizedEdges { + /** + * top property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + top?: LengthMetrics; + + /** + * start property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start?: LengthMetrics; + + /** + * bottom property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bottom?: LengthMetrics; + + /** + * end property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + end?: LengthMetrics; +} + +/** + * Defines the Bias. + * + * @interface Bias + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the Bias. + * + * @interface Bias + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface Bias { + /** + * Horizontal ratio of the Bias, it must be >= 0. + * + * @type { ?number } + * @default 0.5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Horizontal ratio of the Bias, it must be >= 0. + * + * @type { ?number } + * @default 0.5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + horizontal?: number; + + /** + * Vertical ratio of the Bias, it must be >= 0. + * + * @type { ?number } + * @default 0.5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Vertical ratio of the Bias, it must be >= 0. + * + * @type { ?number } + * @default 0.5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + vertical?: number; +} + +/** + * Defines the constrain size options. + * + * @interface ConstraintSizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the constrain size options. + * + * @interface ConstraintSizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the constrain size options. + * + * @interface ConstraintSizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the constrain size options. + * + * @interface ConstraintSizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ConstraintSizeOptions { + /** + * Defines the min width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the min width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the min width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the min width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + minWidth?: Length; + + /** + * Defines the max width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the max width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the max width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the max width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + maxWidth?: Length; + + /** + * Defines the min height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the min height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the min height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the min height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + minHeight?: Length; + + /** + * Defines the max height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the max height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the max height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the max height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + maxHeight?: Length; +} + +/** + * Defines the size options. + * + * @interface SizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the size options. + * + * @interface SizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the size options. + * + * @interface SizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the size options. + * + * @interface SizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface SizeOptions { + /** + * Defines the width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: Length; + + /** + * Defines the height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: Length; +} + +/** + * Defines the options of border. + * + * @interface BorderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of border. + * + * @interface BorderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of border. + * + * @interface BorderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of border. + * + * @interface BorderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +/** + * Defines the options of border. + * + * @interface BorderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface BorderOptions { + /** + * Defines the border width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the border width. + * + * @type { ?(EdgeWidths | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the border width. + * + * @type { ?(EdgeWidths | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the border width. + * + * @type { ?(EdgeWidths | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Defines the border width. + * + * @type { ?(EdgeWidths | Length | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + width?: EdgeWidths | Length | LocalizedEdgeWidths; + + /** + * Defines the border color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the border color. + * + * @type { ?(EdgeColors | ResourceColor) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the border color. + * + * @type { ?(EdgeColors | ResourceColor) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the border color. + * + * @type { ?(EdgeColors | ResourceColor) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Defines the border color. + * + * @type { ?(EdgeColors | ResourceColor | LocalizedEdgeColors) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + color?: EdgeColors | ResourceColor | LocalizedEdgeColors; + + /** + * Defines the border radius. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the border radius. + * + * @type { ?(BorderRadiuses | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the border radius. + * + * @type { ?(BorderRadiuses | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the border radius. + * + * @type { ?(BorderRadiuses | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Defines the border radius. + * + * @type { ?(BorderRadiuses | Length | LocalizedBorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + radius?: BorderRadiuses | Length | LocalizedBorderRadiuses; + + /** + * Defines the border style. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the border style. + * + * @type { ?(EdgeStyles | BorderStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the border style. + * + * @type { ?(EdgeStyles | BorderStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the border style. + * + * @type { ?(EdgeStyles | BorderStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + style?: EdgeStyles | BorderStyle; + + /** + * Defines the gap of dash when BorderStyle is dashed. + * + * @type { ?(EdgeWidths | LengthMetrics | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dashGap?: EdgeWidths | LengthMetrics | LocalizedEdgeWidths; + + /** + * Defines the length of dash when BorderStyle is dashed. + * + * @type { ?(EdgeWidths | LengthMetrics | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dashWidth?: EdgeWidths | LengthMetrics | LocalizedEdgeWidths; +} + +/** + * Defines the options of border. + * + * @interface OutlineOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the options of border. + * + * @interface OutlineOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface OutlineOptions { + /** + * Defines the outline width. + * + * @type { ?(EdgeOutlineWidths | Dimension) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the outline width. + * + * @type { ?(EdgeOutlineWidths | Dimension) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + width?: EdgeOutlineWidths | Dimension; + + /** + * Defines the outline color. + * + * @type { ?(EdgeColors | ResourceColor) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the outline color. + * + * @type { ?(EdgeColors | ResourceColor | LocalizedEdgeColors) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + color?: EdgeColors | ResourceColor | LocalizedEdgeColors; + + /** + * Defines the outline radius. + * + * @type { ?(OutlineRadiuses | Dimension) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the outline radius. + * + * @type { ?(OutlineRadiuses | Dimension) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + radius?: OutlineRadiuses | Dimension; + + /** + * Defines the outline style. + * + * @type { ?(EdgeOutlineStyles | OutlineStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the outline style. + * + * @type { ?(EdgeOutlineStyles | OutlineStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + style?: EdgeOutlineStyles | OutlineStyle; +} + +/** + * Define the style of checkbox mark. + * + * @interface MarkStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define the style of checkbox mark. + * + * @interface MarkStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MarkStyle { + /** + * Define the stroke color of checkbox mark. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the stroke color of checkbox mark. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeColor?: ResourceColor; + + /** + * Define the size of checkbox mark. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the size of checkbox mark. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size?: Length; + + /** + * Define the stroke width of checkbox mark. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the stroke width of checkbox mark. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeWidth?: Length; +} + +/** + * Defines the ColorFilter object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the ColorFilter object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the ColorFilter object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ColorFilter { + /** + * Creates ColorFilter with 4*5 matrix. + * + * @param { number[] } value 4*5 color matrix values. The value[m*n] is located in the m row and n column. The matrix is row-first. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Creates ColorFilter with 4*5 matrix. + * + * @param { number[] } value 4*5 color matrix values. The value[m*n] is located in the m row and n column. The matrix is row-first. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates ColorFilter with 4*5 matrix. + * + * @param { number[] } value 4*5 color matrix values. The value[m*n] is located in the m row and n column. The matrix is row-first. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(value: number[]); +} + +/** + * Defines TouchPoint + * + * @interface TouchPoint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Defines TouchPoint + * + * @interface TouchPoint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface TouchPoint { + /** + * Define the touch point x coordinate. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Define the touch point x coordinate. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + x: Dimension; + + /** + * Define the touch point y coordinate. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Define the touch point y coordinate. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + y: Dimension; +} + +/** + * Defines the DirectionalEdgesT interface. + * + * @interface DirectionalEdgesT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface DirectionalEdgesT { + /** + * Start property. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + start: T; + + /** + * End property. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + end: T; + + /** + * Top property. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top: T; + + /** + * Bottom property. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom: T; +} + +/** + * Defines the struct of DividerStyleOptions. + * + * @interface DividerStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DividerStyleOptions { + /** + * The strokeWidth of Divider. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + strokeWidth?: LengthMetrics; + + /** + * The color of Divider. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * The startMargin of Divider. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + startMargin?: LengthMetrics; + + /** + * The endMargin of Divider. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + endMargin?: LengthMetrics; +} + +/** + * Defines the ChainWeightOptions interface. + * + * @interface ChainWeightOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface ChainWeightOptions { + /** + * Horizontal ChainWeight. + * + * @type { ?(number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + horizontal?: number; + + /** + * Vertical ChainWeight. + * + * @type { ?(number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + vertical?: number; +} + +/** + * Defines the struct of AccessibilityOptions. + * + * @interface AccessibilityOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface AccessibilityOptions { + /** + * accessibilityPreferred - Should accessibilityText be prioritized when contatenating child component strings. + * + * @type { ?(boolean) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityPreferred?: boolean; +} diff --git a/tests/arkts-sdk/ets/video.d.ts b/tests/arkts-sdk/ets/video.d.ts new file mode 100644 index 00000000..f38f9c45 --- /dev/null +++ b/tests/arkts-sdk/ets/video.d.ts @@ -0,0 +1,1389 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Seek mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Seek mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Seek mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SeekMode { + /** + * Sync to keyframes before the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sync to keyframes before the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sync to keyframes before the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + PreviousKeyframe, + + /** + * Sync to keyframes after the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sync to keyframes after the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sync to keyframes after the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NextKeyframe, + + /** + * Sync to closest keyframes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sync to closest keyframes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sync to closest keyframes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ClosestKeyframe, + + /** + * Seek to frames closest the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Seek to frames closest the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Seek to frames closest the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Accurate, +} + +/** + * playback speed. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * playback speed. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * playback speed. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum PlaybackSpeed { + /** + * 0.75x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * 0.75x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 0.75x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Speed_Forward_0_75_X, + + /** + * 1.00x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * 1.00x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 1.00x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Speed_Forward_1_00_X, + + /** + * 1.25x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * 1.25x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 1.25x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Speed_Forward_1_25_X, + + /** + * 1.75x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * 1.75x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 1.75x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Speed_Forward_1_75_X, + + /** + * 2.00x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * 2.00x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 2.00x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Speed_Forward_2_00_X, +} + +/** + * Fullscreen information of the video. + * + * @typedef FullscreenInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface FullscreenInfo { + /** + * The flag whether play in full screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The flag whether play in full screen. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fullscreen: boolean; +} + +/** + * Prepared information of the video. + * + * @typedef PreparedInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface PreparedInfo { + /** + * The duration of the current video, in seconds. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The duration of the current video, in seconds. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + duration: number; +} + +/** + * Playback information of the video. + * + * @typedef PlaybackInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface PlaybackInfo { + /** + * The current video playback progress, expressed in seconds. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The current video playback progress, expressed in seconds. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + time: number; +} + +/** + * Defines the video options. + * + * @interface VideoOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the video options. + * + * @interface VideoOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the video options. + * + * @interface VideoOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Defines the video options. + * + * @interface VideoOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface VideoOptions { + /** + * src of video. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * src of video. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * src of video. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + src?: string | Resource; + + /** + * playback rate of video. + * + * @type { ?(number | string | PlaybackSpeed) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * playback rate of video. + * + * @type { ?(number | string | PlaybackSpeed) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * playback rate of video. + * + * @type { ?(number | string | PlaybackSpeed) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + currentProgressRate?: number | string | PlaybackSpeed; + + /** + * preview uri of video. + * + * @type { ?(string | PixelMap | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * preview uri of video. + * + * @type { ?(string | PixelMap | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * preview uri of video. + * + * @type { ?(string | PixelMap | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + previewUri?: string | PixelMap | Resource; + + /** + * controller of video. + * + * @type { ?VideoController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * controller of video. + * + * @type { ?VideoController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * controller of video. + * + * @type { ?VideoController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + controller?: VideoController; + + /** + * image ai options of video. + * + * @type { ?ImageAIOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + imageAIOptions?: ImageAIOptions; +} + +/** + * Defines the video controller. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the video controller. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the video controller. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class VideoController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Provides events to play. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Provides events to play. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provides events to play. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + start(); + + /** + * Provides a pause event for playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Provides a pause event for playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provides a pause event for playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pause(); + + /** + * Provides an event to stop playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Provides an event to stop playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provides an event to stop playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stop(); + + /** + * Provide the progress method of video playback. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Provide the progress method of video playback. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provide the progress method of video playback. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setCurrentTime(value: number); + + /** + * Provides a full screen playback method. + * + * @param { boolean } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Provides a full screen playback method. + * + * @param { boolean } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provides a full screen playback method. + * + * @param { boolean } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + requestFullscreen(value: boolean); + + /** + * Provides a method to exit full screen playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Provides a method to exit full screen playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provides a method to exit full screen playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + exitFullscreen(); + + /** + * Provide the progress method of video playback. + * + * @param { number } value + * @param { SeekMode } seekMode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Provide the progress method of video playback. + * + * @param { number } value + * @param { SeekMode } seekMode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provide the progress method of video playback. + * + * @param { number } value + * @param { SeekMode } seekMode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setCurrentTime(value: number, seekMode: SeekMode); + + /** + * Provide the reset method of video playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + reset(): void; +} + +/** + * Defines the video interface. + * + * @interface VideoInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the video interface. + * + * @interface VideoInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the video interface. + * + * @interface VideoInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface VideoInterface { + /** + * Set the value. + * + * @param { VideoOptions } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * + * @param { VideoOptions } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * + * @param { VideoOptions } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value: VideoOptions): VideoAttribute; +} + +/** + * Defines the video attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the video attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the video attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class VideoAttribute extends CommonMethod { + /** + * Called when judging whether the video is muted. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when judging whether the video is muted. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether the video is muted. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + muted(value: boolean): VideoAttribute; + + /** + * Called when judging whether the video is played automatically. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when judging whether the video is played automatically. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether the video is played automatically. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + autoPlay(value: boolean): VideoAttribute; + + /** + * Called when judging whether the control bar is displayed. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when judging whether the control bar is displayed. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether the control bar is displayed. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + controls(value: boolean): VideoAttribute; + + /** + * Called when judging whether the video is played circular. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 6 + */ + /** + * Called when judging whether the video is played circular. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether the video is played circular. + * + * @param { boolean } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + loop(value: boolean): VideoAttribute; + + /** + * Called when determining the zoom type of the video source. + * + * @param { ImageFit } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when determining the zoom type of the video source. + * + * @param { ImageFit } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when determining the zoom type of the video source. + * + * @param { ImageFit } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + objectFit(value: ImageFit): VideoAttribute; + + /** + * Called when the video is played. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the video is played. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the video is played. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the video is played. + * + * @param { VoidCallback } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onStart(event: VoidCallback): VideoAttribute; + + /** + * Called when the video is paused. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the video is paused. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the video is paused. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the video is paused. + * + * @param { VoidCallback } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPause(event: VoidCallback): VideoAttribute; + + /** + * Called when the video playback ends. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the video playback ends. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the video playback ends. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the video playback ends. + * + * @param { VoidCallback } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onFinish(event: VoidCallback): VideoAttribute; + + /** + * Called when the video enters and exits the full screen. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the video enters and exits the full screen. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the video enters and exits the full screen. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the video enters and exits the full screen. + * + * @param { Callback } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onFullscreenChange(callback: Callback): VideoAttribute; + + /** + * Called when the video preparation is complete. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the video preparation is complete. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the video preparation is complete. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the video preparation is complete. + * + * @param { Callback } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPrepared(callback: Callback): VideoAttribute; + + /** + * Called when the time information is reported when the progress bar process is operated. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the time information is reported when the progress bar process is operated. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the time information is reported when the progress bar process is operated. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the time information is reported when the progress bar process is operated. + * + * @param { Callback } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSeeking(callback: Callback): VideoAttribute; + + /** + * Called when the playback time information is reported after the operation progress bar is completed. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the playback time information is reported after the operation progress bar is completed. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the playback time information is reported after the operation progress bar is completed. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the playback time information is reported after the operation progress bar is completed. + * + * @param { Callback } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSeeked(callback: Callback): VideoAttribute; + + /** + * Called when the playback progress changes. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the playback progress changes. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the playback progress changes. + * + * @param { function } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the playback progress changes. + * + * @param { Callback } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onUpdate(callback: Callback): VideoAttribute; + + /** + * Called when playback fails. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when playback fails. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when playback fails. + * + * @param { function } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onError(event: () => void): VideoAttribute; + + /** + * Called when the video is stopped. + * + * @param { Callback } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onStop(event: Callback): VideoAttribute; + + /** + * Enable image analyzer. + * + * @param { boolean } enable + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableAnalyzer(enable: boolean): VideoAttribute; + + /** + * Set image analyzer with config. + * + * @param { ImageAnalyzerConfig } config + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + analyzerConfig(config: ImageAnalyzerConfig): VideoAttribute; +} + +/** + * Defines Video Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Video Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Video Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Video: VideoInterface; + +/** + * Defines Video Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Video Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Video Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const VideoInstance: VideoAttribute; diff --git a/tests/arkts-sdk/ets/water_flow.d.ts b/tests/arkts-sdk/ets/water_flow.d.ts new file mode 100644 index 00000000..50ae3086 --- /dev/null +++ b/tests/arkts-sdk/ets/water_flow.d.ts @@ -0,0 +1,809 @@ +/* + * Copyright (c) 2022-2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * function that returns item main size by index. + * + * @typedef { function } GetItemMainSizeByIndex + * @param { number } index - the index of FlowItem + * @returns { number } main size of the FlowItem at index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type GetItemMainSizeByIndex = (index: number) => number; + +/** + * Defines the water flow section options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 +*/ +declare class SectionOptions { + /** + * The number of FlowItems in this section. + * + * @type { number } itemsCount - the number of FlowItems in this section + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + itemsCount: number; + + /** + * The columns of this section in vertical layout, or rows in horizontal layout. + * + * @type { ?number } crossCount - cross count of this section + * @default 1 one column in vertical layout, or one row in horizontal layout + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + crossCount?: number; + + /** + * Asks the developer for the main size in vp of the flow item with the specified index. + * The water flow layout uses the size measured after the flow item is created if not set. + * + * @type { ?GetItemMainSizeByIndex } onGetItemMainSizeByIndex - function that returns item main size by index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onGetItemMainSizeByIndex?: GetItemMainSizeByIndex; + + /** + * Set the spacing between columns of this section. + * + * @type { ?Dimension } columnsGap - column gap of this section + * same with columnsGap of WaterFlow if not set + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + columnsGap?: Dimension; + + /** + * Set the spacing between rows of this section. + * + * @type { ?Dimension } rowsGap - row gap of this section + * same with rowsGap of WaterFlow if not set + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + rowsGap?: Dimension; + + /** + * Outer margin of this section. + * + * @type { ?(Margin | Dimension) } margin - outer margin of this section + * @default {top: 0, right: 0, bottom: 0, left: 0} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + margin?: Margin | Dimension; +} + +/** + * Indicates the sections of WaterFlow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class WaterFlowSections { + /** + * Creates an instance of WaterFlowSections. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(); + + /** + * Changes sections in the WaterFlow by removing or replacing existing elements and/or adding new elements in place. + * + * @param { number } start - Zero-based index at which to start changing the sections. + * @param { number } [deleteCount] - Indicating the number of sections in the WaterFlow to remove from start. + * @param { Array } [sections] - The new sections to add to the WaterFlow, beginning from start. + * @returns { boolean } Whether the splice was successful. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + splice(start: number, deleteCount?: number, sections?: Array): boolean; + + /** + * Pushes a new section to the end of WaterFlow. + * + * @param { SectionOptions } section - new section options. + * @returns { boolean } Whether the push was successful. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + push(section: SectionOptions): boolean; + + /** + * Updates section at specified section index. + * + * @param { number } sectionIndex - index of section to be updated. + * @param { SectionOptions } section - new section options. + * @returns { boolean } Whether the update was successful. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + update(sectionIndex:number, section: SectionOptions): boolean; + + /** + * Obtains all the section options in the WaterFlow. + * + * @returns { Array } Returns all the section options in the WaterFlow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + values(): Array; + + /** + * Obtains the section counts in the WaterFlow. + * + * @returns { number } Returns section counts in the WaterFlow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + length(): number; +} + +/** + * Declare layout modes of WaterFlow. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum WaterFlowLayoutMode { + /** + * Top-down Layout mode. Positions of new items depend on items above. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ALWAYS_TOP_DOWN = 0, + + /** + * Sliding window mode. Only maintains layout information of items currently in viewport. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SLIDING_WINDOW = 1, +} + +/** + * Defines the water flow options. + * + * @interface WaterFlowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the water flow options. + * + * @interface WaterFlowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the water flow options. + * + * @interface WaterFlowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface WaterFlowOptions { + /** + * Describes the water flow footer. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Describes the water flow footer. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Describes the water flow footer. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + footer?: CustomBuilder; + + /** + * Describes the water flow scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Describes the water flow scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Describes the water flow scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scroller?: Scroller; + + /** + * Describes the sections with different cross count that compose the water flow. + * + * @type { ?WaterFlowSections } sections - sections with different cross count + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + sections?: WaterFlowSections; + + /** + * Describes the layout mode. + * + * @type { ?WaterFlowLayoutMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + layoutMode?: WaterFlowLayoutMode; +} + +/** + * Defines the water flow interface. + * + * @interface WaterFlowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the water flow interface. + * + * @interface WaterFlowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the water flow interface. + * + * @interface WaterFlowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface WaterFlowInterface { + /** + * WaterFlow is returned when the parameter is transferred. Only support api: scrollToIndex + * + * @param { WaterFlowOptions } options + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * WaterFlow is returned when the parameter is transferred. Only support api: scrollToIndex + * + * @param { WaterFlowOptions } options + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * WaterFlow is returned when the parameter is transferred. Only support api: scrollToIndex + * + * @param { WaterFlowOptions } options + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (options?: WaterFlowOptions): WaterFlowAttribute; +} + +/** + * Defines the water flow attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the water flow attribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the water flow attribute. + * + * @extends ScrollableCommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class WaterFlowAttribute extends ScrollableCommonMethod { + /** + * This parameter specifies the number of columns in the current waterflow. + * + * @param { string } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * This parameter specifies the number of columns in the current waterflow. + * + * @param { string } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This parameter specifies the number of columns in the current waterflow. + * + * @param { string } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + columnsTemplate(value: string): WaterFlowAttribute; + + /** + * This parameter specifies the min or max size of each item. + * + * @param { ConstraintSizeOptions } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * This parameter specifies the min or max size of each item. + * + * @param { ConstraintSizeOptions } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This parameter specifies the min or max size of each item. + * + * @param { ConstraintSizeOptions } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + itemConstraintSize(value: ConstraintSizeOptions): WaterFlowAttribute; + + /** + * Set the number of rows in the current waterflow. + * + * @param { string } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set the number of rows in the current waterflow. + * + * @param { string } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the number of rows in the current waterflow. + * + * @param { string } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + rowsTemplate(value: string): WaterFlowAttribute; + + /** + * Set the spacing between columns. + * + * @param { Length } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set the spacing between columns. + * + * @param { Length } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the spacing between columns. + * + * @param { Length } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + columnsGap(value: Length): WaterFlowAttribute; + + /** + * Set the spacing between rows. + * + * @param { Length } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set the spacing between rows. + * + * @param { Length } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the spacing between rows. + * + * @param { Length } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + rowsGap(value: Length): WaterFlowAttribute; + + /** + * Control layout direction of the WaterFlow. + * + * @param { FlexDirection } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Control layout direction of the WaterFlow. + * + * @param { FlexDirection } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Control layout direction of the WaterFlow. + * + * @param { FlexDirection } value + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + layoutDirection(value: FlexDirection): WaterFlowAttribute; + + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { WaterFlowAttribute } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { WaterFlowAttribute } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: NestedScrollOptions): WaterFlowAttribute; + + /** + * Called when setting whether to enable scroll by gesture or mouse. + * @param { boolean } value + * @returns { WaterFlowAttribute } The attribute of the waterflow + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when setting whether to enable scroll by gesture or mouse. + * @param { boolean } value + * @returns { WaterFlowAttribute } The attribute of the waterflow + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableScrollInteraction(value: boolean): WaterFlowAttribute; + + /** + * Called to setting the friction. + * @param { number | Resource } value - options for scrolling friction. + * @returns { WaterFlowAttribute } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called to setting the friction. + * @param { number | Resource } value - options for scrolling friction. + * @returns { WaterFlowAttribute } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + friction(value: number | Resource): WaterFlowAttribute; + + /** + * Called to set number of flow items to be preloaded (cached) in LazyForEach. + * @param { number } value - number of flow items to be preloaded (cached). + * @returns { WaterFlowAttribute } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called to set number of flow items to be preloaded (cached) in LazyForEach. + * @param { number } value - number of flow items to be preloaded (cached). + * @returns { WaterFlowAttribute } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cachedCount(value: number): WaterFlowAttribute; + + /** + * Called to set number of flow items to be preloaded (cached) in LazyForEach / Repeat. + * @param { number } count - number of flow items to be preloaded (cached). + * @param { boolean } show - if true, cached items are displayed when clip is disabled. + * @returns { WaterFlowAttribute } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + cachedCount(count: number, show: boolean): WaterFlowAttribute; + + /** + * Called when the water flow begins to arrive. + * + * @param { function } event + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the water flow begins to arrive. + * + * @param { function } event + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the water flow begins to arrive. + * + * @param { function } event + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReachStart(event: () => void): WaterFlowAttribute; + + /** + * Called when the water flow reaches the end. + * + * @param { function } event + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the water flow reaches the end. + * + * @param { function } event + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the water flow reaches the end. + * + * @param { function } event + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReachEnd(event: () => void): WaterFlowAttribute; + + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { WaterFlowAttribute } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { WaterFlowAttribute } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollFrameBegin(event: (offset: number, state: ScrollState) => { offsetRemain: number }): WaterFlowAttribute; + + /** + * Called when the first or last item displayed in the waterflow changes. + * + * @param { function } event - Callback function, triggered when the first or last item + * displayed in the waterflow changes. + * "first": the index of the first item displayed in the waterflow, + * "last": the index of the last item displayed in the waterflow. + * @returns { WaterFlowAttribute } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollIndex(event: (first: number, last: number) => void): WaterFlowAttribute; +} + +/** + * Defines WaterFlow Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines WaterFlow Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines WaterFlow Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const WaterFlow: WaterFlowInterface; + +/** + * Defines WaterFlow Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines WaterFlow Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines WaterFlow Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const WaterFlowInstance: WaterFlowAttribute; diff --git a/tests/arkts-sdk/ets/web.d.ts b/tests/arkts-sdk/ets/web.d.ts new file mode 100644 index 00000000..010fc901 --- /dev/null +++ b/tests/arkts-sdk/ets/web.d.ts @@ -0,0 +1,42 @@ +declare class WebResourceResponse { + setResponseData(data: string | number | Resource | ArrayBuffer): void; +} + +declare interface OnHttpErrorReceiveEvent { + response: WebResourceResponse; +} + +declare interface NativeEmbedInfo { + params?: Map; +} + +declare interface NativeEmbedDataInfo { + info?: NativeEmbedInfo; +} + +interface WebInterface { + (): WebAttribute; +} + +declare enum RenderExitReason { + ProcessAbnormalTermination, + ProcessWasKilled, + ProcessCrashed, + ProcessOom, + ProcessExitUnknown, +} + +declare interface OnRenderExitedEvent { + renderExitReason: RenderExitReason; +} + +declare class WebAttribute extends CommonMethod { + onNativeEmbedLifecycleChange(callback: (event: NativeEmbedDataInfo) => void): WebAttribute; + onRenderExited(callback: Callback): WebAttribute; + /* @deprecated */ + onRenderExited(callback: (event?: { detail: object }) => boolean): WebAttribute; + onHttpErrorReceive(callback: Callback): WebAttribute; +} + +declare const Web: WebInterface; +declare const WebInstance: WebAttribute; \ No newline at end of file diff --git a/tests/arkts-sdk/ets/window_scene.d.ts b/tests/arkts-sdk/ets/window_scene.d.ts new file mode 100644 index 00000000..2505dfdb --- /dev/null +++ b/tests/arkts-sdk/ets/window_scene.d.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the interface of WindowScene. + * + * @interface WindowSceneInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +interface WindowSceneInterface { + /** + * Called when the WindowScene is used. + * + * @param { number } persistentId - indicates the persistent identifier of WindowScene. + * @returns { WindowSceneAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + (persistentId: number): WindowSceneAttribute; +} + +/** + * Defines the attribute functions of WindowScene. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare class WindowSceneAttribute extends CommonMethod { + /** + * Set the attraction deformation effect of WindowScene. + * The window produces nonlinear deformation effect under the action of attraction point. + * + * @param { Position } destination - The position of the attraction target point in the component coordinate system. + * @param { number } fraction - The fraction of attraction deformation. The range of value is [0, 1]. + *
0 means not attracted to the target point, 1 means attracted to the target point completely. + * @returns { WindowSceneAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + attractionEffect(destination: Position, fraction: number): WindowSceneAttribute; +} + +/** + * Defines the WindowScene component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare const WindowScene: WindowSceneInterface; + +/** + * Defines the WindowScene instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare const WindowSceneInstance: WindowSceneAttribute; diff --git a/tests/arkts-sdk/ets/with_theme.d.ts b/tests/arkts-sdk/ets/with_theme.d.ts new file mode 100644 index 00000000..2de31a46 --- /dev/null +++ b/tests/arkts-sdk/ets/with_theme.d.ts @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file Defines WithTheme component. + * @kit ArkUI + */ + + +/** + * CustomTheme. + * + * @typedef {import('../api/@ohos.arkui.theme').CustomTheme} CustomTheme + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type CustomTheme = import('../api/@ohos.arkui.theme').CustomTheme; + +/** + * Defines the struct of WithThemeOptions. + * + * @interface WithThemeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface WithThemeOptions { + /** + * Custom Theme. + * + * @type { ?CustomTheme } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + theme?: CustomTheme; + + /** + * Theme Color Mode. + * + * @type { ?ThemeColorMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + colorMode?: ThemeColorMode; +} + +/** +* Define the function of WithThemeInterface. +* +* @typedef { function } WithThemeInterface +* @param { WithThemeOptions } options +* @returns { WithThemeAttribute } withThemeAttribute object +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 12 +*/ +declare type WithThemeInterface = (options: WithThemeOptions) => WithThemeAttribute; + +/** +* Defines the WithTheme attribute functions.. +* +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 12 +*/ +declare class WithThemeAttribute { +} + +/** +* Defines WithTheme Logic Component. +* +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 12 +*/ +declare const WithTheme: WithThemeInterface; + +/** +* Defines WithTheme Logic Component Instance. +* +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 12 +*/ +declare const WithThemeInstance: WithThemeAttribute; \ No newline at end of file diff --git a/tests/arkts-sdk/ets/xcomponent.d.ts b/tests/arkts-sdk/ets/xcomponent.d.ts new file mode 100644 index 00000000..e21bfa39 --- /dev/null +++ b/tests/arkts-sdk/ets/xcomponent.d.ts @@ -0,0 +1,510 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Surface Rectangle information. + * + * @interface SurfaceRect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface SurfaceRect { + /** + * The horizontal offset of the surface relative to XComponent. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + offsetX?: number; + + /** + * The vertical offset of the surface relative to XComponent. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + offsetY?: number; + + /** + * The width of the surface created by XComponent + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + surfaceWidth: number; + + /** + * The height of the surface created by XComponent + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + surfaceHeight: number; +} + +/** + * Surface rotation options. + * + * @interface SurfaceRotationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface SurfaceRotationOptions { + /** + * Lock property of the surface rotation. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + lock?: boolean; +} + +/** + * Defines XComponentController + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines XComponentController + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class XComponentController { + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(); + + /** + * Get the id of surface created by XComponent. + * + * @returns { string } The id of surface created by XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Get the id of surface created by XComponent. + * + * @returns { string } The id of surface created by XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getXComponentSurfaceId(): string; + + /** + * Get the context of native XComponent. + * + * @returns { Object } The context of native XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Get the context of native XComponent. + * + * @returns { Object } The context of native XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getXComponentContext(): Object; + + /** + * Set the surface size created by XComponent. + * + * @param { object } value - surface size + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @deprecated since 12 + * @useinstead setXComponentSurfaceRect + */ + setXComponentSurfaceSize(value: { + surfaceWidth: number; + surfaceHeight: number; + }): void; + + /** + * Set the rectangle information of surface created by XComponent. + * + * @param { SurfaceRect } rect - The surface rectangle information. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + setXComponentSurfaceRect(rect: SurfaceRect): void; + + /** + * Get the rectangle information of Surface created by XComponent. + * + * @returns { SurfaceRect } The surface rectangle information. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + getXComponentSurfaceRect(): SurfaceRect; + + /** + * Set the rotation options of the Surface created by XComponent. + * + * @param { SurfaceRotationOptions } rotationOptions - The surface rotation options. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + setXComponentSurfaceRotation(rotationOptions: SurfaceRotationOptions): void; + + /** + * Get the rotation options result of the Surface created by XComponent. + * + * @returns { Required } The surface rotation options result. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + getXComponentSurfaceRotation(): Required; + + /** + * Called after the surface is first created. + * + * @param { string } surfaceId - The id of the surface created by XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + onSurfaceCreated(surfaceId: string): void; + + /** + * Called after the surface rectangle information is changed. + * + * @param { string } surfaceId - The id of the surface created by XComponent. + * @param { SurfaceRect } rect - The rectangle information of the surface created by XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + onSurfaceChanged(surfaceId: string, rect: SurfaceRect): void; + + /** + * Called when the surface is about to be destroyed. + * + * @param { string } surfaceId - The id of the surface created by XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + onSurfaceDestroyed(surfaceId: string): void; + + /** + * Start image analyzer. + * + * @param { ImageAnalyzerConfig } config - Image analyzer config. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 110001 - Image analysis feature is unsupported. + * @throws { BusinessError } 110002 - Image analysis is currently being executed. + * @throws { BusinessError } 110003 - Image analysis is stopped. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + startImageAnalyzer(config: ImageAnalyzerConfig): Promise; + + /** + * Stop image analyzer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + stopImageAnalyzer(): void; +} + +/** + * Defines the xcomponent options. + * + * @interface XComponentOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface XComponentOptions { + /** + * The type of xcomponent + * + * @type { XComponentType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + type: XComponentType; + + /** + * The controller of xcomponent. + * + * @type { XComponentController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + controller: XComponentController; + + /** + * Image ai options. + * + * @type { ?ImageAIOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + imageAIOptions?: ImageAIOptions; +} + +/** + * Defines XComponent. + * + * @interface XComponentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines XComponent. + * + * @interface XComponentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface XComponentInterface { + /** + * Constructor parameters + * + * @param { object } value - Indicates the options of the xcomponent. + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 12 + */ + (value: { id: string; type: string; libraryname?: string; controller?: XComponentController }): XComponentAttribute; + + /** + * Constructor parameters + * + * @param { object } value - Indicates the options of the xcomponent. + * @returns { XComponentAttribute } The attribute of the xcomponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Constructor parameters + * + * @param { object } value - Indicates the options of the xcomponent. + * @returns { XComponentAttribute } The attribute of the xcomponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (value: { id: string; type: XComponentType; libraryname?: string; controller?: XComponentController }): XComponentAttribute; + + /** + * Constructor parameters + * + * @param { XComponentOptions } options - Indicates the options of the xcomponent. + * @returns { XComponentAttribute } The attribute of the xcomponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + (options: XComponentOptions): XComponentAttribute; +} + +/** + * Callback invoked when XComponent onload. + * + * @typedef { function } OnNativeLoadCallback + * @param { object } [event] - Get the context of the XCompoonent instance object, + * and the methods mounted on the context are defined by the developer in the C++layer. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnNativeLoadCallback = (event?: object) => void + +/** + * Defines XComponentAttribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines XComponentAttribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class XComponentAttribute extends CommonMethod { + /** + * Called when judging whether the xcomponent surface is created. + * + * @param { function } [callback] - Called when judging whether the xcomponent surface is created. + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when judging whether the xcomponent surface is created. + * + * @param { function } [callback] - Called when judging whether the xcomponent surface is created. + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Called when judging whether the xcomponent surface is created. + * + * @param { OnNativeLoadCallback } callback - Called when judging whether the xcomponent surface is created. + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onLoad(callback: OnNativeLoadCallback): XComponentAttribute; + + /** + * Called when judging whether the xcomponent is destroyed. + * + * @param { function } event - Called when judging whether the xcomponent is destroyed. + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when judging whether the xcomponent is destroyed. + * + * @param { function } event - Called when judging whether the xcomponent is destroyed. + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Called when judging whether the xcomponent is destroyed. + * + * @param { VoidCallback } event - Called when judging whether the xcomponent is destroyed. + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onDestroy(event: VoidCallback): XComponentAttribute; + + /** + * Enable image analyzer for XComponent. + * + * @param { boolean } enable + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableAnalyzer(enable: boolean): XComponentAttribute; + + /** + * Enable privacy protection for XComponent. + * + * @param { boolean } isSecure + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + enableSecure(isSecure: boolean): XComponentAttribute; +} + +/** + * Defines XComponent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines XComponent Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const XComponent: XComponentInterface; + +/** + * Defines XComponent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines XComponent Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const XComponentInstance: XComponentAttribute; diff --git a/tests/arkts-sdk/resource/resource.d.ts b/tests/arkts-sdk/resource/resource.d.ts new file mode 100644 index 00000000..e7e6c7cf --- /dev/null +++ b/tests/arkts-sdk/resource/resource.d.ts @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * @file + * @kit LocalizationKit + */ + +/** + * Contains resource descriptor information. + * + * @interface Resource + * @syscap SystemCapability.Global.ResourceManager + * @since 9 + */ +/** + * Contains resource descriptor information. + * + * @interface Resource + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 11 + */ +export interface Resource { + /** + * bundle name in hap + * + * @type { string } + * @syscap SystemCapability.Global.ResourceManager + * @since 9 + */ + /** + * bundle name in hap + * + * @type { string } + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 11 + */ + bundleName: string; + + /** + * module name in hap + * + * @type { string } + * @syscap SystemCapability.Global.ResourceManager + * @since 9 + */ + /** + * module name in hap + * + * @type { string } + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 11 + */ + moduleName: string; + + /** + * resource id in hap + * + * @type { number } + * @syscap SystemCapability.Global.ResourceManager + * @since 9 + */ + /** + * resource id in hap + * + * @type { number } + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 11 + */ + id: number; + + /** + * Set params. + * + * @type { ?any[] } + * @syscap SystemCapability.Global.ResourceManager + * @since 7 + */ + /** + * Set params. + * + * @type { ?any[] } + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 11 + */ + params?: any[]; + + /** + * Set type. + * + * @type { ?number } + * @syscap SystemCapability.Global.ResourceManager + * @since 7 + */ + /** + * Set type. + * + * @type { ?number } + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 11 + */ + type?: number; +} \ No newline at end of file diff --git a/tests/arkts-subset/ets/alert_dialog.d.ts b/tests/arkts-subset/ets/alert_dialog.d.ts new file mode 100644 index 00000000..e53813bc --- /dev/null +++ b/tests/arkts-subset/ets/alert_dialog.d.ts @@ -0,0 +1,1329 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * The alignment of dialog, + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The alignment of dialog, + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The alignment of dialog, + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum DialogAlignment { + /** + * Vertical top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Vertical top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Top, + + /** + * Align vertically to the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Align vertically to the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align vertically to the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Center, + + /** + * Vertical bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Vertical bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * Default alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Default alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Default, + + /** + * Align the upper left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Align the upper left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the upper left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TopStart, + + /** + * Align the upper right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Align the upper right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the upper right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TopEnd, + + /** + * Left center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Left center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Left center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CenterStart, + + /** + * Right center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Right center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Right center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CenterEnd, + + /** + * Align the lower left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Align the lower left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the lower left corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BottomStart, + + /** + * Align the lower right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Align the lower right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the lower right corner. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BottomEnd, +} + +/** +* The arrangement of buttons in dialog. +* +* @enum { number } +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @since 10 +*/ +/** +* The arrangement of buttons in dialog. +* +* @enum { number } +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 11 +*/ +declare enum DialogButtonDirection { + /** + * Two or fewer buttons are arranged horizontally, + * and two or more buttons are arranged vertically. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Two or fewer buttons are arranged horizontally, + * and two or more buttons are arranged vertically. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + AUTO = 0, + + /** + * Buttons are arranged horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Buttons are arranged horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + HORIZONTAL = 1, + + /** + * Buttons are arranged vertically. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Buttons are arranged vertically. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + VERTICAL = 2, +} + +/** + * Base button param. + * + * @interface AlertDialogButtonBaseOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare interface AlertDialogButtonBaseOptions { + /** + * Enable switch of button. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Enable switch of button. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enabled?: boolean; + + /** + * Default focus switch of button. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default focus switch of button. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + defaultFocus?: boolean; + + /** + * Style of button. + * + * @type { ?DialogButtonStyle } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Style of button. + * + * @type { ?DialogButtonStyle } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style?: DialogButtonStyle; + + /** + * Text content of button. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text content of button. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: ResourceStr; + + /** + * Text color of button. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text color of button. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor?: ResourceColor; + + /** + * Background color of button. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Background color of button. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundColor?: ResourceColor; + + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Method executed by the callback. + * + * @type { VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + action: VoidCallback; +} + +/** + * Base button param used for AlertDialogParamWithOptions. + * + * @interface AlertDialogButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Base button param used for AlertDialogParamWithOptions. + * + * @interface AlertDialogButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Button param used for AlertDialogParamWithOptions. + * + * @interface AlertDialogButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare interface AlertDialogButtonOptions extends AlertDialogButtonBaseOptions { + /** + * Define whether the button responds to Enter/Space key by default. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + primary?: boolean; +} + +/** + * Defines TextStyle in the AlertDialog. + * + * @interface TextStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextStyle { + /** + * Set the word break type. + * + * @type { ?WordBreak } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + wordBreak?: WordBreak; +} + +/** + * Base param used for AlertDialog.show method. + * + * @interface AlertDialogParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Base param used for AlertDialog.show method. + * + * @interface AlertDialogParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Base param used for AlertDialog.show method. + * + * @interface AlertDialogParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface AlertDialogParam { + /** + * Title Properties + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Title Properties + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Title Properties + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + title?: ResourceStr; + + /** + * Subtitle Properties + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Subtitle Properties + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + subtitle?: ResourceStr; + + /** + * message Properties + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * message Properties + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * message Properties + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + message: ResourceStr; + + /** + * Allows users to click the mask layer to exit. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Allows users to click the mask layer to exit. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Allows users to click the mask layer to exit. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + autoCancel?: boolean; + + /** + * Execute Cancel Function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Execute Cancel Function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Execute Cancel Function. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Execute Cancel Function. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + cancel?: VoidCallback; + + /** + * Alignment in the vertical direction. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Alignment in the vertical direction. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Alignment in the vertical direction. + * + * @type { ?DialogAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + alignment?: DialogAlignment; + + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?Offset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Offset; + + /** + * Grid count of dialog. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Grid count of dialog. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Grid count of dialog. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + gridCount?: number; + + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mask Region of dialog. The size cannot exceed the main window. + * + * @type { ?Rectangle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maskRect?: Rectangle; + + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showInSubWindow?: boolean; + + /** + * Whether it is a modal dialog + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether it is a modal dialog + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isModal?: boolean; + + /** + * Defines the alertDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the alertDialog's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Defines the alertDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the alertDialog's background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Callback function when the dialog interactive dismiss + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: Callback; + + /** + * Transition parameters of opening/closing AlertDialog. + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Defines the alertDialog's corner radius. + * + * @type { ?(Dimension | BorderRadiuses | LocalizedBorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cornerRadius?: Dimension | BorderRadiuses | LocalizedBorderRadiuses; + + /** + * Defines the alertDialog's width. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width?: Dimension; + + /** + * Defines the alertDialog's height. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + height?: Dimension; + + /** + * Defines the alertDialog's border width. + * + * @type { ?(Dimension | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderWidth?: Dimension | EdgeWidths | LocalizedEdgeWidths; + + /** + * Defines the alertDialog's border color. + * + * @type { ?(ResourceColor | EdgeColors | LocalizedEdgeColors) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderColor?: ResourceColor | EdgeColors | LocalizedEdgeColors; + + /** + * Defines the alertDialog's border style. + * + * @type { ?(BorderStyle | EdgeStyles) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderStyle?: BorderStyle | EdgeStyles; + + /** + * Defines the alertDialog's shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Set the alertDialog's textStyle. + * + * @type { ?TextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textStyle?: TextStyle; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the alertDialog's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; +} + +/** + * Defines the AlertDialog with confirm button. + * + * @interface AlertDialogParamWithConfirm + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the AlertDialog with confirm button. + * + * @interface AlertDialogParamWithConfirm + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the AlertDialog with confirm button. + * + * @interface AlertDialogParamWithConfirm + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface AlertDialogParamWithConfirm extends AlertDialogParam { + /** + * Invoke the commit function. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Invoke the commit function. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoke the commit function. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Invoke the commit function. + * + * @type { ?AlertDialogButtonBaseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + confirm?: AlertDialogButtonBaseOptions; +} + +/** + * Component dialog dismiss action. + * + * @interface DismissDialogAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DismissDialogAction { + /** + * Defines dialog dismiss function. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: Callback; + + /** + * Dismiss reason type. + * + * @type { DismissReason } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reason: DismissReason; +} + +/** + * Defines the dialog param with buttons. + * + * @interface AlertDialogParamWithButtons + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the dialog param with buttons. + * + * @interface AlertDialogParamWithButtons + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the dialog param with buttons. + * + * @interface AlertDialogParamWithButtons + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface AlertDialogParamWithButtons extends AlertDialogParam { + /** + * First button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * First button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * First button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * First button. + * + * @type { AlertDialogButtonBaseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + primaryButton: AlertDialogButtonBaseOptions; + + /** + * Second button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Second button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Second button. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Second button. + * + * @type { AlertDialogButtonBaseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + secondaryButton: AlertDialogButtonBaseOptions; +} + +/** + * Defines the dialog param with options. + * + * @interface AlertDialogParamWithOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the dialog param with options. + * + * @interface AlertDialogParamWithOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface AlertDialogParamWithOptions extends AlertDialogParam { + /** + * The array of buttons. + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The array of buttons. + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + buttons: Array; + + /** + * The arrangement of buttons. + * @type { ?DialogButtonDirection } + * @default DialogButtonDirection.AUTO + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The arrangement of buttons. + * @type { ?DialogButtonDirection } + * @default DialogButtonDirection.AUTO + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + buttonDirection?: DialogButtonDirection; +} + +/** + * Defines AlertDialog which uses show method to show alert dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines AlertDialog which uses show method to show alert dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines AlertDialog which uses show method to show alert dialog. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class AlertDialog { + /** + * Invoking method display. + * + * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Invoking method display. + * + * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions} value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoking method display. + * + * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions} value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + static show(value: AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions); +} + diff --git a/tests/arkts-subset/ets/blank.d.ts b/tests/arkts-subset/ets/blank.d.ts index f40e0ad6..9f718272 100644 --- a/tests/arkts-subset/ets/blank.d.ts +++ b/tests/arkts-subset/ets/blank.d.ts @@ -30,8 +30,8 @@ * * @interface BlankInterface * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 * @form + * @since 9 */ /** * Create Blank. @@ -39,8 +39,8 @@ * @interface BlankInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform - * @since 10 * @form + * @since 10 */ /** * Create Blank. @@ -48,9 +48,9 @@ * @interface BlankInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @form * @atomicservice * @since 11 - * @form */ interface BlankInterface { /** @@ -67,8 +67,8 @@ interface BlankInterface { * @param { number | string } min * @returns { BlankAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 * @form + * @since 9 */ /** * The minimum size of the blank fill assembly on the container spindle. @@ -77,8 +77,8 @@ interface BlankInterface { * @returns { BlankAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform - * @since 10 * @form + * @since 10 */ /** * The minimum size of the blank fill assembly on the container spindle. @@ -87,9 +87,9 @@ interface BlankInterface { * @returns { BlankAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @form * @atomicservice * @since 11 - * @form */ (min?: number | string): BlankAttribute; } @@ -106,8 +106,8 @@ interface BlankInterface { * * @extends CommonMethod * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 * @form + * @since 9 */ /** * Inheritance CommonMethod Set Styles @@ -115,8 +115,8 @@ interface BlankInterface { * @extends CommonMethod * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform - * @since 10 * @form + * @since 10 */ /** * Inheritance CommonMethod Set Styles @@ -124,9 +124,9 @@ interface BlankInterface { * @extends CommonMethod * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @form * @atomicservice * @since 11 - * @form */ declare class BlankAttribute extends CommonMethod { /** @@ -143,8 +143,8 @@ declare class BlankAttribute extends CommonMethod { * @param { ResourceColor } value * @returns { BlankAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 * @form + * @since 9 */ /** * color: set color. @@ -153,8 +153,8 @@ declare class BlankAttribute extends CommonMethod { * @returns { BlankAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform - * @since 10 * @form + * @since 10 */ /** * color: set color. @@ -163,9 +163,9 @@ declare class BlankAttribute extends CommonMethod { * @returns { BlankAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @form * @atomicservice * @since 11 - * @form */ color(value: ResourceColor): BlankAttribute; } @@ -180,25 +180,25 @@ declare class BlankAttribute extends CommonMethod { * Defines Blank Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 * @form + * @since 9 */ /** * Defines Blank Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform - * @since 10 * @form + * @since 10 */ /** * Defines Blank Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @form * @atomicservice * @since 11 - * @form */ declare const Blank: BlankInterface; @@ -212,24 +212,24 @@ declare const Blank: BlankInterface; * Defines Blank Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 * @form + * @since 9 */ /** * Defines Blank Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform - * @since 10 * @form + * @since 10 */ /** * Defines Blank Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @form * @atomicservice * @since 11 - * @form */ declare const BlankInstance: BlankAttribute; diff --git a/tests/arkts-subset/ets/button.d.ts b/tests/arkts-subset/ets/button.d.ts index 3b4bc173..024103f1 100644 --- a/tests/arkts-subset/ets/button.d.ts +++ b/tests/arkts-subset/ets/button.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 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 @@ -13,45 +13,1307 @@ * limitations under the License. */ +/** + * @file + * @kit ArkUI + */ + +/** + * Provides a button component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides a button component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides a button component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides a button component. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare enum ButtonType { + /** + * Capsule button (rounded corners default to half the height). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Capsule button (rounded corners default to half the height). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Capsule button (rounded corners default to half the height). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Capsule button (rounded corners default to half the height). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Capsule, - Capsule, - Circle, + /** + * Round buttons. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Round buttons. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Round buttons. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Round buttons. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Circle, + + /** + * Common button (no rounded corners by default). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Common button (no rounded corners by default). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Common button (no rounded corners by default). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Common button (no rounded corners by default). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Normal, + + /** + * Rounded rectangle button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + ROUNDED_RECTANGLE = 3, } -declare interface LabelStyle { +/** + * Enum for button style type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Enum for button style type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum ButtonStyleMode { + /** + * Normal button (with normal background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Normal button (with normal background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NORMAL = 0, + + /** + * Emphasized button (with emphasized background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Emphasized button (with emphasized background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + EMPHASIZED = 1, + + /** + * Textual button (with none background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Textual button (with none background color). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + TEXTUAL = 2, +} + +/** + * Enum for button role. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum ButtonRole { + /** + * Normal button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NORMAL = 0, + + /** + * Error button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + ERROR = 1, +} + +/** + * Defines the callback type used in ButtonConfiguration. + * + * @typedef {function} ButtonTriggerClickCallback + * @param { number } xPos - The value of xPos is x coordinate. + * @param { number } yPos - The value of yPos is y coordinate. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ButtonTriggerClickCallback = (xPos: number, yPos: number) => void; + +/** + * ButtonConfiguration used by button content modifier. + * + * @interface ButtonConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + +declare interface ButtonConfiguration extends CommonConfiguration { + /** + * Button with inner text label. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + label: string; + + /** + * Indicates whether the button is pressed. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pressed: boolean; - overflow?: TextOverflow; - maxLines?: number; - minFontSize?: number | ResourceStr; - maxFontSize?: number | ResourceStr; - heightAdaptivePolicy?: TextHeightAdaptivePolicy; - font?: Font; + /** + * Trigger button click x coordinate and y coordinate. + * + * @type { ButtonTriggerClickCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + triggerClick: ButtonTriggerClickCallback; +} + +/** + * Enum for Control Size. + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Enum for Control Size. + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum ControlSize { + /** + * The component size is small. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * The component size is small. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SMALL = 'small', - // error TS2551: Property 'dayFontSize' does not exist on type 'LabelStyle'. - // Did you mean 'maxFontSize'? - // dayFontSize?: number; + /** + * The component size is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * The component size is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NORMAL = 'normal', } +/** + * Defines the button options. + * + * @interface ButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the button options. + * + * @interface ButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the button options. + * + * @interface ButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the button options. + * + * @interface ButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare interface ButtonOptions { + /** + * Describes the button style. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Describes the button style. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Describes the button style. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Describes the button style. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + 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. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stateEffect?: boolean; + + /** + * Describes the button style. + * + * @type { ?ButtonStyleMode } + * @default ButtonStyleMode.EMPHASIZED + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Describes the button style. + * + * @type { ?ButtonStyleMode } + * @default ButtonStyleMode.EMPHASIZED + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + buttonStyle?: ButtonStyleMode; - type?: ButtonType; + /** + * Describes the button size. + * + * @type { ?ControlSize } + * @default ControlSize.NORMAL + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Describes the button size. + * + * @type { ?ControlSize } + * @default ControlSize.NORMAL + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + controlSize?: ControlSize; + + /** + * Describes the button role. + * + * @type { ?ButtonRole } + * @default ButtonRole.NORMAL + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + role?: ButtonRole; } +/** + * Defines the Button Component. + * + * @interface ButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Button Component. + * + * @interface ButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Button Component. + * + * @interface ButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Button Component. + * + * @interface ButtonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ interface ButtonInterface { + /** + * Button object + * + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Button object + * + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Button object + * + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Button object + * + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (): ButtonAttribute; + + /** + * Create Button with Text child. + * + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Create Button with Text child. + * + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create Button with Text child. + * + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create Button with Text child. + * + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (options: ButtonOptions): ButtonAttribute; - (): ButtonAttribute; + /** + * Create Button with inner text label. + * + * @param { ResourceStr } label + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Create Button with inner text label. + * + * @param { ResourceStr } label + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Create Button with inner text label. + * + * @param { ResourceStr } label + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Create Button with inner text label. + * + * @param { ResourceStr } label + * @param { ButtonOptions } options + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (label: ResourceStr, options?: ButtonOptions): ButtonAttribute; } -declare class ButtonAttribute extends CommonMethod { - type(value: ButtonType): ButtonAttribute; +/** + * LabelStyle object. + * + * @interface LabelStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * LabelStyle object. + * + * @interface LabelStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface LabelStyle { + /** + * overflow mode. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * overflow mode. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + overflow?: TextOverflow; + + /** + * Label max lines. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Label max lines. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxLines?: number; + + /** + * Min font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Min font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + minFontSize?: number | ResourceStr; - // fontColor(value: ResourceColor): ButtonAttribute; + /** + * Max font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Max font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxFontSize?: number | ResourceStr; - labelStyle(value: LabelStyle): ButtonAttribute; + /** + * Adapt text height option. + * + * @type { ?TextHeightAdaptivePolicy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Adapt text height option. + * + * @type { ?TextHeightAdaptivePolicy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + heightAdaptivePolicy?: TextHeightAdaptivePolicy; + + /** + * Font style. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Font style. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font?: Font; } +/** + * Defines the button attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the button attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the button attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the button attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ButtonAttribute extends CommonMethod { + /** + * Describes the button style. + * + * @param { ButtonType } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Describes the button style. + * + * @param { ButtonType } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Describes the button style. + * + * @param { ButtonType } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Describes the button style. + * + * @param { ButtonType } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + type(value: ButtonType): ButtonAttribute; + + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @param { boolean } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @param { boolean } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @param { boolean } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * + * @param { boolean } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stateEffect(value: boolean): ButtonAttribute; + /** + * Describes the button style. + * + * @param { ButtonStyleMode } value - button style mode + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Describes the button style. + * + * @param { ButtonStyleMode } value - button style mode + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + buttonStyle(value: ButtonStyleMode): ButtonAttribute; + + /** + * Set the Button size. + * + * @param { ControlSize } value - control size + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Set the Button size. + * + * @param { ControlSize } value - control size + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + controlSize(value: ControlSize): ButtonAttribute; + + /** + * Set the Button role. + * + * @param { ButtonRole } value - button role + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + role(value: ButtonRole): ButtonAttribute; + + /** + * Text color. + * + * @param { ResourceColor } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text color. + * + * @param { ResourceColor } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text color. + * + * @param { ResourceColor } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text color. + * + * @param { ResourceColor } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): ButtonAttribute; + + /** + * Text size. + * + * @param { Length } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text size. + * + * @param { Length } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text size. + * + * @param { Length } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text size. + * + * @param { Length } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontSize(value: Length): ButtonAttribute; + + /** + * Font weight. + * + * @param { number | FontWeight | string } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Font weight. + * + * @param { number | FontWeight | string } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Font weight. + * + * @param { number | FontWeight | string } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Font weight. + * + * @param { number | FontWeight | string } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): ButtonAttribute; + + /** + * Font style. + * + * @param { FontStyle } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Font style. + * + * @param { FontStyle } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Font style. + * + * @param { FontStyle } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Font style. + * + * @param { FontStyle } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): ButtonAttribute; + + /** + * Font family. + * + * @param { string | Resource } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Font family. + * + * @param { string | Resource } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Font family. + * + * @param { string | Resource } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Font family. + * + * @param { string | Resource } value + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontFamily(value: string | Resource): ButtonAttribute; + + /** + * Set the content modifier of button. + * + * @param { ContentModifier } modifier - The content modifier of button. + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier(modifier: ContentModifier): ButtonAttribute; + + /** + * Set button label style. + * + * @param { LabelStyle } value - The label style configuration on button. + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set button label style. + * + * @param { LabelStyle } value - The label style configuration on button. + * @returns { ButtonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + labelStyle(value: LabelStyle): ButtonAttribute; +} + +/** + * Defines Button Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Button Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Button Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Button Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare const Button: ButtonInterface; +/** + * Defines Button Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Button Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Button Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Button Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare const ButtonInstance: ButtonAttribute; diff --git a/tests/arkts-subset/ets/calendar_picker.d.ts b/tests/arkts-subset/ets/calendar_picker.d.ts deleted file mode 100644 index 5744287f..00000000 --- a/tests/arkts-subset/ets/calendar_picker.d.ts +++ /dev/null @@ -1,18 +0,0 @@ - -declare enum CalendarAlign { - START = 0, - CENTER = 1, - END = 2 -} - -declare interface CalendarPickerInterface { - (): CalendarPickerAttribute -} - -declare class CalendarPickerAttribute extends CommonMethod { - edgeAlign(alignType: CalendarAlign, offset?: Offset): CalendarPickerAttribute; - - altEdgeAlign(alignType: CalendarAlign, offset?: AltOffset): CalendarPickerAttribute; -} - -declare const CalendarPicker: CalendarPickerInterface \ No newline at end of file diff --git a/tests/arkts-subset/ets/canvas.d.ts b/tests/arkts-subset/ets/canvas.d.ts deleted file mode 100644 index 991319cc..00000000 --- a/tests/arkts-subset/ets/canvas.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2024 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 type CanvasFillRule = "evenodd" | "nonzero"; - -declare class ImageData { - - readonly data: Uint8ClampedArray; - - readonly height: number; - - readonly width: number; - - constructor(width: number, height: number, data?: Uint8ClampedArray); - - constructor(width: number, height: number, data?: Uint8ClampedArray, unit?: LengthMetricsUnit); -} - -declare interface CanvasPattern { - - setTransform(transform?: Matrix2D): void; -} - -// interface ImageBitmap { - -// readonly height: number; - -// readonly width: number; - -// close(): void; -// } - - -declare class CanvasPath { - - rect(x: number, y: number, w: number, h: number): void; - - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; - - closePath(): void; -} - -declare class CanvasGradient { - - addColorStop(offset: number, color: string): void; -} - -declare class CanvasRenderer extends CanvasPath { - - globalAlpha: number; - - globalCompositeOperation: string; - - fillStyle: string | number | CanvasGradient | CanvasPattern; - - // drawImage(image: ImageBitmap | PixelMap, dx: number, dy: number): void; - - beginPath(): void; - - clip(fillRule?: CanvasFillRule): void; - - reset(): void; - - putImageData(imagedata: ImageData, dx: number | string, dy: number | string): void; - - putImageData( - imagedata: ImageData, - dx: number | string, - dy: number | string, - dirtyX: number | string, - dirtyY: number | string, - dirtyWidth: number | string, - dirtyHeight: number | string - ): void; - -} - -declare class RenderingContextSettings { - - antialias?: boolean; - - constructor(antialias?: boolean); -} - -declare class CanvasRenderingContext2D extends CanvasRenderer { - - readonly height: number; - - readonly width: number; - - stopImageAnalyzer(): void; - - constructor(settings?: RenderingContextSettings); - - static of(): CanvasRenderingContext2D -} - -declare interface DrawingCanvas {} -declare interface Size { - width: number; - height: number; -} -declare class ImageBitmap { - constructor(src: string); - constructor(src: string, unit: LengthMetricsUnit); - constructor(data: PixelMap); - constructor(data: PixelMap, unit: LengthMetricsUnit); - close(): void; -} - -declare class DrawingRenderingContext { - - get size(): Size; - - get canvas(): DrawingCanvas; - - invalidate(): void; - - constructor(unit?: LengthMetricsUnit); -} - -interface CanvasInterface { - - (context?: CanvasRenderingContext2D | DrawingRenderingContext): CanvasAttribute; -} - -declare class CanvasAttribute extends CommonMethod { - - onReady(event: () => void): CanvasAttribute; - - enableAnalyzer(enable: boolean): CanvasAttribute; -} - -declare const Canvas: CanvasInterface; - -declare const CanvasInstance: CanvasAttribute; - - diff --git a/tests/arkts-subset/ets/circle.d.ts b/tests/arkts-subset/ets/circle.d.ts new file mode 100644 index 00000000..6c7a34bd --- /dev/null +++ b/tests/arkts-subset/ets/circle.d.ts @@ -0,0 +1,343 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines circle options for Circle component. + * + * @interface CircleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines circle options for Circle component. + * + * @interface CircleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines circle options for Circle component. + * + * @interface CircleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines circle options for Circle component. + * + * @interface CircleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface CircleOptions { + /** + * Defines the width property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the width property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the width property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the width property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: string | number; + + /** + * Defines the height property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the height property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the height property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the height property. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: string | number; +} + +/** + * Defines circle component. + * + * @interface CircleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines circle component. + * + * @interface CircleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines circle component. + * + * @interface CircleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines circle component. + * + * @interface CircleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface CircleInterface { + /** + * use new function to set the value. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * use new function to set the value. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * use new function to set the value. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * use new function to set the value. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + new (value?: CircleOptions): CircleAttribute; + + /** + * Set the value.. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value.. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the value.. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the value.. + * + * @param { CircleOptions } value + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (value?: CircleOptions): CircleAttribute; +} + +/** + * Circle drawing component attribute functions. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Circle drawing component attribute functions. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Circle drawing component attribute functions. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Circle drawing component attribute functions. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CircleAttribute extends CommonShapeMethod {} + +/** + * Defines Circle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Circle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Circle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Circle Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Circle: CircleInterface; + +/** + * Defines Circle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Circle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Circle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Circle Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const CircleInstance: CircleAttribute; diff --git a/tests/arkts-subset/ets/column.d.ts b/tests/arkts-subset/ets/column.d.ts index 1f1b5096..647effd7 100644 --- a/tests/arkts-subset/ets/column.d.ts +++ b/tests/arkts-subset/ets/column.d.ts @@ -1,30 +1,364 @@ -declare enum HorizontalAlign { - Start, - Center, - End, -} +/* + * 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 interface ColumnInterface { - (): ColumnAttribute -} +/** + * @file + * @kit ArkUI + */ -declare class ColumnAttribute extends CommonMethod { +/** + * Column constructor options. + * + * @interface ColumnOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +interface ColumnOptions { + /** + * Vertical layout element spacing + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + space?: string | number; +} - alignItems(value: HorizontalAlign): ColumnAttribute; +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ColumnInterface { + /** + * Set the value. + * useAlign:Use a custom alignment. + * space: Vertical layout element spacing. + * + * @param { object } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * useAlign:Use a custom alignment. + * space: Vertical layout element spacing. + * + * @param { object } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the value. + * useAlign:Use a custom alignment. + * space: Vertical layout element spacing. + * + * @param { object } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the value. + * useAlign:Use a custom alignment. + * space: Vertical layout element spacing. + * + * @param { object } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Set the options. + * + * @param { ColumnOptions } [options] - column options + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options?: ColumnOptions): ColumnAttribute; } -declare const Column: ColumnInterface +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ColumnAttribute extends CommonMethod { + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignItems(value: HorizontalAlign): ColumnAttribute; -declare enum LayoutSafeAreaType { - SYSTEM = 0, + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + justifyContent(value: FlexAlign): ColumnAttribute; + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { ColumnAttribute } The attribute of the column. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): ColumnAttribute; + /** + * Called when the Main-Axis's direction is set reversed or not + * + * @param { Optional } isReversed - If the main axis is reversed. + * @returns { ColumnAttribute } The attribute of the column. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + reverse(isReversed: Optional): ColumnAttribute; } -declare enum LayoutSafeAreaEdge { - TOP = 0, - BOTTOM = 1, -} +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Column: ColumnInterface; -declare enum TitleHeight { - MainOnly, - MainWithSub, -} +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ColumnInstance: ColumnAttribute; diff --git a/tests/arkts-subset/ets/common.d.ts b/tests/arkts-subset/ets/common.d.ts index 9ac59683..8c2f5f59 100644 --- a/tests/arkts-subset/ets/common.d.ts +++ b/tests/arkts-subset/ets/common.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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 @@ -13,544 +13,24529 @@ * limitations under the License. */ -declare type PixelMap = import('../resource/image').default.PixelMap; +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the options of Component ClassDecorator. + * + * @interface ComponentOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the options of Component ClassDecorator. + * + * @interface ComponentOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface ComponentOptions { + /** + * freeze UI state. + * + * @type { boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * freeze UI state. + * + * @type { boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + freezeWhenInactive : boolean, +} + +/** + * Define the ratio of characters entered by the the percentage of InputCounterOptions. + * + * @interface InputCounterOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Define the ratio of characters entered by the the percentage of InputCounterOptions. + * + * @interface InputCounterOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface InputCounterOptions { + /** + * It is the numerator bit of the percentage and used as a threshold. If the number of characters input + * reaches the maximum number of characters multiplied by this threshold, the counter is displayed. + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * It is the numerator bit of the percentage and used as a threshold. If the number of characters input + * reaches the maximum number of characters multiplied by this threshold, the counter is displayed. + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + thresholdPercentage?: number; + + /** + * If the current input character count reaches the maximum character count and users want to exceed the + * normal input, the border will turn red. If this parameter is true, the red border displayed. + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * If the current input character count reaches the maximum character count and users want to exceed the + * normal input, the border will turn red. If this parameter is true, the red border displayed. + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + highlightBorder?: boolean; +} + +/** + * Defines the options of decoration. + * + * @interface TextDecorationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextDecorationOptions { + /** + * The decoration type. + * + * @type { TextDecorationType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: TextDecorationType; + + /** + * Sets the color of decoration. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * The style value of decoration. + * + * @type { ?TextDecorationStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: TextDecorationStyle; +} + +/** + * Defining Component ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Component ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Component ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Component ClassDecorator + * + * Component is a ClassDecorator and it supports ComponentOptions as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Component: ClassDecorator & ((options: ComponentOptions) => ClassDecorator); + +/** + * Defining ComponentV2 ClassDecorator + * + * ComponentV2 is a ClassDecorator and it supports ComponentOptions as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const ComponentV2: ClassDecorator & ((options: ComponentOptions) => ClassDecorator); + +/** + * Defines the options of Entry ClassDecorator. + * + * @interface EntryOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ +/** + * Defines the options of Entry ClassDecorator. + * + * @interface EntryOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ +declare interface EntryOptions { + /** + * Named route name. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * Named route name. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + routeName? : string, + + /** + * LocalStorage to be passed. + * + * @type { ?LocalStorage } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * LocalStorage to be passed. + * + * @type { ?LocalStorage } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + storage? : LocalStorage, + + /** + * Determines whether to use the LocalStorage instance object returned by the LocalStorage.getShared() interface. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + useSharedStorage? : boolean, +} + +/** + * Defines Entry ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Entry ClassDecorator. + * + * Entry is a ClassDecorator and it supports LocalStorage as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Entry ClassDecorator. + * + * Entry is a ClassDecorator and it supports LocalStorage or EntryOptions as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Entry ClassDecorator. + * + * Entry is a ClassDecorator and it supports LocalStorage or EntryOptions as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Entry: ClassDecorator & ((options?: LocalStorage | EntryOptions) => ClassDecorator); + +/** + * Defining Observed ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Observed ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Observed ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Observed ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Observed: ClassDecorator; + +/** + * Defining ObservedV2 ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const ObservedV2: ClassDecorator; + +/** + * Defining Preview ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Preview ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Preview ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Preview ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Preview: ClassDecorator & ((value: PreviewParams) => ClassDecorator); + +/** + * Defining Require PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Require: PropertyDecorator; + +/** + * Defining BuilderParam PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining BuilderParam PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining BuilderParam PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining BuilderParam PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const BuilderParam: PropertyDecorator; + +/** + * Defining Local PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Local: PropertyDecorator; + +/** + * Defining Param PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Param: PropertyDecorator; + +/** + * Defining Once PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Once: PropertyDecorator; + +/** + * Defining Event PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Event: PropertyDecorator; + +/** + * Defining State PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining State PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining State PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining State PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const State: PropertyDecorator; + +/** + * Defining Track PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defining Track PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const Track: PropertyDecorator; + +/** + * Defining Trace PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const Trace: PropertyDecorator; + +/** + * Defining Prop PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Prop PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Prop PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Prop PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Prop: PropertyDecorator; + +/** + * Defining Link PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Link PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Link PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Link PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Link: PropertyDecorator; + +/** + * Defining ObjectLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining ObjectLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining ObjectLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining ObjectLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ObjectLink: PropertyDecorator; + +/** + * Defines the options of Provide PropertyDecorator. + * + * @interface ProvideOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ProvideOptions { + /** + * Override the @Provide of any parent or parent of parent @Component.@Provide({allowOverride: "name"}) is + * also allowed to be used even when there is no ancestor @Component whose @Provide would be overridden. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + allowOverride?: string, +} + +/** + * Defining Provide PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Provide PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Provide PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Provide PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Provide: PropertyDecorator & ((value: string | ProvideOptions) => PropertyDecorator); + +/** + * Defining Provider PropertyDecorator, aliasName is the only matching key and if aliasName is the default, the default attribute name is regarded as aliasName. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Provider: (aliasName?: string) => PropertyDecorator; + +/** + * Defining Consume PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Consume PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Consume PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Consume PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Consume: PropertyDecorator & ((value: string) => PropertyDecorator); + +/** +* Defining Consumer PropertyDecorator, aliasName is the only matching key and if aliasName is the default, the default attribute name is regarded as aliasName. +* And @Consumer will find the nearest @Provider. +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 12 +*/ +declare const Consumer: (aliasName?: string) => PropertyDecorator; + +/** +* Defining Computed MethodDecorator. +* +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 12 +*/ +declare const Computed: MethodDecorator; + +/** + * Defining StorageProp PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining StorageProp PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining StorageProp PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const StorageProp: (value: string) => PropertyDecorator; + +/** + * Defining StorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining StorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining StorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const StorageLink: (value: string) => PropertyDecorator; + +/** + * Defining Watch PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Watch PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Watch PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Watch PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Watch: (value: string) => PropertyDecorator; + +/** + * Defining Builder MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Builder MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Builder MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Builder MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Builder: MethodDecorator; + +/** + * Defining LocalBuilder MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const LocalBuilder: MethodDecorator; + +/** + * Defining Styles MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defining Styles MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Styles MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Styles MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Styles: MethodDecorator; + +/** + * Defining Extend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining Extend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining Extend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining Extend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Extend: MethodDecorator & ((value: any) => MethodDecorator); + +/** + * Define AnimatableExtend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define AnimatableExtend MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + declare const AnimatableExtend: MethodDecorator & ((value: Object) => MethodDecorator); + +/** + * Define Monitor MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare const Monitor: MonitorDecorator; + +/** + * Define Monitor Decorator type + * + * @typedef { function } MonitorDecorator + * @param { string } value - Monitored path input by the user + * @param { string[] } args - Monitored path(s) input by the user + * @returns { MethodDecorator } Monitor decorator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type MonitorDecorator = (value: string, ...args: string[]) => MethodDecorator; + +/** + * Define IMonitor interface + * + * @interface IMonitor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface IMonitor { + /** + * Array of changed paths(keys) + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dirty: Array; + + /** + * Return the pair of the value before the most recent change and current value for given path. + * If path does not exist, return undefined; If path is not specified, return the value pair corresponding to the first path in dirty. + * + * @param { string } [path] + * @returns { IMonitorValue | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value(path?: string): IMonitorValue | undefined; +} + +/** + * Define IMonitorValue interface + * + * @interface IMonitorValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface IMonitorValue { + /** + * Get the previous value. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + before: T; + + /** + * Get current value. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + now: T; + + /** + * Monitored path input by the user. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + path: string; +} + +/** + * Define AnimatableArithmetic interface + * + * @interface AnimatableArithmetic + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define AnimatableArithmetic interface + * + * @interface AnimatableArithmetic + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + declare interface AnimatableArithmetic { + /** + * Define plus method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define plus method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + plus(rhs: AnimatableArithmetic): AnimatableArithmetic; + + /** + * Define subtract method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define subtract method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + subtract(rhs: AnimatableArithmetic): AnimatableArithmetic; + + /** + * Define multiply method + * + * @param { number } scale - scale value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define multiply method + * + * @param { number } scale - scale value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + multiply(scale: number): AnimatableArithmetic; + + /** + * Define equals method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { boolean } is equals + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define equals method + * + * @param { AnimatableArithmetic } rhs - another value + * @returns { boolean } is equals + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + equals(rhs: AnimatableArithmetic): boolean; +} + +/** + * Defining Concurrent MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defining Concurrent MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining Concurrent MethodDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Concurrent: MethodDecorator; + +/** + * Defining Sendable ClassDecorator + * The Sendable decorator can be used only for classes. A class with this decorator is marked as sendable, and the class object can be shared globally. + * Since 12, the Sendable decorator can be used for function and typeAlias also. + * A function with this decorator is marked as sendable, and the function can be an shareable property of sendable-class object. + * A typeAlias with this decorator is marked as sendable, and the typeAlias can be used to declare properties, variables, + * and arguments that need to be assigned with sendable-function. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Sendable: ClassDecorator; + +/** + * Defining CustomDialog ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining CustomDialog ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining CustomDialog ClassDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const CustomDialog: ClassDecorator; + +/** + * Defining LocalStorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defining LocalStorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining LocalStorageLink PropertyDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const LocalStorageLink: (value: string) => PropertyDecorator; + +/** + * Defining LocalStorageProp PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining LocalStorageProp PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining LocalStorageProp PropertyDecorator + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const LocalStorageProp: (value: string) => PropertyDecorator; + +/** + * Obtains the Context object associated with a component on the page. + * + * @param { Object } component - indicate the component on the page. + * @returns { Context } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @since 9 + */ +/** + * Obtains the Context object associated with a component on the page. + * + * @param { Object } component - indicate the component on the page. + * @returns { Context } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @since 10 + */ +/** + * Obtains the Context object associated with a component on the page. + * + * @param { Object } component - indicate the component on the page. + * @returns { Context } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @atomicservice + * @since 11 + */ +declare function getContext(component?: Object): Context; + +/** + * Defining Reusable ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defining Reusable ClassDecorator. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Reusable: ClassDecorator; + +/** + * Get context. + * + * @typedef { import('../api/application/Context').default } Context + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @since 9 + */ +/** + * Get context. + * + * @typedef { import('../api/application/Context').default } Context + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @since 10 + */ +/** + * Get context. + * + * @typedef { import('../api/application/Context').default } Context + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type Context = import('../api/application/Context').default; + +/** + * Post Card Action. + * + * @param { Object } component - indicate the card entry component. + * @param { Object } action - indicate the router, message or call event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @form + * @since 9 + */ +/** + * Post Card Action. + * + * @param { Object } component - indicate the card entry component. + * @param { Object } action - indicate the router, message or call event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @form + * @since 10 + */ +/** + * Post Card Action. + * + * @param { Object } component - indicate the card entry component. + * @param { Object } action - indicate the router, message or call event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @StageModelOnly + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function postCardAction(component: Object, action: Object): void; + +/** + * Defines the data type of the interface restriction. + * + * @interface Configuration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Configuration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Configuration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Configuration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface Configuration { + /** + * Set colorMode. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set colorMode. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set colorMode. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set colorMode. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly colorMode: string; + + /** + * Set fontScale. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set fontScale. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set fontScale. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set fontScale. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + readonly fontScale: number; +} + +/** + * Defines the data type of the interface restriction. + * + * @interface Rectangle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Rectangle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Rectangle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the data type of the interface restriction. + * + * @interface Rectangle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface Rectangle { + /** + * x:Horizontal coordinate + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * x:Horizontal coordinate + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * x:Horizontal coordinate + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * x:Horizontal coordinate + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: Length; + + /** + * y:Vertical axis coordinate. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * y:Vertical axis coordinate. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * y:Vertical axis coordinate. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * y:Vertical axis coordinate. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: Length; + + /** + * Sets the width of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the width of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the width of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the width of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: Length; + + /** + * Sets the height of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the height of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the height of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the height of the current touchRect. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: Length; +} + +/** + * Interface for ExpectedFrameRateRange. + * + * @interface ExpectedFrameRateRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Interface for ExpectedFrameRateRange. + * + * @interface ExpectedFrameRateRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface ExpectedFrameRateRange { + /** + * The minimum animation drawing FPS. + * The minimum value should be less than or equal to the maximum value. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * The minimum animation drawing FPS. + * The minimum value should be less than or equal to the maximum value. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + min: number, + /** + * The maximum animation drawing FPS. + * The maximum value should be greater than or equal to the minimum value. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * The maximum animation drawing FPS. + * The maximum value should be greater than or equal to the minimum value. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + max: number, + /** + * The expected frame rate of dynamical callback rate range. + * The value should be between the minimum and maximum value. + * Otherwise, the actual callback rate will be dynamically + * adjusted to better align with other animation sources. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * The expected frame rate of dynamical callback rate range. + * The value should be between the minimum and maximum value. + * Otherwise, the actual callback rate will be dynamically + * adjusted to better align with other animation sources. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + expected: number, +} + +/** + * global $r function + * + * @param { string } value + * @param { any[] } params + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * global $r function + * + * @param { string } value + * @param { any[] } params + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * global $r function + * + * @param { string } value + * @param { any[] } params + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * global $r function + * + * @param { string } value + * @param { any[] } params + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function $r(value: string, ...params: any[]): Resource; + +/** + * global $rawfile function + * + * @param { string } value + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * global $rawfile function + * + * @param { string } value + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * global $rawfile function + * + * @param { string } value + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * global $rawfile function + * + * @param { string } value + * @returns { Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function $rawfile(value: string): Resource; + +/** + * Enum for FinishCallbackType. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Enum for FinishCallbackType. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum FinishCallbackType { + /** + * When the entire animation ends and will be removed immediately, the callback is triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * When the entire animation ends and will be removed immediately, the callback is triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + REMOVED = 0, + /** + * When the animation is logically down but may still be in its long tail, the callback is triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * When the animation is logically down but may still be in its long tail, the callback is triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + LOGICALLY = 1, +} + +/** + * Defines the touch test strategy object. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the touch test strategy object. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum TouchTestStrategy { + /** + * Do framework touch test. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Do framework touch test. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DEFAULT = 0, + + /** + * Specify the component to do touch test and follow the framework touch test + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Specify the component to do touch test and follow the framework touch test + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + FORWARD_COMPETITION = 1, + + /** + * Specify the component to do touch test and not follow the framework touch test + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Specify the component to do touch test and not follow the framework touch test + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + FORWARD = 2 +} + +/** + * Defines the animate function params. + * + * @interface AnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the animate function params. + * + * @interface AnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the animate function params. + * + * @interface AnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the animate function params. + * + * @interface AnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface AnimateParam { + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + duration?: number; + /** + * Animation playback speed. A larger value indicates faster animation playback, and a smaller value indicates slower + * animation playback. The value 0 means that there is no animation. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation playback speed. A larger value indicates faster animation playback, and a smaller value indicates slower + * animation playback. The value 0 means that there is no animation. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation playback speed. A larger value indicates faster animation playback, and a smaller value indicates slower + * animation playback. The value 0 means that there is no animation. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + tempo?: number; + /** + * Animation curve. + * + * @type { ?(Curve | string) } + * @default Curve.EaseInOut + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation curve. + * + * @type { ?(Curve | string | ICurve) } + * @default Curve.EaseInOut + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Animation curve. + * + * @type { ?(Curve | string | ICurve) } + * @default Curve.EaseInOut + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Animation curve. + * + * @type { ?(Curve | string | ICurve) } + * @default Curve.EaseInOut + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + curve?: Curve | string | ICurve; + + /** + * Animation plays with delay,when set to a negative number, the animation plays in advance. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + delay?: number; + + /** + * Animation iterations. When set to -1, the animation playing it repeatedly. The value range is greater than or equal to -1. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation iterations. When set to -1, the animation playing it repeatedly. The value range is greater than or equal to -1. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation iterations. When set to -1, the animation playing it repeatedly. The value range is greater than or equal to -1. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + iterations?: number; + + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * + * @type { ?PlayMode } + * @default PlayMode.Normal + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * + * @type { ?PlayMode } + * @default PlayMode.Normal + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * + * @type { ?PlayMode } + * @default PlayMode.Normal + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * + * @type { ?PlayMode } + * @default PlayMode.Normal + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + playMode?: PlayMode; + + /** + * Callback invoked when the animation playback is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Callback invoked when the animation playback is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Callback invoked when the animation playback is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Callback invoked when the animation playback is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onFinish?: () => void; + + /** + * Define the type of onFinish callback in animation. + * + * @type { ?FinishCallbackType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Define the type of onFinish callback in animation. + * + * @type { ?FinishCallbackType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + finishCallbackType?: FinishCallbackType; + + /** + * Indicates expectedFrameRateRange including minimum、maximum and expected frame rate. + * + * @type { ?ExpectedFrameRateRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Indicates expectedFrameRateRange including minimum、maximum and expected frame rate. + * + * @type { ?ExpectedFrameRateRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + expectedFrameRateRange?: ExpectedFrameRateRange; +} + +/** + * Interface for curve object. + * + * @interface ICurve + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Interface for curve object. + * + * @interface ICurve + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Interface for curve object. + * + * @interface ICurve + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ICurve { + /** + * Get curve value by fraction. + * + * @param { number } fraction - Indicates the current normalized time parameter. Value range: [0, 1]. + * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Get curve value by fraction. + * + * @param { number } fraction - Indicates the current normalized time parameter. Value range: [0, 1]. + * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Get curve value by fraction. + * + * @param { number } fraction - Indicates the current normalized time parameter. Value range: [0, 1]. + * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + interpolate(fraction: number): number; +} + +/** + * Defines the motion path options. + * + * @interface MotionPathOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the motion path options. + * + * @interface MotionPathOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the motion path options. + * + * @interface MotionPathOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MotionPathOptions { + /** + * The path info. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The path info. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The path info. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + path: string; + + /** + * The origin point info in range [0,1). + * + * @type { ?number } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The origin point info in range [0,1). + * + * @type { ?number } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The origin point info in range [0,1). + * + * @type { ?number } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + from?: number; + + /** + * he distance point info in range (0,1]. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * he distance point info in range (0,1]. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The distance point info in range (0,1]. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + to?: number; + + /** + * The rotate info. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The rotate info. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The rotate info. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + rotatable?: boolean; +} + +/** + * Defines the shard transition function params. + * + * @interface sharedTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the shard transition function params. + * + * @interface sharedTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the shard transition function params. + * + * @interface sharedTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface sharedTransitionOptions { + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation duration, in ms. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + duration?: number; + + /** + * Animation duration, in ms. + * + * @type { ?(Curve | string | ICurve) } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation curve. + * + * @type { ?(Curve | string | ICurve) } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation curve. + * + * @type { ?(Curve | string | ICurve) } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + curve?: Curve | string | ICurve; + + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + delay?: number; + + /** + * The motion path info. + * + * @type { ?MotionPathOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The motion path info. + * + * @type { ?MotionPathOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The motion path info. + * + * @type { ?MotionPathOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + motionPath?: MotionPathOptions; + + /** + * Z index info. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Z index info. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Z index info. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + zIndex?: number; + + /** + * the animate type. + * + * @type { ?SharedTransitionEffectType } + * @default SharedTransitionEffectType.Exchange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * the animate type. + * + * @type { ?SharedTransitionEffectType } + * @default SharedTransitionEffectType.Exchange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * the animate type. + * + * @type { ?SharedTransitionEffectType } + * @default SharedTransitionEffectType.Exchange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type?: SharedTransitionEffectType; +} + +/** + * Defines the options of geometry transition. + * + * @interface GeometryTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the options of geometry transition. + * + * @interface GeometryTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GeometryTransitionOptions { + /** + * whether follow target for the component still in the hierarchy, default: false, stay current. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * whether follow target for the component still in the hierarchy, default: false, stay current. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + follow?: boolean; + /** + * Defines movement strategy of source and target in the hierarchy during geometry transition. + * + * @type { ?TransitionHierarchyStrategy } + * @default TransitionHierarchyStrategy.ADAPTIVE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @atomicservice + * @since 12 + */ + /** + * Defines movement strategy of source and target in the hierarchy during geometry transition. + * + * @type { ?TransitionHierarchyStrategy } + * @default TransitionHierarchyStrategy.ADAPTIVE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + hierarchyStrategy?: TransitionHierarchyStrategy +} + +/** + * Source and target are two matched elements during the geometry transition. + * The animation starts at the source and ends at the target. + * TransitionHierarchyStrategy enumeration defines how levels of source and target elements + * would be changed in the hierarchy during the geometry transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @atomicservice + * @since 12 + */ +/** + * Source and target are two matched elements during the geometry transition. + * The animation starts at the source and ends at the target. + * TransitionHierarchyStrategy enumeration defines how levels of source and target elements + * would be changed in the hierarchy during the geometry transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ +declare enum TransitionHierarchyStrategy { + /** + * None mode. + * Source and target staty in the original level in the hierarchy during geometry transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @atomicservice + * @since 12 + */ + /** + * None mode. + * Source and target staty in the original level in the hierarchy during geometry transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + NONE = 0, + + /** + * ADAPTIVE mode. + * Lower level one of source and target is elevated to higher level of both, + * indicating that two elements are in same high level. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @atomicservice + * @since 12 + */ + /** + * ADAPTIVE mode. + * Lower level one of source and target is elevated to higher level of both, + * indicating that two elements are in same high level. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + ADAPTIVE = 1, +} + +/** + * Defines the options of translate. + * + * @interface TranslateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of translate. + * + * @interface TranslateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of translate. + * + * @interface TranslateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of translate. + * + * @interface TranslateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface TranslateOptions { + /** + * The param of x direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of x direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of x direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of x direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: number | string; + + /** + * The param of y direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of y direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of y direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of y direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: number | string; + + /** + * The param of z direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of z direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of z direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of z direction. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + z?: number | string; +} + +/** + * Defines the options of scale. + * + * @interface ScaleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of scale. + * + * @interface ScaleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of scale. + * + * @interface ScaleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of scale. + * + * @interface ScaleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ScaleOptions { + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: number; + + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: number; + + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + z?: number; + + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + centerX?: number | string; + + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + centerY?: number | string; +} + +/** + * Defines the align rule options of relative container. + * + * @interface AlignRuleOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the align rule options of relative container. + * + * @interface AlignRuleOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the align rule options of relative container. + * + * @interface AlignRuleOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface AlignRuleOption { + /** + * The param of left align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of left align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of left align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + left?: { anchor: string, align: HorizontalAlign }; + + /** + * The param of right align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of right align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of right align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + right?: { anchor: string, align: HorizontalAlign }; + + /** + * The param of middle align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of middle align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of middle align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + middle?: { anchor: string, align: HorizontalAlign }; + + /** + * The param of top align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of top align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of top align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + top?: { anchor: string, align: VerticalAlign }; + + /** + * The param of bottom align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of bottom align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ + /** + * The param of bottom align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + bottom?: { anchor: string, align: VerticalAlign }; + + /** + * The param of center align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of center align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center align. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + center?: { anchor: string, align: VerticalAlign }; + + /** + * Defines the bias ratio in horizontal and vertical direction. + * + * @type { ?Bias } + * @default {horizontal:0.5,vertical:0.5} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the bias ratio in horizontal and vertical direction. + * + * @type { ?Bias } + * @default {horizontal:0.5,vertical:0.5} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bias?: Bias; +} + +/** + * Defines the localized horizontal align param of relative container. + * + * @interface LocalizedHorizontalAlignParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LocalizedHorizontalAlignParam { + /** + * The anchor of localized align param. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + anchor: string; + + /** + * The align of localized align param. + * + * @type { HorizontalAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + align: HorizontalAlign; +} + +/** + * Defines the localized vertical align param of relative container. + * + * @interface LocalizedVerticalAlignParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LocalizedVerticalAlignParam { + /** + * The anchor of localized align param. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + anchor: string; + + /** + * The align of localized align param. + * + * @type { VerticalAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + align: VerticalAlign; +} + +/** + * Defines the Localized align rule options of relative container. + * + * @interface LocalizedAlignRuleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LocalizedAlignRuleOptions { + /** + * The param of start align. + * + * @type { ?LocalizedHorizontalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start?: LocalizedHorizontalAlignParam; + + /** + * The param of end align. + * + * @type { ?LocalizedHorizontalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + end?: LocalizedHorizontalAlignParam; + + /** + * The param of middle align. + * + * @type { ?LocalizedHorizontalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + middle?: LocalizedHorizontalAlignParam; + + /** + * The param of top align. + * + * @type { ?LocalizedVerticalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + top?: LocalizedVerticalAlignParam; + + /** + * The param of bottom align. + * + * @type { ?LocalizedVerticalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bottom?: LocalizedVerticalAlignParam; + + /** + * The param of center align. + * + * @type { ?LocalizedVerticalAlignParam } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + center?: LocalizedVerticalAlignParam; + + /** + * Defines the bias ratio in horizontal and vertical direction. + * + * @type { ?Bias } + * @default {horizontal:0.5,vertical:0.5} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bias?: Bias; +} + +/** + * Defines the style of the chain in relative container. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum ChainStyle { + /** + * Elements of the chain will be spread out. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SPREAD, + + /** + * Elements except chain's head and tail will be spread out. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SPREAD_INSIDE, + + /** + * Elements of the chain will be packed together. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PACKED, +} + +/** + * The param of rotate. + * + * @interface RotateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The param of rotate. + * + * @interface RotateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * The param of rotate. + * + * @interface RotateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * The param of rotate. + * + * @interface RotateOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface RotateOptions { + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of x direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: number; + + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of y direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: number; + + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of z direction. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + z?: number; + + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center point of x. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + centerX?: number | string; + + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center point of y. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + centerY?: number | string; + + /** + * The param of center point of z. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of center point of z. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + centerZ?: number; + + /** + * The param of camera distance, value range (-∞, ∞). + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of camera distance, value range (-∞, ∞). + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + perspective?: number; + + /** + * The param of angle. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The param of angle. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The param of angle. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The param of angle. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + angle: number | string; +} + +/** + * Defines the param of transition. + * + * @interface TransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead TransitionEffect + */ +declare interface TransitionOptions { + /** + * Defines the param of type. + * + * @type { ?TransitionType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + */ + type?: TransitionType; + /** + * Defines the param of opacity. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + */ + opacity?: number; + /** + * Defines the param of translate. + * + * @type { ?TranslateOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + */ + translate?: TranslateOptions; + /** + * Defines the param of scale. + * + * @type { ?ScaleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + */ + scale?: ScaleOptions; + /** + * Defines the param of rotate. + * + * @type { ?RotateOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + */ + rotate?: RotateOptions; +} + +/** + * Defines the Edge object. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Edge object. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TransitionEdge { + /** + * Top edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + TOP, + + /** + * Bottom edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Bottom edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BOTTOM, + + /** + * Start edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Start edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + START, + + /** + * End edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * End edge + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + END +} + +/** + * Defines all transition effects. + * + * @typedef { object } TransitionEffects + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines all transition effects. + * + * @typedef { object } TransitionEffects + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type TransitionEffects = { + identity: undefined; + opacity: number; + slideSwitch: undefined; + move: TransitionEdge; + translate: TranslateOptions; + rotate: RotateOptions; + scale: ScaleOptions; + asymmetric: { + appear: TransitionEffect; + disappear: TransitionEffect; + }; +}; + +/** + * Defined the draw modifier of node. Provides draw callbacks for the associated Node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class DrawModifier { + /** + * drawBehind Method. Executed before drawing associated Node. + * + * @param { DrawContext } drawContext - The drawContext used to draw. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + drawBehind?(drawContext: DrawContext): void; + + /** + * drawContent Method. Executed when associated Node is drawing, the default drawContent method will be replaced + * if this method is set. + * + * @param { DrawContext } drawContext - The drawContext used to draw. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + drawContent?(drawContext: DrawContext): void; + + /** + * drawFront Method. Executed after drawing associated Node. + * + * @param { DrawContext } drawContext - The drawContext used to draw. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + drawFront?(drawContext: DrawContext): void; + + /** + * Invalidate the component, which will cause a re-render of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + invalidate(): void; +} + +/** + * Defines the transition effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the transition effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class TransitionEffect< + Type extends keyof TransitionEffects = keyof TransitionEffects, + Effect extends TransitionEffects[Type] = TransitionEffects[Type] +> { + /** + * Disables the transition effect + * + * @type { TransitionEffect<"identity"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Disables the transition effect + * + * @type { TransitionEffect<"identity"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static readonly IDENTITY: TransitionEffect<"identity">; + + /** + * Specifies a transition effect with transparency of 0, which is equivalent to TransitionEffect.opacity(0). + * + * @type { TransitionEffect<"opacity"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies a transition effect with transparency of 0, which is equivalent to TransitionEffect.opacity(0). + * + * @type { TransitionEffect<"opacity"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static readonly OPACITY: TransitionEffect<"opacity">; + + /** + * Defines a slide transition effect + * + * @type { TransitionEffect< + * "asymmetric", + * {appear: TransitionEffect<"move", TransitionEdge>; + * disappear: TransitionEffect<"move", TransitionEdge>; + * }> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines a slide transition effect + * + * @type { TransitionEffect< + * "asymmetric", + * {appear: TransitionEffect<"move", TransitionEdge>; + * disappear: TransitionEffect<"move", TransitionEdge>; + * }> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static readonly SLIDE: TransitionEffect< + "asymmetric", + { + appear: TransitionEffect<"move", TransitionEdge>; + disappear: TransitionEffect<"move", TransitionEdge>; + } + >; + + /** + * Specify a transition effect where the element enters by shrinking first and then expanding as it slides in from the right, + * and exits by shrinking first and then expanding as it slides out to the left, with a minimum scale ratio of 0.8. + * It comes with default animation parameters, which can also be overridden. + * The default animation duration is set to 600ms, and the specified animation curve is cubicBezierCurve(0.24, 0.0, 0.50, 1.0). + * + * @type { TransitionEffect<"slideSwitch"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specify a transition effect where the element enters by shrinking first and then expanding as it slides in from the right, + * and exits by shrinking first and then expanding as it slides out to the left, with a minimum scale ratio of 0.8. + * It comes with default animation parameters, which can also be overridden. + * The default animation duration is set to 600ms, and the specified animation curve is cubicBezierCurve(0.24, 0.0, 0.50, 1.0). + * + * @type { TransitionEffect<"slideSwitch"> } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static readonly SLIDE_SWITCH: TransitionEffect<"slideSwitch">; + + /** + * Creates a translate transition effect + * + * @param { TranslateOptions } options - translate options + * @returns { TransitionEffect<"translate"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a translate transition effect + * + * @param { TranslateOptions } options - translate options + * @returns { TransitionEffect<"translate"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static translate(options: TranslateOptions): TransitionEffect<"translate">; + + /** + * Creates a rotation transition effect + * + * @param { RotateOptions } options - rotate options + * Set the rotation effect for component transitions when inserting and deleting. + * The value represents the starting rotation point for the inserting animation and the ending rotation point for the deleting animation. + * -x: Horizontal component of the rotational vector. + * -y: Vertical component of the rotational vector. + * -z: Vertical component of the rotational vector. + * -centerX, centerY specify the rotation center point, with default values of "50%", + * meaning that the default rotation center point is the center point of the component. + * -The center point of (0, 0) represents the upper-left corner of the component. + * -centerZ refers to the Z-axis anchor point. The default value of centerZ is 0. + * -perspective indicates the visual distance. The perspective property does not support transition animation. + * @returns { TransitionEffect<"rotate"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a rotation transition effect + * + * @param { RotateOptions } options - rotate options + * Set the rotation effect for component transitions when inserting and deleting. + * The value represents the starting rotation point for the inserting animation and the ending rotation point for the deleting animation. + * -x: Horizontal component of the rotational vector. + * -y: Vertical component of the rotational vector. + * -z: Vertical component of the rotational vector. + * -centerX, centerY specify the rotation center point, with default values of "50%", + * meaning that the default rotation center point is the center point of the component. + * -The center point of (0, 0) represents the upper-left corner of the component. + * -centerZ refers to the Z-axis anchor point. The default value of centerZ is 0. + * -perspective indicates the visual distance. The perspective property does not support transition animation. + * @returns { TransitionEffect<"rotate"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static rotate(options: RotateOptions): TransitionEffect<"rotate">; + + /** + * Creates a scale transition effect + * + * @param { ScaleOptions } options - scale options + * @returns { TransitionEffect<"scale"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a scale transition effect + * + * @param { ScaleOptions } options - scale options + * @returns { TransitionEffect<"scale"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static scale(options: ScaleOptions): TransitionEffect<"scale">; + + /** + * Creates an opacity transition effect with alpha value + * + * @param { number } alpha - opacity alpha value, value range [0, 1]. + * @returns { TransitionEffect<"opacity"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates an opacity transition effect with alpha value + * + * @param { number } alpha - opacity alpha value, value range [0, 1]. + * @returns { TransitionEffect<"opacity"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Creates an opacity transition effect with alpha value + * + * @param { number } alpha - opacity alpha value, value range [0, 1]. + * Illegal values less than 0 are treated as 0, and illegal values greater than 1 are treated as 1. + * @returns { TransitionEffect<"opacity"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + static opacity(alpha: number): TransitionEffect<"opacity">; + + /** + * Creates a move transition effect + * + * @param { TransitionEdge } edge - the edge that component will move to + * @returns { TransitionEffect<"move"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates a move transition effect + * + * @param { TransitionEdge } edge - the edge that component will move to + * @returns { TransitionEffect<"move"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static move(edge: TransitionEdge): TransitionEffect<"move">; + + /** + * Creates an asymmetric transition effect + * + * @param { TransitionEffect } appear - the transition which will be attached when the component is appear + * @param { TransitionEffect } disappear - the transition which will be attached when the component is disappear + * @returns { TransitionEffect<"asymmetric"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates an asymmetric transition effect + * + * @param { TransitionEffect } appear - the transition which will be attached when the component is appear + * @param { TransitionEffect } disappear - the transition which will be attached when the component is disappear + * @returns { TransitionEffect<"asymmetric"> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static asymmetric( + appear: TransitionEffect, + disappear: TransitionEffect + ): TransitionEffect<"asymmetric">; + + /** + * TransitionEffect constructor + * + * @param { Type } type - transition type + * @param { Effect } effect - transition options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * TransitionEffect constructor + * + * @param { Type } type - transition type + * @param { Effect } effect - transition options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(type: Type, effect: Effect); + + /** + * Set the animation of current transition effect + * + * @param { AnimateParam } value - animation parameters + * @returns { TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the animation of current transition effect + * + * @param { AnimateParam } value - animation parameters + * @returns { TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + animation(value: AnimateParam): TransitionEffect; + + /** + * Combines another transition effect + * + * @param { TransitionEffect } transitionEffect - transition effect which is be combined + * @returns { TransitionEffect } combined transition effect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Combines another transition effect + * + * @param { TransitionEffect } transitionEffect - transition effect which is be combined + * @returns { TransitionEffect } combined transition effect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + combine(transitionEffect: TransitionEffect): TransitionEffect; +} + +/** + * Define Preview property + * + * @interface PreviewParams + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Define Preview property + * + * @interface PreviewParams + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface PreviewParams { + /** + * Define Preview title + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview title + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + title?: string; + + /** + * Define Preview width + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview width + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: number; + + /** + * Define Preview height + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview height + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: number; + + /** + * Define Preview locale + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview locale + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + locale?: string; + + /** + * Define Preview colorMode + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview colorMode + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + colorMode?: string; + + /** + * Define Preview deviceType + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview deviceType + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + deviceType?: string; + + /** + * Define Preview dpi + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview dpi + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + dpi?: number; + + /** + * Define Preview orientation + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview orientation + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + orientation?: string; + + /** + * Define Preview roundScreen + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define Preview roundScreen + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ + roundScreen?: boolean; +} + +/** + * ItemDragInfo object description + * + * @interface ItemDragInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * ItemDragInfo object description + * + * @interface ItemDragInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * ItemDragInfo object description + * + * @interface ItemDragInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ItemDragInfo { + /** + * Obtains the X coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Obtains the X coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Obtains the X coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + x: number; + + /** + * Obtains the Y coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Obtains the Y coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Obtains the Y coordinate of the drag window, in vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + y: number; +} + +/** + * Enum of using the effects template mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ +declare enum EffectType { + /** + * Define use the effects template defined by the parent effectComponent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ + DEFAULT = 0, + /** + * Define use the effects template defined by the window. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ + WINDOW_EFFECT = 1, +} + +/** + * Defines the drag status before drag action. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum PreDragStatus { + /** + * Define the status for user prepare to start long press gesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ACTION_DETECTING_STATUS = 0, + + /** + * Define the status for user can start drag action. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + READY_TO_TRIGGER_DRAG_ACTION = 1, + + /** + * Define the status for dragItem lift animation started. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PREVIEW_LIFT_STARTED = 2, + + /** + * Define the status for dragItem lift animation finished. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PREVIEW_LIFT_FINISHED = 3, + + /** + * Define the status for dragItem landing animation started. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PREVIEW_LANDING_STARTED = 4, + + /** + * Define the status for dragItem landing animation finished. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PREVIEW_LANDING_FINISHED = 5, + + /** + * Define the status for user cancel drag action. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ACTION_CANCELED_BEFORE_DRAG = 6, +} + +/** + * DragItemInfo object description + * + * @interface DragItemInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * DragItemInfo object description + * + * @interface DragItemInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +/** + * DragItemInfo object description + * + * @interface DragItemInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare interface DragItemInfo { + /** + * Uses the pixelMap object for drawing. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Uses the pixelMap object for drawing. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Uses the pixelMap object for drawing. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + pixelMap?: PixelMap; + + /** + * Uses the custom builder for drawing, if pixelMap is set, this value is ignored. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Uses the custom builder for drawing, if pixelMap is set, this value is ignored. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Uses the custom builder for drawing, if pixelMap is set, this value is ignored. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + builder?: CustomBuilder; + + /** + * Sets the extra info for drag event. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the extra info for drag event. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Sets the extra info for drag event. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + extraInfo?: string; +} + +/** + * Defining animation function. + * + * @param { AnimateParam } value + * @param { function } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defining animation function. + * + * @param { AnimateParam } value + * @param { function } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defining animation function. + * + * @param { AnimateParam } value + * @param { function } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defining animation function. + * + * @param { AnimateParam } value + * @param { function } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function animateTo(value: AnimateParam, event: () => void): void; + +/** + * Define animation functions for immediate distribution. + * + * @param { AnimateParam } value - Set animation effect parameters. + * @param { function } event - Specify the closure function that displays dynamic effects, + * and the system will automatically insert transition animations for state changes caused by the closure function. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare function animateToImmediately(value: AnimateParam, event: () => void): void; + +/** + * Converts a value in vp units to a value in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a value in vp units to a value in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a value in vp units to a value in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a value in vp units to a value in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function vp2px(value: number): number; + +/** + * Converts a number in units of px to a number in units of vp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a number in units of px to a number in units of vp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a number in units of px to a number in units of vp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a number in units of px to a number in units of vp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function px2vp(value: number): number; + +/** + * Converts a number in fp units to a number in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a number in fp units to a number in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a number in fp units to a number in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a number in fp units to a number in px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function fp2px(value: number): number; + +/** + * Converts a number in units of px to a number in units of fp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a number in units of px to a number in units of fp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a number in units of px to a number in units of fp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a number in units of px to a number in units of fp. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function px2fp(value: number): number; + +/** + * Converts a number in units of lpx to a number in units of px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a number in units of lpx to a number in units of px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a number in units of lpx to a number in units of px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a number in units of lpx to a number in units of px. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function lpx2px(value: number): number; + +/** + * Converts a number in units of px to a number in units of lpx. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Converts a number in units of px to a number in units of lpx. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Converts a number in units of px to a number in units of lpx. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Converts a number in units of px to a number in units of lpx. + * + * @param { number } value + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare function px2lpx(value: number): number; + +/** + * Defines the namespace of focus controller. + * + * @namespace focusControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 9 + */ +/** + * Defines the namespace of focus controller. + * + * @namespace focusControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare namespace focusControl { + /** + * Request focus to the specific component by param: 'id/key'. + * + * @param { string } value + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Request focus to the specific component by param: 'id/key'. + * + * @param { string } value + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Request focus to the specific component by param: 'id/key'. + * + * @param { string } value + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + function requestFocus(value: string): boolean; +} + +/** + * Import the PointerStyle type object for setCursor. + * + * @typedef { import('../api/@ohos.multimodalInput.pointer').default.PointerStyle } PointerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Import the PointerStyle type object for setCursor. + * + * @typedef { import('../api/@ohos.multimodalInput.pointer').default.PointerStyle } PointerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare type PointerStyle = import('../api/@ohos.multimodalInput.pointer').default.PointerStyle; + +/** + * CursorControl + * + * @namespace cursorControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * CursorControl + * + * @namespace cursorControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare namespace cursorControl { + + /** + * Change the mouse cursor style by param: 'PointerStyle'. + * + * @param { PointerStyle } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Change the mouse cursor style by param: 'PointerStyle'. + * + * @param { PointerStyle } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + function setCursor(value: PointerStyle): void; + + /** + * Restore the default mouse cursor style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Restore the default mouse cursor style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + function restoreDefault(): void; +} + +/** + * Defines the event target. + * + * @interface EventTarget + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the event target. + * + * @interface EventTarget + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the event target. + * + * @interface EventTarget + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the event target. + * + * @interface EventTarget + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface EventTarget { + /** + * Area of current target. + * + * @type { Area } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Area of current target. + * + * @type { Area } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Area of current target. + * + * @type { Area } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Area of current target. + * + * @type { Area } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + area: Area; +} + +/** + * Defines the event source type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the event source type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the event source type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SourceType { + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Unknown, + + /** + * The mouse type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The mouse type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The mouse type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Mouse, + + /** + * The touch screen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The touch screen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The touch screen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TouchScreen, +} + +/** + * Defines the event tool type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the event tool type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the event tool type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SourceTool { + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Unknown type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Unknown, + + /** + * The finger type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The finger type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The finger type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Finger, + + /** + * The pen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The pen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The pen type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Pen, + + /** + * The mouse type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + MOUSE, + + /** + * The touchpad type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TOUCHPAD, + + /** + * The joystick type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + JOYSTICK, +} + +/** + * Defines the Border Image Repeat Mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Border Image Repeat Mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Border Image Repeat Mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum RepeatMode { + /** + * Repeat mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Repeat mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Repeat mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Repeat, + + /** + * Stretch mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Stretch mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Stretch mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Stretch, + + /** + * Round mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Round mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Round mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Round, + + /** + * Space mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Space mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Space mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Space, +} + +/** + * enum Blur style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * enum Blur style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * enum Blur style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum BlurStyle { + /** + * Defines the thin card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the thin card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the thin card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Thin, + + /** + * Defines the regular card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the regular card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the regular card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Regular, + + /** + * Defines the thick card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the thick card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the thick card material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Thick, + + /** + * Defines the thin background material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the thin background material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BACKGROUND_THIN, + + /** + * Defines the thin regular material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the thin regular material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BACKGROUND_REGULAR, + + /** + * Defines the thin thick material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the thin thick material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BACKGROUND_THICK, + + /** + * Defines the thin ultra thick material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the thin ultra thick material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BACKGROUND_ULTRA_THICK, + + /** + * Defines none material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines none material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + NONE, + + /** + * Defines the ultra thin component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the ultra thin component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COMPONENT_ULTRA_THIN = 8, + + /** + * Defines the thin component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the thin component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COMPONENT_THIN = 9, + + /** + * Defines the regular component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the regular component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COMPONENT_REGULAR = 10, + + /** + * Defines the thick component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the thick component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COMPONENT_THICK = 11, + + /** + * Defines the ultra thick component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the ultra thick component material. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COMPONENT_ULTRA_THICK = 12, +} + +/** + * Enumerates the policies for activating the blur style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare enum BlurStyleActivePolicy { + /** + * The component has the blur effect only when the window is focused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + FOLLOWS_WINDOW_ACTIVE_STATE = 0, + + /** + * The component always has the blur effect, regardless of whether the window is focused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + ALWAYS_ACTIVE = 1, + + /** + * The component does not have the blur effect, regardless of whether the window is focused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + ALWAYS_INACTIVE = 2, +} + +/** + * enum color mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * enum color mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ThemeColorMode { + /** + * Defines the mode which is follow up with system. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the mode which is follow up with system. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SYSTEM, + + /** + * Defines the light mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the light mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LIGHT, + + /** + * Defines the dark mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the dark mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DARK, +} + +/** + * Defines adaptive color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines adaptive color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum AdaptiveColor { + /** + * Defines the fixed value color adaptive mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the fixed value color adaptive mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DEFAULT, + + /** + * Defines the background average color adaptive mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the background average color adaptive mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + AVERAGE, +} + +/** + * Defines modal transition type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines modal transition type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ModalTransition { + /** + * Use default animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use default animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DEFAULT, + + /** + * Use none animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use none animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NONE, + + /** + * Use alpha animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use alpha animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ALPHA, +} + +/** + * Defines the options of backgroundBlurStyle + * + * @interface BackgroundBlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of backgroundBlurStyle + * + * @interface BackgroundBlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface BackgroundBlurStyleOptions extends BlurStyleOptions { + /** + * Defines the policy for activating the blur style. + * + * @type { ?BlurStyleActivePolicy } + * @default BlurStyleActivePolicy.ALWAYS_ACTIVE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + policy?: BlurStyleActivePolicy; + + /** + * Color of the background effect when the window is not focused. + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + inactiveColor?: ResourceColor; +} + +/** + * Defines the options of ForegroundBlurStyle + * + * @interface ForegroundBlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of ForegroundBlurStyle + * + * @interface ForegroundBlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ForegroundBlurStyleOptions extends BlurStyleOptions {} + + +/** + * Defines the options of blur + * + * @interface BlurOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the options of blur + * + * @interface BlurOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface BlurOptions { + /** + * Fuzzy gray scale parameter. + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Fuzzy gray scale parameter. + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + grayscale: [number, number]; +} + +/** + * Defines the options of blurStyle + * + * @interface BlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of blurStyle + * + * @interface BlurStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface BlurStyleOptions { + /** + * color mode + * + * @type { ?ThemeColorMode } + * @default ThemeColorMode.SYSTEM + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * color mode + * + * @type { ?ThemeColorMode } + * @default ThemeColorMode.SYSTEM + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + colorMode?: ThemeColorMode; + + /** + * adaptive color + * + * @type { ?AdaptiveColor } + * @default AdaptiveColor.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * adaptive color + * + * @type { ?AdaptiveColor } + * @default AdaptiveColor.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + adaptiveColor?: AdaptiveColor; + + /** + * Define the scale of blur effect. + * The range of value is [0, 1]. The larger the value, the more obvious the blurring effect. + * A value of 0 indicates no blur effect and a value of 1 indicates a complete blur effect. + * + * @type { ?number } + * @default 1.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + scale?: number; + + /** + * Defines the options of blur + * + * @type { ?BlurOptions } + * @default { grayScale: [0,0] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the options of blur + * + * @type { ?BlurOptions } + * @default { grayScale: [0,0] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + blurOptions?: BlurOptions; +} + +/** + * Defines the options of BackgroundEffect + * + * @interface BackgroundEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the options of BackgroundEffect + * + * @interface BackgroundEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface BackgroundEffectOptions { + + /** + * Define the radius size of BackgroundEffect.The range of this value is [0, ∞) + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the radius size of BackgroundEffect.The range of this value is [0, ∞) + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius: number; + + /** + * Define the saturation of BackgroundEffect. Value range [0, ∞) + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the saturation of BackgroundEffect. Value range [0, ∞) + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + saturation?: number; + + /** + * Define the brightness of BackgroundEffect. Value range [0, ∞) + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the brightness of BackgroundEffect. Value range [0, ∞) + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + brightness?: number; + + /** + * color the brightness of BackgroundEffect. + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * color the brightness of BackgroundEffect. + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * Define the adaptiveColor of BackgroundEffect. + * + * @type { ?AdaptiveColor } + * @default AdaptiveColor.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the adaptiveColor of BackgroundEffect. + * + * @type { ?AdaptiveColor } + * @default AdaptiveColor.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + adaptiveColor?: AdaptiveColor; + + /** + * Define the blurOptions of BackgroundEffect. + * + * @type { ?BlurOptions } + * @default { grayScale: [0,1] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the blurOptions of BackgroundEffect. + * + * @type { ?BlurOptions } + * @default { grayScale: [0,0] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + blurOptions?: BlurOptions; + + /** + * Defines the policy for activating the blur style. + * + * @type { ?BlurStyleActivePolicy } + * @default BlurStyleActivePolicy.ALWAYS_ACTIVE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + policy?: BlurStyleActivePolicy; + + /** + * Color of the background effect when the window is not focused. + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + inactiveColor?: ResourceColor; +} + +/** + * Defines the options of ForegroundEffect + * + * @interface ForegroundEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ForegroundEffectOptions { + + /** + * Define the radius size of ForegroundEffect.The range of this value is [0, ∞) + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius: number; +} + +/** + * Provide an interface for the text style of picker + * + * @interface PickerTextStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provide an interface for the text style of picker + * + * @interface PickerTextStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PickerTextStyle { + /** + * Define the text color of picker. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the text color of picker. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + + /** + * Define the text font of picker. + * Only support size and weight. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the text font of picker. + * Only support size and weight. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font?: Font; +} + +/** + * Provide an interface for the button style of picker + * + * @interface PickerDialogButtonStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface PickerDialogButtonStyle { + /** + * Describes the button style. + * + * @type { ?ButtonType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type?: ButtonType; + + /** + * Describes the button style. + * + * @type { ?ButtonStyleMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: ButtonStyleMode; + + /** + * Describes the button role. + * + * @type { ?ButtonRole } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + role?: ButtonRole; + + /** + * Describes the button text size. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontSize?: Length; + + /** + * Describes the button text color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontColor?: ResourceColor; + + /** + * Describes the button font weight. + * + * @type { ?(FontWeight | number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontWeight?: FontWeight | number | string; + + /** + * Describes the button font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontStyle?: FontStyle; + + /** + * Describes the button font family. + * + * @type { ?(Resource | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFamily?: Resource | string; + + /** + * Describes the button background color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Describes the button border radius. + * + * @type { ?(Length | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderRadius?: Length | BorderRadiuses; + + /** + * Define whether the button default to responding to the Enter key + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + primary?: boolean; +} + +/** + * Define the type of shadow + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define the type of shadow + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ShadowType { + /** + * Define a color type of shadow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define a color type of shadow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + COLOR, + + /** + * Define a blur type of shadow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define a blur type of shadow + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BLUR, +} + +/** + * Define the options of shadow + * + * @interface ShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Define the options of shadow + * + * @interface ShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Define the options of shadow + * + * @interface ShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Define the options of shadow + * + * @interface ShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ShadowOptions { + /** + * Define the radius size of shadow + * + * @type { number | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Define the radius size of shadow + * + * @type { number | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define the radius size of shadow + * + * @type { number | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Define the radius size of shadow + * + * @type { number | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radius: number | Resource; + + /** + * Define the type of shadow + * + * @type { ?ShadowType } + * @default ShadowType.COLOR + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the type of shadow + * + * @type { ?ShadowType } + * @default ShadowType.COLOR + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type?: ShadowType; + + /** + * Define the color of shadow + * + * @type { ?(Color | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Define the color of shadow + * + * @type { ?(Color | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define the color of shadow + * + * @type { ?(Color | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Define the color or the color strategy of shadow + * + * @type { ?(Color | string | Resource| ColoringStrategy) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color?: Color | string | Resource | ColoringStrategy; + + /** + * Define the horizontal offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Define the horizontal offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define the horizontal offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Define the horizontal offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + offsetX?: number | Resource; + + /** + * Define the vertical offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Define the vertical offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Define the vertical offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Define the vertical offset size of shadow + * + * @type { ?(number | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + offsetY?: number | Resource; + + /** + * Define whether the shadow should fill the area + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define whether the shadow should fill the area + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fill?: boolean; +} + +/** + * enum Shadow style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * enum Shadow style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ShadowStyle { + /** + * Defines the super small default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the super small default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_DEFAULT_XS, + + /** + * Defines the small default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the small default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_DEFAULT_SM, + + /** + * Defines the medium default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the medium default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_DEFAULT_MD, + + /** + * Defines the large default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the large default shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_DEFAULT_LG, + + /** + * Defines the small floating shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the small floating shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_FLOATING_SM, + + /** + * Defines the medium floating shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the medium floating shadow style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + OUTER_FLOATING_MD, +} + +/** + * Defines the options of Shadow. + * + * @interface MultiShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of Shadow. + * + * @interface MultiShadowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MultiShadowOptions { + /** + * Current shadow radius. + * + * @type { ?(number | Resource) } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Current shadow radius. + * + * @type { ?(number | Resource) } + * @default 20 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + radius?: number | Resource; + + /** + * Current shadow offsetX. + * + * @type { ?(number | Resource) } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Current shadow offsetX. + * + * @type { ?(number | Resource) } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetX?: number | Resource; + + /** + * Current shadow offsetY + * + * @type { ?(number | Resource) } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Current shadow offsetY + * + * @type { ?(number | Resource) } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetY?: number | Resource; +} + +/** + * Enumerates the safe area types. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the safe area types. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SafeAreaType { + /** + * Default area of the system, including the status bar and navigation bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Default area of the system, including the status bar and navigation bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SYSTEM, + + /** + * Notch or punch hole. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Notch or punch hole. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CUTOUT, + + /** + * Soft keyboard area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Soft keyboard area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + KEYBOARD +} + +/** + * Enumerates the safe area edges. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enumerates the safe area edges. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SafeAreaEdge { + /** + * Top edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Top edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TOP, + + /** + * Bottom edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Bottom edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOTTOM, + + /** + * Start edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Start edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + START, + + /** + * End edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * End edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + END +} + +/** + * Enumerates the safe area types can be ignored. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum LayoutSafeAreaType { + /** + * Default area of the system, including the status bar and navigation bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SYSTEM = 0, +} + +/** + * Enumerates the safe area edges can be ignored. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum LayoutSafeAreaEdge { + /** + * Top edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TOP = 0, + + /** + * Bottom edge of the safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BOTTOM = 1, +} + +/** + * Defines sheet size type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines sheet size type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SheetSize { + /** + * Defines the sheet size medium height type. The height is half the screen height + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the sheet size medium height type. The height is half the screen height + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MEDIUM, + + /** + * Defines the sheet size large height type. The height is almost screen height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the sheet size large height type. The height is almost screen height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LARGE, + + /** + * Defines the sheet size fit content height type. The height fit content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the sheet size fit content height type. The height fit content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FIT_CONTENT = 2, +} + +/** + * Defines the base event. + * + * @interface BaseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the base event. + * + * @interface BaseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the base event. + * + * @interface BaseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the base event. + * + * @interface BaseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface BaseEvent { + /** + * Defines the current target which fires this event. + * + * @type { EventTarget } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the current target which fires this event. + * + * @type { EventTarget } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the current target which fires this event. + * + * @type { EventTarget } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the current target which fires this event. + * + * @type { EventTarget } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + target: EventTarget; + + /** + * Event timestamp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Event timestamp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Event timestamp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Event timestamp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + timestamp: number; + + /** + * the event source info. + * + * @type { SourceType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * the event source info. + * + * @type { SourceType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * the event source info. + * + * @type { SourceType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * the event source info. + * + * @type { SourceType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + source: SourceType; + + /** + * the Horizontal axis coordinate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + axisHorizontal?: number; + + /** + * the Vertical axis coordinate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + axisVertical?: number; + + /** + * Touch pressure. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Touch pressure. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Touch pressure. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + pressure: number; + + /** + * The angle between pencil projection on plane-X-Y and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The angle between pencil projection on plane-X-Y and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The angle between pencil projection on plane-X-Y and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + tiltX: number; + + /** + * The angle between pencil projection on plane-Y-Z and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The angle between pencil projection on plane-Y-Z and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The angle between pencil projection on plane-Y-Z and axis-Z. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + tiltY: number; + + /** + * The event tool type info. + * + * @type { SourceTool } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The event tool type info. + * + * @type { SourceTool } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The event tool type info. + * + * @type { SourceTool } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + sourceTool: SourceTool; + + /** + * Query the ModifierKey press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the keys of the ModifierKey. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getModifierKeyState?(keys: Array): boolean; + + /** + * Indicates the ID of the input device that triggers the current event. + * + * @type { ?number } [deviceId] The ID of the input device that triggers the current event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + deviceId?: number; +} + +/** + * Border image option + * + * @interface BorderImageOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Border image option + * + * @interface BorderImageOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Border image option + * + * @interface BorderImageOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface BorderImageOption { + /** + * Border image slice + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image slice + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image slice + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border image slice + * + * @type { ?(Length | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + slice?: Length | EdgeWidths | LocalizedEdgeWidths, + + /** + * Border image repeat + * + * @type { ?RepeatMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image repeat + * + * @type { ?RepeatMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image repeat + * + * @type { ?RepeatMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + repeat?: RepeatMode, + + /** + * Border image source + * + * @type { ?(string | Resource | LinearGradient) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image source + * + * @type { ?(string | Resource | LinearGradient) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image source + * + * @type { ?(string | Resource | LinearGradient) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + source?: string | Resource | LinearGradient, + + /** + * Border image width + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image width + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image width + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border image width + * + * @type { ?(Length | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + width?: Length | EdgeWidths | LocalizedEdgeWidths, + + /** + * Border image outset + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image outset + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image outset + * + * @type { ?(Length | EdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border image outset + * + * @type { ?(Length | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outset?: Length | EdgeWidths | LocalizedEdgeWidths, + + /** + * Border image center fill + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image center fill + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image center fill + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fill?: boolean +} + +/** + * The tap action triggers this method invocation. + * + * @interface ClickEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The tap action triggers this method invocation. + * + * @interface ClickEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * The tap action triggers this method invocation. + * + * @interface ClickEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * The tap action triggers this method invocation. + * + * @interface ClickEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ClickEvent extends BaseEvent { + /** + * X coordinate of the click point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the click point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + displayX: number; + + /** + * Y coordinate of the click point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the click point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + displayY: number; + + /** + * X coordinate of the click point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the click point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + windowX: number; + + /** + * Y coordinate of the click point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the click point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + windowY: number; + + /** + * X coordinate of the click point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead ClickEvent#windowX + */ + screenX: number; + + /** + * Y coordinate of the click point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead ClickEvent#windowY + */ + screenY: number; + + /** + * X coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * X coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * X coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * X coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x: number; + + /** + * Y coordinate of the click point relative to the upper edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Y coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Y coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Y coordinate of the click point relative to the left edge of the clicked element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y: number; + + /** + * Prevent the default function. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preventDefault: () => void; +} + +/** + * The hover action triggers this method invocation. + * + * @interface HoverEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * The hover action triggers this method invocation. + * + * @interface HoverEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface HoverEvent extends BaseEvent { + /** + * The blocking hover event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The blocking hover event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + stopPropagation: () => void; +} + +/** + * The mouse click action triggers this method invocation. + * + * @interface MouseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The mouse click action triggers this method invocation. + * + * @interface MouseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface MouseEvent extends BaseEvent { + /** + * Mouse button of the click event. + * + * @type { MouseButton } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse button of the click event. + * + * @type { MouseButton } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + button: MouseButton; + + /** + * Mouse action of the click event. + * + * @type { MouseAction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse action of the click event. + * + * @type { MouseAction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + action: MouseAction; + + /** + * X coordinate of the mouse point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * X coordinate of the mouse point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + displayX: number; + + /** + * Y coordinate of the mouse point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Y coordinate of the mouse point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + displayY: number; + + /** + * X coordinate of the mouse point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * X coordinate of the mouse point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + windowX: number; + + /** + * Y coordinate of the mouse point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Y coordinate of the mouse point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + windowY: number; + + /** + * X coordinate of the mouse point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + * @useinstead MouseEvent#windowX + */ + screenX: number; + + /** + * Y coordinate of the mouse point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + * @useinstead MouseEvent#windowY + */ + screenY: number; + + /** + * X coordinate of the mouse point relative to the left edge of the mouse hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * X coordinate of the mouse point relative to the left edge of the mouse hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + x: number; + + /** + * Y coordinate of the mouse point relative to the upper edge of the mouse hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Y coordinate of the mouse point relative to the upper edge of the mouse hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + y: number; + + /** + * The blocking event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The blocking event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + stopPropagation: () => void; +} + +/** + * The accessibility hover action triggers this method invocation. + * + * @typedef AccessibilityHoverEvent + * @extends BaseEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface AccessibilityHoverEvent extends BaseEvent { + /** + * Type of the accessibility hover event. + * + * @type { AccessibilityHoverType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + type: AccessibilityHoverType; + + /** + * X coordinate of the accessibility hover point relative to the left edge of the event hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + x: number; + + /** + * Y coordinate of the accessibility hover point relative to the upper edge of the event hit element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + y: number; + + /** + * X coordinate of the accessibility hover point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + displayX: number; + + /** + * Y coordinate of the accessibility hover point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + displayY: number; + + /** + * X coordinate of the accessibility hover point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + windowX: number; + + /** + * Y coordinate of the accessibility hover point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + windowY: number; +} + +/** + * Type of the touch event. + * + * @interface TouchObject + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Type of the touch event. + * + * @interface TouchObject + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Type of the touch event. + * + * @interface TouchObject + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TouchObject { + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type: TouchType; + + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + id: number; + + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + displayX: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + displayY: number; + + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + windowX: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + windowY: number; + + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead TouchObject#windowX + */ + screenX: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the current window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead TouchObject#windowY + */ + screenY: number; + + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + x: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + y: number; +} + +/** + * TouchObject getHistoricalPoints Function Parameters + * + * @interface HistoricalPoint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * TouchObject getHistoricalPoints Function Parameters + * + * @interface HistoricalPoint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface HistoricalPoint { + /** + * The base touchObject information of historicalPoint + * + * @type { TouchObject } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The base touchObject information of historicalPoint + * + * @type { TouchObject } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + touchObject: TouchObject; + + /** + * Contact area between the finger pad and the screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Contact area between the finger pad and the screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size: number; + + /** + * Pressure of the touch event. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pressure of the touch event. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + force: number; + + /** + * Timestamp of the touch event. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Timestamp of the touch event. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + timestamp: number; +} + +/** + * Touch Action Function Parameters + * + * @interface TouchEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Touch Action Function Parameters + * + * @interface TouchEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Touch Action Function Parameters + * + * @interface TouchEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface TouchEvent extends BaseEvent { + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Type of the touch event. + * + * @type { TouchType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type: TouchType; + + /** + * All finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * All finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * All finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + touches: TouchObject[]; + + /** + * Indicates the current changed finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates the current changed finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates the current changed finger information. + * + * @type { TouchObject[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + changedTouches: TouchObject[]; + + /** + * The blocking event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The blocking event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The blocking event pops up. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stopPropagation: () => void; + + /** + * Get the historical points. + * + * @returns { Array } - return all historical points. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the historical points. + * + * @returns { Array } - return all historical points. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getHistoricalPoints(): Array; + + /** + * Prevent the default function. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preventDefault: () => void; +} + +/** + * Defines the callback type used in onSizeChange. + * The value of oldValue is last size of the component. + * The value of newValue is new size of the component. + * + * @typedef { function } SizeChangeCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type SizeChangeCallback = (oldValue: SizeOptions, newValue: SizeOptions) => void; + +/** + * Defines the callback type used in onGestureRecognizerJudgeBegin. + * + * @typedef { function } GestureRecognizerJudgeBeginCallback + * @param { BaseGestureEvent } event - the event information + * @param { GestureRecognizer } current - the current gesture recognizer of the component + * @param { Array } recognizers - the gesture recognizers of the component on the response chain + * @returns { GestureJudgeResult } the gesture judge result + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type GestureRecognizerJudgeBeginCallback = (event: BaseGestureEvent, current: GestureRecognizer, recognizers: Array) => GestureJudgeResult; + +/** + * Defines the callback type used in shouldBuiltInRecognizerParallelWith. + * + * @typedef { function } ShouldBuiltInRecognizerParallelWithCallback + * @param { GestureRecognizer } current - the current gesture recognizer of the component + * @param { Array } others - the gesture recognizers of the component on the response chain + * @returns { GestureRecognizer } gesture recognizer of the component + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ShouldBuiltInRecognizerParallelWithCallback = (current: GestureRecognizer, others: Array) => GestureRecognizer; + +/** + * Defines the finish callback type used in transition. + * + * @typedef { function } TransitionFinishCallback + * @param { boolean } transitionIn - a boolean value indicates whether it is the callback of transitionIn or transitionOut. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type TransitionFinishCallback = (transitionIn: boolean) => void; + +/** + * Defines the PixelMap type object for ui component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the PixelMap type object for ui component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the PixelMap type object for ui component. + * + * @typedef { import('../api/@ohos.multimedia.image').default.PixelMap } PixelMap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type PixelMap = import('../api/@ohos.multimedia.image').default.PixelMap; + +/** + * pixelmap object with release function. + * + * @interface PixelMapMock + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +declare interface PixelMapMock { + /** + * release function. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + release(): void; +} + +/** + * Enum for Drag Behavior. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enum for Drag Behavior. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum DragBehavior { + /** + * If drag use copy event, then set DragBehavior.COPY. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If drag use copy event, then set DragBehavior.COPY. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + COPY, + /** + * If drag use move event, then set DragBehavior.MOVE. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If drag use move event, then set DragBehavior.MOVE. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + MOVE +} + +/** + * Import the UnifiedData type object for ui component. + * + * @typedef { import('../api/@ohos.data.unifiedDataChannel').default.UnifiedData } UnifiedData + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Import the UnifiedData type object for ui component. + * + * @typedef { import('../api/@ohos.data.unifiedDataChannel').default.UnifiedData } UnifiedData + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type UnifiedData = import('../api/@ohos.data.unifiedDataChannel').default.UnifiedData; + +/** + * Import the Summary type object for ui component. + * + * @typedef { import('../api/@ohos.data.unifiedDataChannel').default.Summary } Summary + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Import the Summary type object for ui component. + * + * @typedef { import('../api/@ohos.data.unifiedDataChannel').default.Summary } Summary + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type Summary = import('../api/@ohos.data.unifiedDataChannel').default.Summary; + +/** + * Import the UniformDataType type object for ui component. + * + * @typedef { import('../api/@ohos.data.uniformTypeDescriptor').default.UniformDataType } UniformDataType + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Import the UniformDataType type object for ui component. + * + * @typedef { import('../api/@ohos.data.uniformTypeDescriptor').default.UniformDataType } UniformDataType + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type UniformDataType = import('../api/@ohos.data.uniformTypeDescriptor').default.UniformDataType; + +/** + * Enum for Drag Result. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Enum for Drag Result. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +/** + * Enum for Drag Result. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare enum DragResult { + /** + * If the drag is successful, return DragResult.DRAG_SUCCESSFUL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If the drag is successful, return DragResult.DRAG_SUCCESSFUL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * If the drag is successful, return DragResult.DRAG_SUCCESSFUL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + DRAG_SUCCESSFUL = 0, + /** + * If drag fail, return DragResult.DRAG_FAILED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If drag fail, return DragResult.DRAG_FAILED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * If drag fail, return DragResult.DRAG_FAILED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + DRAG_FAILED = 1, + /** + * If drag action cancel, return DragResult.DRAG_CANCELED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If drag action cancel, return DragResult.DRAG_CANCELED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + DRAG_CANCELED = 2, + /** + * If node allow drop in, return DragResult.DROP_ENABLED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If node allow drop in, return DragResult.DROP_ENABLED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + DROP_ENABLED = 3, + /** + * If node don't allow drop in, return DragResult.DROP_DISABLED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If node don't allow drop in, return DragResult.DROP_DISABLED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + DROP_DISABLED = 4 +} + +/** + * Enum for BlendMode. + * Blend modes for compositing current component + * with overlapping content. Use overlapping content + * as dst, current component as src. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Enum for BlendMode. + * Blend modes for compositing current component + * with overlapping content. Use overlapping content + * as dst, current component as src. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum BlendMode { + /** + * Hybrid mode does not take effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Hybrid mode does not take effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NONE = 0, + /** + * Clear destination color covered by the source to 0. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Clear destination color covered by the source to 0. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + CLEAR = 1, + /** + * r = s + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SRC = 2, + /** + * r = d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DST = 3, + /** + * r = s + (1 - sa) * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s + (1 - sa) * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SRC_OVER = 4, + /** + * r = d + (1 - da) * s + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = d + (1 - da) * s + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DST_OVER = 5, + /** + * r = s * da + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * da + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SRC_IN = 6, + /** + * r = d * sa + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = d * sa + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DST_IN = 7, + /** + * r = s * (1 - da) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * (1 - da) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SRC_OUT = 8, + /** + * r = d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DST_OUT = 9, + /** + * r = s * da + d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * da + d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SRC_ATOP = 10, + /** + * r = d * sa + s * (1 - da) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = d * sa + s * (1 - da) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DST_ATOP = 11, + /** + * r = s * (1 - da) + d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * (1 - da) + d * (1 - sa) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + XOR = 12, + /** + * r = min(s + d, 1) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = min(s + d, 1) + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + PLUS = 13, + /** + * r = s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + MODULATE = 14, + /** + * r = s + d - s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s + d - s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SCREEN = 15, + /** + * multiply or screen, depending on destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * multiply or screen, depending on destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + OVERLAY = 16, + /** + * rc = s + d - max(s * da, d * sa), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * rc = s + d - max(s * da, d * sa), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DARKEN = 17, + /** + * rc = s + d - min(s * da, d * sa), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * rc = s + d - min(s * da, d * sa), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + LIGHTEN = 18, + /** + * brighten destination to reflect source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * brighten destination to reflect source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COLOR_DODGE = 19, + /** + * darken destination to reflect source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * darken destination to reflect source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COLOR_BURN = 20, + /** + * multiply or screen, depending on source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * multiply or screen, depending on source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + HARD_LIGHT = 21, + /** + * lighten or darken, depending on source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * lighten or darken, depending on source + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SOFT_LIGHT = 22, + /** + * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DIFFERENCE = 23, + /** + * rc = s + d - two(s * d), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * rc = s + d - two(s * d), ra = kSrcOver + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + EXCLUSION = 24, + /** + * r = s * (1 - da) + d * (1 - sa) + s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * r = s * (1 - da) + d * (1 - sa) + s * d + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + MULTIPLY = 25, + /** + * hue of source with saturation and luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * hue of source with saturation and luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + HUE = 26, + /** + * saturation of source with hue and luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * saturation of source with hue and luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SATURATION = 27, + /** + * hue and saturation of source with luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * hue and saturation of source with luminosity of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + COLOR = 28, + /** + * luminosity of source with hue and saturation of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * luminosity of source with hue and saturation of destination + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + LUMINOSITY = 29 +} + +/** + * Enum for BlendApplyType. + * Indicate how to apply specified blend mode to + * the view's content. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Enum for BlendApplyType. + * Indicate how to apply specified blend mode to + * the view's content. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum BlendApplyType { + /** + * Blend view's content in sequence over dst + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Blend view's content in sequence over dst + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + FAST = 0, + + /** + * Composite this views's contents into an + * offscreen image and then blend over dst + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Composite this views's contents into an + * offscreen image and then blend over dst + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + OFFSCREEN = 1, +} + +/** + * DragEvent object description + * + * @interface DragEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * DragEvent object description + * + * @interface DragEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +/** + * DragEvent object description + * + * @interface DragEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare interface DragEvent { + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getDisplayX(): number; + + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getDisplayY(): number; + + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getWindowX(): number; + + /** + * Y coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Y coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getWindowY(): number; + + /** + * X coordinate of the touch point relative to the left edge of the current window. in vp. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead DragEvent#getWindowX + */ + getX(): number; + + /** + * Y coordinate of the touch point relative to the left edge of the current window. in vp. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead DragEvent#getWindowY + */ + getY(): number; + + /** + * If copy is COPY, this DragEvent is a copy event. + * @type { DragBehavior } Operation, if use copy then set COPY, else set MOVE. + * @default COPY + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If copy is COPY, this DragEvent is a copy event. + * @type { DragBehavior } Operation, if use copy then set COPY, else set MOVE. + * @default COPY + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + dragBehavior: DragBehavior; + + /** + * If useCustomDropAnimation is true, System will not use drop animation. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * If useCustomDropAnimation is true, System will not use drop animation. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + useCustomDropAnimation: boolean; + + /** + * Set dragData into DragEvent. + * + * @param { UnifiedData } unifiedData - dragData. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set dragData into DragEvent. + * + * @param { UnifiedData } unifiedData - dragData. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setData(unifiedData: UnifiedData): void; + + /** + * Get dragData from DragEvent. + * + * @returns { UnifiedData } - get dragData. + * @throws { BusinessError } 190001 - Data not found. + * @throws { BusinessError } 190002 - Data error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get dragData from DragEvent. + * + * @returns { UnifiedData } - get dragData. + * @throws { BusinessError } 190001 - Data not found. + * @throws { BusinessError } 190002 - Data error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getData(): UnifiedData; + + /** + * Get dragData summary from DragEvent. + * + * @returns { Summary } - get Summary Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get dragData summary from DragEvent. + * + * @returns { Summary } - get Summary Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getSummary(): Summary; + + /** + * Set dragEvent result to DragEvent. + * + * @param { DragResult } dragResult - the return of dragEvent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set dragEvent result to DragEvent. + * + * @param { DragResult } dragResult - the return of dragEvent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Set dragEvent result to DragEvent. + * + * @param { DragResult } dragResult - the return of dragEvent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + setResult(dragResult: DragResult): void; + + /** + * Get dragEvent result from DragEvent. + * + * @returns { DragResult } - dragResult Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get dragEvent result from DragEvent. + * + * @returns { DragResult } - dragResult Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Get dragEvent result from DragEvent. + * + * @returns { DragResult } - dragResult Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getResult(): DragResult; + + /** + * Get the rectangle of drag window. + * + * @returns { Rectangle } - getPreview rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get the rectangle of drag window. + * + * @returns { Rectangle } - getPreview rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Get the rectangle of drag window. + * + * @returns { Rectangle } - getPreview rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getPreviewRect(): Rectangle; + + /** + * Get the x axis velocity of drag gesture. + * + * @returns { number } - get x axis velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the x axis velocity of drag gesture. + * + * @returns { number } - get x axis velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getVelocityX(): number; + + /** + * Get the y axis velocity of drag gesture. + * + * @returns { number } - get y axis velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the y axis velocity of drag gesture. + * + * @returns { number } - get y axis velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getVelocityY(): number; + + /** + * Get the velocity of drag gesture. + * + * @returns { number } - get velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the velocity of drag gesture. + * + * @returns { number } - get velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getVelocity(): number; + + /** + * Query the ModifierKey press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the keys of the ModifierKey. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + /** + * Query the ModifierKey press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the keys of the ModifierKey. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getModifierKeyState?(keys: Array): boolean; +} + +/** + * Import the IntentionCode type object for IntentionCode. + * + * @typedef { import('../api/@ohos.multimodalInput.intentionCode').IntentionCode } IntentionCode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Import the IntentionCode type object for IntentionCode. + * + * @typedef { import('../api/@ohos.multimodalInput.intentionCode').IntentionCode } IntentionCode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type IntentionCode = import('../api/@ohos.multimodalInput.intentionCode').IntentionCode; + +/** + * KeyEvent object description: + * + * @interface KeyEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * KeyEvent object description: + * + * @interface KeyEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * KeyEvent object description: + * + * @interface KeyEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface KeyEvent { + /** + * Type of a key. + * + * @type { KeyType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Type of a key. + * + * @type { KeyType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Type of a key. + * + * @type { KeyType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type: KeyType; + + /** + * Key code of a key + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Key code of a key + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Key code of a key + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + keyCode: number; + + /** + * Key value of a key. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Key value of a key. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Key value of a key. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + keyText: string; + + /** + * Type of the input device that triggers the current key, such as the keyboard or handle. + * + * @type { KeySource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Type of the input device that triggers the current key, such as the keyboard or handle. + * + * @type { KeySource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Type of the input device that triggers the current key, such as the keyboard or handle. + * + * @type { KeySource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + keySource: KeySource; + + /** + * Indicates the ID of the input device that triggers the current key. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates the ID of the input device that triggers the current key. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates the ID of the input device that triggers the current key. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + deviceId: number; + + /** + * Indicates the status of the key when the key is pressed. + * The value 1 indicates the pressed state, and the value 0 indicates the unpressed state. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates the status of the key when the key is pressed. + * The value 1 indicates the pressed state, and the value 0 indicates the unpressed state. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates the status of the key when the key is pressed. + * The value 1 indicates the pressed state, and the value 0 indicates the unpressed state. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + metaKey: number; + + /** + * Timestamp when the key was pressed. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Timestamp when the key was pressed. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Timestamp when the key was pressed. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + timestamp: number; + + /** + * Block event bubbling. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Block event bubbling. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Block event bubbling. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stopPropagation: () => void; + + /** + * Intention code of a key or modifier keys. + * + * @type { IntentionCode } + * @default IntentionCode.INTENTION_UNKNOWN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Intention code of a key or modifier keys. + * + * @type { IntentionCode } + * @default IntentionCode.INTENTION_UNKNOWN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + intentionCode: IntentionCode; + + /** + * Get the modifier keys press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the modifier keys. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + /** + * Get the modifier keys press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the modifier keys. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + getModifierKeyState?(keys: Array): boolean; + + /** + * Unicode of a key + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ + unicode?: number; +} + +/** + * Overlay module options + * + * @interface BindOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Overlay module options + * + * @interface BindOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface BindOptions { + /** + * Defines the background color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the background color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundColor?: ResourceColor; + + /** + * Callback function when overlay interface appears + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when overlay interface appears + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAppear?: () => void; + + /** + * Callback function when overlay interface exits + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when overlay interface exits + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onDisappear?: () => void; + + /** + * Callback function before overlay animation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillAppear?: () => void; + + /** + * Callback function before overlay popAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDisappear?: () => void; +} + +/** + * Component content cover dismiss + * + * @interface DismissContentCoverAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DismissContentCoverAction { + /** + * Defines content cover dismiss function + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: Callback; + + /** + * Defines content cover dismiss reason + * + * @type { DismissReason } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reason: DismissReason; +} + +/** + * Component content cover options + * + * @interface ContentCoverOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Component content cover options + * + * @interface ContentCoverOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ContentCoverOptions extends BindOptions { + /** + * Defines transition type + * + * @type { ?ModalTransition } + * @default ModalTransition.Default + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines transition type + * + * @type { ?ModalTransition } + * @default ModalTransition.Default + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + modalTransition?: ModalTransition, + + /** + * Callback function when the content cover interactive dismiss + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: Callback; + + /** + * Defines transition effect param + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; +} + +/** + * Component sheet title options + * + * @interface SheetTitleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Component sheet title options + * + * @interface SheetTitleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SheetTitleOptions { + /** + * Defines title text + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines title text + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + title: ResourceStr; + + /** + * Defines subtitle text + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines subtitle text + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + subtitle?: ResourceStr; +} + +/** + * Defines the sheet type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the sheet type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum SheetType { + /** + * Defines bottom sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines bottom sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BOTTOM = 0, + + /** + * Defines center sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines center sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CENTER = 1, + + /** + * Defines popup sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines popup sheet type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + POPUP = 2, +} + +/** + * Define the display mode of the sheet. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum SheetMode { + /** + * Sheet displays above all page levels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + OVERLAY = 0, + + /** + * Sheet displays within the current page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + EMBEDDED = 1, +} + +/** + * Define the scroll size mode of the sheet. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum ScrollSizeMode { + /** + * Sheet change scroll size after the slide ends. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLLOW_DETENT = 0, + + /** + * Sheet change scroll size during the sliding process. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CONTINUOUS = 1, +} + +/** + * Define the mode of sheet how to avoid keyboard. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare enum SheetKeyboardAvoidMode { + /** + * Sheet will not aovid keyboard. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + NONE = 0, + + /** + * Firstly sheet will avoid keyboard by changing its height. + * And then sheet will avoid by resizing after reaching its maximum height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + TRANSLATE_AND_RESIZE = 1, + + /** + * Sheet will only avoid keyboard by resizing the content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + RESIZE_ONLY = 2, + + /** + * Firstly sheet will avoid keyboard by changing its height. + * And then sheet will avoid keyboard by scrolling after reaching its maximum height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + TRANSLATE_AND_SCROLL = 3, +} + +/** + * Component sheet dismiss + * + * @interface SheetDismiss + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Component sheet dismiss + * + * @interface SheetDismiss + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SheetDismiss { + /** + * Defines sheet dismiss function + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines sheet dismiss function + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: () => void; +} + +/** + * Component sheet dismiss + * + * @interface DismissSheetAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DismissSheetAction { + + /** + * Defines sheet dismiss function + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: Callback; + + /** + * Dismiss reason type. + * + * @type { DismissReason } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reason: DismissReason; +} + +/** + * Defines sheet spring back action + * + * @interface SpringBackAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SpringBackAction { + /** + * Defines spring back function + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + springBack: Callback; +} + +/** + * Component sheet options + * + * @interface SheetOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Component sheet options + * + * @interface SheetOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SheetOptions extends BindOptions { + /** + * Defines sheet height + * + * @type { ?(SheetSize | Length) } + * @default Sheet.LARGE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines sheet height + * + * @type { ?(SheetSize | Length) } + * @default Sheet.LARGE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + height?: SheetSize | Length; + + /** + * Defines whether the control bar is displayed. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines whether the control bar is displayed. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + dragBar?: boolean; + + /** + * Defines sheet maskColor + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines sheet maskColor + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maskColor?: ResourceColor; + + /** + * Defines sheet detents + * + * @type { ?[(SheetSize | Length), (SheetSize | Length)?, (SheetSize | Length)?] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines sheet detents + * + * @type { ?[(SheetSize | Length), (SheetSize | Length)?, (SheetSize | Length)?] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + detents?: [(SheetSize | Length), (SheetSize | Length)?, (SheetSize | Length)?]; + + /** + * Defines sheet background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines sheet background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + blurStyle?: BlurStyle; + + /** + * Defines whether the close icon is displayed + * + * @type { ?(boolean | Resource) } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines whether the close icon is displayed + * + * @type { ?(boolean | Resource) } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showClose?: boolean | Resource; + + /** + * Defines the sheet prefer type + * + * @type { ?(SheetType.CENTER | SheetType.POPUP) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the sheet prefer type + * + * @type { ?SheetType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preferType?: SheetType; + + /** + * Defines the sheet title + * + * @type { ?(SheetTitleOptions | CustomBuilder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the sheet title + * + * @type { ?(SheetTitleOptions | CustomBuilder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + title?: SheetTitleOptions | CustomBuilder; + + /** + * Callback function when the sheet interactive dismiss + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Callback function when the sheet interactive dismiss + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shouldDismiss?: (sheetDismiss: SheetDismiss) => void; + + /** + * Callback function when the sheet will dismiss + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: Callback; + + /** + * Sheet springs back callback when dismiss + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillSpringBackWhenDismiss?: Callback; + + /** + * Set whether interaction is allowed outside the sheet + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set whether interaction is allowed outside the sheet + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableOutsideInteractive?: boolean; + + /** + * Defines the sheet's width. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width?: Dimension; + + /** + * Defines the sheet's border width. + * + * @type { ?(Dimension | EdgeWidths | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderWidth?: Dimension | EdgeWidths | LocalizedEdgeWidths; + + /** + * Defines the sheet's border color. + * + * @type { ?(ResourceColor | EdgeColors | LocalizedEdgeColors) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderColor?: ResourceColor | EdgeColors | LocalizedEdgeColors; + + /** + * Defines the sheet's border style. + * + * @type { ?(BorderStyle | EdgeStyles) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderStyle?: BorderStyle | EdgeStyles; + + /** + * Defines the sheet's shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Called when height of the sheet is changed + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onHeightDidChange?: Callback; + + /** + * Determine the level sheet shows, whether sheet should be displayed within the page + * + * @type { ?SheetMode } + * @default SheetMode.OVERLAY + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + mode?: SheetMode; + + /** + * Determine sheet scroll size mode. + * + * @type { ?ScrollSizeMode } + * @default ScrollSizeMode.FELLOW_DETEND + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scrollSizeMode?: ScrollSizeMode; + + /** + * Called when detents of the sheet changed + * + * @type { ?Callback } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDetentsDidChange?: Callback; + + /** + * Called when width of the sheet changed + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWidthDidChange?: Callback; + + /** + * Called when the sheet type changed + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onTypeDidChange?: Callback; + + /** + * The UIContext that the sheet belongs to + * + * @type { ?UIContext } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + uiContext?: UIContext; + + /** + * Determine the mode of sheet how to avoid keyboard. + * + * @type { ?SheetKeyboardAvoidMode } + * @default SheetKeyboardAvoidMode.TRANSLATE_AND_SCROLL + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + keyboardAvoidMode?: SheetKeyboardAvoidMode; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the sheet's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; + + /** + * Sets the position offset of the bindSheet. + * + * @type { ?Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 14 + */ + offset?: Position +} + +/** + * Component State Styles. + * + * @interface StateStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Component State Styles. + * + * @interface StateStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Component State Styles. + * + * @interface StateStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Component State Styles. + * + * @interface StateStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface StateStyles { + /** + * Defines normal state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines normal state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines normal state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines normal state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + normal?: any; + + /** + * Defines pressed state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines pressed state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines pressed state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines pressed state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + pressed?: any; + + /** + * Defines disabled state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines disabled state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines disabled state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines disabled state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + disabled?: any; + + /** + * Defines focused state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines focused state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines focused state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines focused state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + focused?: any; + + /** + * Defines clicked state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines clicked state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines clicked state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines clicked state styles. + * + * @type { ?any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + clicked?: any; + + /** + * Defines selected state styles. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines selected state styles. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selected?: object; +} + +/** + * Defines the options of popup message. + * + * @interface PopupMessageOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of popup message. + * + * @interface PopupMessageOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PopupMessageOptions { + /** + * Sets the color of popup text. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the color of popup text. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textColor?: ResourceColor; + + /** + * Sets the font of popup text. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the font of popup text. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font?: Font; +} + +/** + * Dismiss reason type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum DismissReason { + /** + * Press back + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PRESS_BACK = 0, + + /** + * Touch component outside + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TOUCH_OUTSIDE = 1, + + /** + * Close button + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CLOSE_BUTTON = 2, + + /** + * Slide down + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SLIDE_DOWN = 3 +} + +/** + * Component popup dismiss + * + * @interface DismissPopupAction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DismissPopupAction { + /** + * Defines popup dismiss function + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dismiss: Callback; + + /** + * Defines popup dismiss reason + * + * @type { DismissReason } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + reason: DismissReason; +} + +/** + * Defines the popup options. + * + * @interface PopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the popup options. + * + * @interface PopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the popup options. + * + * @interface PopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PopupOptions { + /** + * Information in the pop-up window. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Information in the pop-up window. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Information in the pop-up window. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + message: string; + + /** + * placement On Top + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 10 + * @useinstead PopupOptions#placement + */ + placementOnTop?: boolean; + + /** + * The placement of popup. + * Supports all positions defined in Placement. + * + * @type { ?Placement } + * @default Placement.Bottom + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The placement of popup. + * Supports all positions defined in Placement. + * + * @type { ?Placement } + * @default Placement.Bottom + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placement?: Placement; + + /** + * The first button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The first button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The first button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + primaryButton?: { + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string; + + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + action: () => void; + }; + + /** + * The second button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The second button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The second button. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + secondaryButton?: { + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Button text value + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string; + + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * action + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + action: () => void; + }; + + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onStateChange?: (event: { + /** + * is Visible. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * is Visible. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + isVisible: boolean + }) => void; + + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowOffset?: Length; + + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showInSubWindow?: boolean; + + /** + * The mask to block gesture events of popup. + * When mask is set false, gesture events are not blocked. + * When mask is set true, gesture events are blocked and mask color is transparent. + * + * @type { ?(boolean | { color: ResourceColor }) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The mask to block gesture events of popup. + * When mask is set false, gesture events are not blocked. + * When mask is set true, gesture events are blocked and mask color is transparent. + * + * @type { ?(boolean | { color: ResourceColor }) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + mask?: boolean | { color: ResourceColor }; + + /** + * Sets the options of popup message. + * + * @type { ?PopupMessageOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the options of popup message. + * + * @type { ?PopupMessageOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + messageOptions?: PopupMessageOptions + + /** + * Sets the space of between the popup and target. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the space of between the popup and target. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + targetSpace?: Length + + /** + * whether show arrow + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * whether show arrow + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableArrow?: boolean; + /** + * Sets the position offset of the popup. + * + * @type { ?Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the position offset of the popup. + * + * @type { ?Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Position + + /** + * Set the background color of the popup. + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the background color of the popup. + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + popupColor?: Color | string | Resource | number; + + /** + * Whether hide popup when click mask + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether hide popup when click mask + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + autoCancel?: boolean; + + /** + * Set the width of the popup. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the width of the popup. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width?: Dimension; + + /** + * The position of the sharp corner of popup. + * + * @type { ?ArrowPointPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The position of the sharp corner of popup. + * + * @type { ?ArrowPointPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowPointPosition?: ArrowPointPosition; + + /** + * The width of the arrow. + * + * @type { ?Dimension } + * @default 16.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The width of the arrow. + * + * @type { ?Dimension } + * @default 16.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowWidth?: Dimension; + + /** + * The height of the arrow. + * + * @type { ?Dimension } + * @default 8.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The height of the arrow. + * + * @type { ?Dimension } + * @default 8.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowHeight?: Dimension; + + /** + * The round corners of the popup. + * + * @type { ?Dimension } + * @default 20.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The round corners of the popup. + * + * @type { ?Dimension } + * @default 20.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius?: Dimension; + + /** + * The style of popup Shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @default ShadowStyle.OUTER_DEFAULT_MD. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The style of popup Shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @default ShadowStyle.OUTER_DEFAULT_MD. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Defines popup background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines popup background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Defines the transition effect of popup opening and closing + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Callback function when the popup interactive dismiss + * + * @type { ?(boolean | Callback) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: boolean | Callback; + + /** + * Determine if it is compatible popup's half folded. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHoverMode?: boolean; + + /** + * Determine if popup can follow the target node when it has rotation or scale. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + followTransformOfTarget?: boolean; +} + +/** + * Defines the custom popup options. + * + * @interface CustomPopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the custom popup options. + * + * @interface CustomPopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the custom popup options. + * + * @interface CustomPopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface CustomPopupOptions { + /** + * builder of popup + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * builder of popup + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * builder of popup + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + builder: CustomBuilder; + + /** + * placement of popup + * + * @type { ?Placement } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * placement of popup + * + * @type { ?Placement } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * placement of popup + * + * @type { ?Placement } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placement?: Placement; + + /** + * mask color of popup + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + * @useinstead CustomPopupOptions#mask + */ + maskColor?: Color | string | Resource | number; + + /** + * background color of popup + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * background color of popup + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * background color of popup + * + * @type { ?(Color | string | Resource | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popupColor?: Color | string | Resource | number; + + /** + * whether show arrow + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * whether show arrow + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * whether show arrow + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableArrow?: boolean; + + /** + * whether hide popup when click mask + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * whether hide popup when click mask + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * whether hide popup when click mask + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + autoCancel?: boolean; + + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * on State Change + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onStateChange?: (event: { + /** + * is Visible. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * is Visible. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + isVisible: boolean + }) => void; + + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The offset of the sharp corner of popup. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowOffset?: Length; + + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showInSubWindow?: boolean; + + /** + * The mask to block gesture events of popup. + * When mask is set false, gesture events are not blocked. + * When mask is set true, gesture events are blocked and mask color is transparent. + * + * @type { ?(boolean | { color: ResourceColor }) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The mask to block gesture events of popup. + * When mask is set false, gesture events are not blocked. + * When mask is set true, gesture events are blocked and mask color is transparent. + * + * @type { ?(boolean | { color: ResourceColor }) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + mask?: boolean | { color: ResourceColor }; + + /** + * Sets the space of between the popup and target. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the space of between the popup and target. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + targetSpace?: Length + + /** + * Sets the position offset of the popup. + * + * @type { ?Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the position offset of the popup. + * + * @type { ?Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Position + + /** + * Set the width of the popup. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the width of the popup. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width?: Dimension; + + /** + * The position of the sharp corner of popup. + * + * @type { ?ArrowPointPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The position of the sharp corner of popup. + * + * @type { ?ArrowPointPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowPointPosition?: ArrowPointPosition; + + /** + * The width of the arrow. + * + * @type { ?Dimension } + * @default 16.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The width of the arrow. + * + * @type { ?Dimension } + * @default 16.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowWidth?: Dimension; + + /** + * The height of the arrow. + * + * @type { ?Dimension } + * @default 8.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The height of the arrow. + * + * @type { ?Dimension } + * @default 8.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + arrowHeight?: Dimension; + + /** + * The round corners of the popup. + * + * @type { ?Dimension } + * @default 20.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The round corners of the popup. + * + * @type { ?Dimension } + * @default 20.0_vp. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius?: Dimension; + + /** + * The style of popup Shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @default ShadowStyle.OUTER_DEFAULT_MD. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The style of popup Shadow. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @default ShadowStyle.OUTER_DEFAULT_MD. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shadow?: ShadowOptions | ShadowStyle; + + /** + * Defines popup background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines popup background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Set popup focusable + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set popup focusable + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + focusable?: boolean; + + /** + * Defines the transition effect of popup opening and closing + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Callback function when the popup interactive dismiss + * + * @type { ?(boolean | Callback) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDismiss?: boolean | Callback; + + /** + * Determine if it is compatible popup's half folded. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHoverMode?: boolean; + + /** + * Determine if popup can follow the target node when it has rotation or scale. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + followTransformOfTarget?: boolean; +} + +/** + * Defines the menu preview mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the menu preview mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum MenuPreviewMode { + /** + * No preview content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * No preview content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NONE = 0, + /** + * Defines image type preview content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines image type preview content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IMAGE = 1 +} + +/** + * Defines the animator range of start and end property. + * + * @typedef { [from: T, to: T] } AnimationRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the animator range of start and end property. + * + * @typedef { [from: T, to: T] } AnimationRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type AnimationRange = [from: T, to: T]; + +/** + * Defines the ContextMenu's preview animator options. + * + * @interface ContextMenuAnimationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the ContextMenu's preview animator options. + * + * @interface ContextMenuAnimationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface ContextMenuAnimationOptions { + /** + * Sets the start animator scale and end animator scale. + * + * @type { ?AnimationRange } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets the start animator scale and end animator scale. + * + * @type { ?AnimationRange } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scale?: AnimationRange; + /** + * Defines the transition effect of menu preview opening and closing. + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Sets the scale start and end animator of the image displayed before the custom builder preview is displayed. + * + * @type { ?AnimationRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + hoverScale?: AnimationRange; +} + +/** + * Defines the context menu options. + * + * @interface ContextMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the context menu options. + * + * @interface ContextMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ContextMenuOptions { + /** + * Sets the position offset of the context menu window. + * + * @type { ?Position } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the position offset of the context menu window. + * + * @type { ?Position } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: Position; + + /** + * Sets the placement of the context menu window. + * + * @type { ?Placement } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the placement of the context menu window. + * + * @type { ?Placement } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placement?: Placement; + + /** + * whether show arrow belong to the menu, default: false, not show arrow + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * whether show arrow belong to the menu, default: false, not show arrow + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableArrow?: boolean; + + /** + * The horizontal offset to the left of menu or vertical offset to the top of menu + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The horizontal offset to the left of menu or vertical offset to the top of menu + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowOffset?: Length; + + /** + * The preview content of context menu. + * + * @type { ?(MenuPreviewMode | CustomBuilder) } + * @default MenuPreviewMode.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The preview content of context menu. + * + * @type { ?(MenuPreviewMode | CustomBuilder) } + * @default MenuPreviewMode.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preview?: MenuPreviewMode | CustomBuilder; + + /** + * Defines the border radius of menu. + * + * @type { ?(Length | BorderRadiuses | LocalizedBorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderRadius?: Length | BorderRadiuses | LocalizedBorderRadiuses; + + /** + * Callback function when the context menu appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when the context menu appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAppear?: () => void; + + /** + * Callback function when the context menu disappear. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when the context menu disappear. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onDisappear?: () => void; + + /** + * Callback function before the context menu animation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Callback function before the context menu animation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + aboutToAppear?: () => void; + + /** + * Callback function before the context menu popAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Callback function before the context menu popAnimation starts. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + aboutToDisappear?: () => void; + + /** + * The margin of menu's layoutRegion. + * + * @type { ?Margin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + layoutRegionMargin?: Margin; + + /** + * The preview animator options. + * + * @type { ?ContextMenuAnimationOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The preview animator options. + * + * @type { ?ContextMenuAnimationOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + previewAnimationOptions?: ContextMenuAnimationOptions; + + /** + * Defines the menu's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the menu's background color + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundColor?: ResourceColor; + + /** + * Defines menu background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines menu background blur Style + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Defines the transition effect of menu opening and closing. + * + * @type { ?TransitionEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition?: TransitionEffect; + + /** + * Determine if it is compatible menu's half folded. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHoverMode?: boolean; +} + +/** + * Defines the menu options. + * + * @interface MenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the menu options. + * + * @interface MenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MenuOptions extends ContextMenuOptions { + /** + * Sets the title of the menu window. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the title of the menu window. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + title?: ResourceStr; + + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Whether to display in the sub window. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showInSubWindow?: boolean; +} + +/** + * Defines the ProgressMask class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the ProgressMask class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class ProgressMask { + /** + * constructor. + * + * @param { number } value - indicates the current value of the progress. + * @param { number } total - indicates the total value of the progress. + * @param { ResourceColor } color - indicates the color of the mask. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @param { number } value - indicates the current value of the progress. + * @param { number } total - indicates the total value of the progress. + * @param { ResourceColor } color - indicates the color of the mask. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(value: number, total: number, color: ResourceColor); + + /** + * Update the current value of the progress. + * + * @param { number } value - indicates the current value of the progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Update the current value of the progress. + * + * @param { number } value - indicates the current value of the progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + updateProgress(value: number): void; + + /** + * Update the color of the mask. + * + * @param { ResourceColor } value - indicates the color of the mask. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Update the color of the mask. + * + * @param { ResourceColor } value - indicates the color of the mask. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + updateColor(value: ResourceColor): void; + + /** + * Enable the breathe animation of mask. + * + * @param { boolean } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableBreathingAnimation(value: boolean): void; +} + +/** + * Defines TouchTestInfo class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines TouchTestInfo class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TouchTestInfo { + /** + * Get the X-coordinate relative to the window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the X-coordinate relative to the window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + windowX: number; + + /** + * Get the Y-coordinate relative to the window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the Y-coordinate relative to the window. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + windowY: number; + + /** + * Get the X-coordinate relative to the current component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the X-coordinate relative to the current component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + parentX: number; + + /** + * Get the Y-coordinate relative to the current component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the Y-coordinate relative to the current component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + parentY: number; + + /** + * Get the X-coordinate relative to the sub component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the X-coordinate relative to the sub component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + x: number; + + /** + * Get the Y-coordinate relative to the sub component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the Y-coordinate relative to the sub component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + y: number; + + /** + * Get the rectangle of sub component. + * + * @type { RectResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the rectangle of sub component. + * + * @type { RectResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + rect: RectResult; + + /** + * Get the name of sub component. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the name of sub component. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id: string; +} + +/** + * Defines TouchResult class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines TouchResult class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TouchResult { + /** + * Defines the touch test strategy. + * + * @type { TouchTestStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the touch test strategy. + * + * @type { TouchTestStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + strategy: TouchTestStrategy; + + /** + * Defines the component's name. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the component's name. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id?: string; +} + +/** + * Set the edge blur effect distance of the corresponding defense line of the component + * When the component expand out, no re-layout is triggered + * + * @interface PixelStretchEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Set the edge blur effect distance of the corresponding defense line of the component + * When the component expand out, no re-layout is triggered + * + * @interface PixelStretchEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PixelStretchEffectOptions { + /** + * top property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * top property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + top?: Length; + + /** + * bottom property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * bottom property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + bottom?: Length; + + /** + * left property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * left property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + left?: Length; + + /** + * right property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * right property. value range (-∞, ∞) + * If value > 0, expand outward elements. Else first shrink by value and then expand outward pixels. + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + right?: Length; +} + +/** + * Defines the click effect. + * + * @interface ClickEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the click effect. + * + * @interface ClickEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ClickEffect { + /** + * Set the click effect level. + * + * @type { ClickEffectLevel } + * @default ClickEffectLevel.Light + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set the click effect level. + * + * @type { ClickEffectLevel } + * @default ClickEffectLevel.Light + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + level: ClickEffectLevel; + + /** + * Set scale number. + * This default scale is same as the scale of click effect level. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set scale number. + * This default scale is same as the scale of click effect level. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + scale?: number; +} + +/** + * Defines the fadingEdge options. + * + * @typedef FadingEdgeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface FadingEdgeOptions { + /** + * The length of FadingEdge. + * + * @type { LengthMetrics } + * @default 32vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + fadingEdgeLength?: LengthMetrics; +} + +/** + * Define nested scroll options + * + * @interface NestedScrollOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Define nested scroll options + * + * @interface NestedScrollOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface NestedScrollOptions { + /** + * Set NestedScrollMode when the scrollable component scrolls forward + * + * @type { NestedScrollMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set NestedScrollMode when the scrollable component scrolls forward + * + * @type { NestedScrollMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollForward: NestedScrollMode; + + /** + * Set NestedScrollMode when the scrollable component scrolls backward + * + * @type { NestedScrollMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set NestedScrollMode when the scrollable component scrolls backward + * + * @type { NestedScrollMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBackward: NestedScrollMode; +} + +/** + * Defines the menu element. + * + * @interface MenuElement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the menu element. + * + * @interface MenuElement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the menu element. + * + * @interface MenuElement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MenuElement { + /** + * Sets the value of the menu element. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the value of the menu element. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the value of the menu element. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: ResourceStr; + + /** + * Sets the icon of the menu element. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the icon of the menu element. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + icon?: ResourceStr; + + /** + * Sets the symbol of the menu element. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolIcon?: SymbolGlyphModifier; + + /** + * If the value is true, the menu element is available and can respond to operations such as clicking. + * If the value is false, the menu element is not available and click operations are not responded. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * If the value is true, the menu element is available and can respond to operations such as clicking. + * If the value is false, the menu element is not available and click operations are not responded. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enabled?: boolean; + + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + action: () => void; +} + +/** + * Defines the attribute modifier. + * + * @interface AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the attribute modifier. + * + * @interface AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface AttributeModifier { + + /** + * Defines the normal update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the normal update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyNormalAttribute?(instance: T) : void; + + /** + * Defines the pressed update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the pressed update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyPressedAttribute?(instance: T) : void; + + /** + * Defines the focused update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the focused update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyFocusedAttribute?(instance: T) : void; + + /** + * Defines the disabled update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the disabled update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyDisabledAttribute?(instance: T) : void; + + /** + * Defines the selected update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the selected update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applySelectedAttribute?(instance: T) : void; +} + +/** + * Defines the content modifier. + * + * @interface ContentModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ContentModifier { + + /** + * Defining applyContent function. + * + * @returns { WrappedBuilder<[T]> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyContent(): WrappedBuilder<[T]> +} + +/** + * Defines the common configuration. + * + * @interface CommonConfiguration + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CommonConfiguration { + + /** + * If the value is true, the contentModifier is available and can respond to operations such as triggerChange. + * If it is set to false, triggerChange operations are not responded. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enabled: boolean, + + /** + * Obtains the contentModifier instance object + * + * @type { ContentModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentModifier: ContentModifier +} + +/** + * Outline Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Outline Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum OutlineStyle { + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SOLID = 0, + + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DASHED = 1, + + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DOTTED = 2, +} + +/** + * Defines the drag preview mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Defines the drag preview mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum DragPreviewMode { + /** + * Default preview mode, let system process preview scale. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Default preview mode, let system process preview scale. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + AUTO = 1, + /** + * Disable system scale to preview panel + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Disable system scale to preview panel + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + DISABLE_SCALE = 2, + /** + * Enable the default shadow effect of preview. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ENABLE_DEFAULT_SHADOW = 3, + /** + * Enable the default radius effect of preview. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ENABLE_DEFAULT_RADIUS = 4, +} + +/** + * Define the menu pop-up policy + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum MenuPolicy { + /** + * Default value. The default logic of whether to pop up a menu depends on the scene. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DEFAULT = 0, + + /** + * Hide pop up menu. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HIDE = 1, + + /** + * Show pop up menu. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SHOW = 2, +} + +/** + * ImageModifier + * + * @typedef { import('../api/arkui/ImageModifier').ImageModifier } ImageModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ImageModifier = import('../api/arkui/ImageModifier').ImageModifier; + +/** + * SymbolGlyphModifier + * + * @typedef {import('../api/arkui/SymbolGlyphModifier').SymbolGlyphModifier} SymbolGlyphModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type SymbolGlyphModifier = import('../api/arkui/SymbolGlyphModifier').SymbolGlyphModifier; + +/** + * Defines the preview options. + * + * @interface DragPreviewOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Defines the preview options. + * + * @interface DragPreviewOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface DragPreviewOptions { + /** + * Drag preview mode. + * + * @type { ?DragPreviewMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Drag preview mode. + * + * @type { ?(DragPreviewMode | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + mode?: DragPreviewMode | Array; + + /** + * Drag preview modifier. + * + * @type { ?ImageModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + modifier?: ImageModifier; + + /** + * The flag for number showing. + * + * @type { ?(boolean | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + numberBadge?: boolean | number; +} + +/** + * Defines the drag options. + * + * @interface DragInteractionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface DragInteractionOptions { + /** + * Define whether to gather selected nodes in grid or list. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + isMultiSelectionEnabled?: boolean; + + /** + * Define whether to execute animation before preview floating. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + defaultAnimationBeforeLifting?: boolean; +} + +/** + * Define the options of invert + * + * @interface InvertOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Define the options of invert + * + * @interface InvertOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface InvertOptions { + + /** + * Defines the low value of threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the low value of threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + low: number; + + /** + * Defines the high value of threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the high value of threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + high: number; + + /** + * Defines the threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the threshold + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + threshold: number; + + /** + *Defines the threshold range + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + *Defines the threshold range + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + thresholdRange: number; +} + +/** + * Import the CircleShape type object for common method. + * + * @typedef { import('../api/@ohos.arkui.shape').CircleShape } CircleShape + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type CircleShape = import('../api/@ohos.arkui.shape').CircleShape; + +/** + * Import the EllipseShape type object for common method. + * + * @typedef { import('../api/@ohos.arkui.shape').EllipseShape } EllipseShape + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type EllipseShape = import('../api/@ohos.arkui.shape').EllipseShape; + +/** + * Import the PathShape type object for common method. + * + * @typedef { import('../api/@ohos.arkui.shape').PathShape } PathShape + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type PathShape = import('../api/@ohos.arkui.shape').PathShape; + +/** + * Import the RectShape type object for common method. + * + * @typedef { import('../api/@ohos.arkui.shape').RectShape } RectShape + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type RectShape = import('../api/@ohos.arkui.shape').RectShape; + +/** + * Defines the type that can be undefined. + * + * @typedef { T | undefined } Optional + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type Optional = T | undefined; + +/** + * CommonMethod. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * CommonMethod. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CommonMethod. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CommonMethod. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CommonMethod { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 9 + */ + constructor(); + + /** + * Sets the width of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the width of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the width of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the width of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width(value: Length): T; + + /** + * Sets the height of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the height of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the height of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the height of the current component. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height(value: Length): T; + + /** + * Sets the drawModifier of the current component. + * + * @param { DrawModifier | undefined } modifier - drawModifier used to draw, or undefined if it is not available. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + drawModifier(modifier: DrawModifier | undefined): T; + + /** + * Sets the custom property of the current component. + * + * @param { string } name - the name of the custom property. + * @param { Optional } value - the value of the custom property. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customProperty(name: string, value: Optional): T; + + /** + * Expands the safe area. + * + * @param { Array } types - Indicates the types of the safe area. + * @param { Array } edges - Indicates the edges of the safe area. + * @returns { T } The component instance. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Expands the safe area. + * + * @param { Array } types - Indicates the types of the safe area. + * @param { Array } edges - Indicates the edges of the safe area. + * @returns { T } The component instance. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + expandSafeArea(types?: Array, edges?: Array): T; + + /** + * Sets the response region of the current component. + * + * @param { Array | Rectangle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the response region of the current component. + * + * @param { Array | Rectangle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the response region of the current component. + * + * @param { Array | Rectangle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the response region of the current component. + * + * @param { Array | Rectangle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + responseRegion(value: Array | Rectangle): T; + + /** + * Sets the mouse response region of current component + * + * @param { Array | Rectangle } value + * @returns { T } return the component attribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the mouse response region of current component + * + * @param { Array | Rectangle } value + * @returns { T } return the component attribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + mouseResponseRegion(value: Array | Rectangle): T; + + /** + * The size of the current component. + * + * @param { SizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The size of the current component. + * + * @param { SizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The size of the current component. + * + * @param { SizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The size of the current component. + * + * @param { SizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + size(value: SizeOptions): T; + + /** + * constraint Size: + * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. + * + * @param { ConstraintSizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * constraint Size: + * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. + * + * @param { ConstraintSizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * constraint Size: + * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. + * + * @param { ConstraintSizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * constraint Size: + * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. + * + * @param { ConstraintSizeOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constraintSize(value: ConstraintSizeOptions): T; + + /** + * Sets the touchable of the current component + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead hitTestBehavior + */ + touchable(value: boolean): T; + + /** + * Defines the component's hit test behavior in touch events. + * + * @param { HitTestMode } value - the hit test mode. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Defines the component's hit test behavior in touch events. + * + * @param { HitTestMode } value - the hit test mode. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines the component's hit test behavior in touch events. + * + * @param { HitTestMode } value - the hit test mode. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hitTestBehavior(value: HitTestMode): T; + + /** + * Defines the pre-touch test of sub component in touch events. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines the pre-touch test of sub component in touch events. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onChildTouchTest(event: (value: Array) => TouchResult): T; + + /** + * layout Weight + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * layout Weight + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * layout Weight + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * layout Weight + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + layoutWeight(value: number | string): T; + + /** + * chain Weight + * + * @param { ChainWeightOptions } chainWeight + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + chainWeight(chainWeight: ChainWeightOptions): T; + + /** + * Inner margin. + * + * @param { Padding | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Inner margin. + * + * @param { Padding | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Inner margin. + * + * @param { Padding | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Inner margin. + * + * @param { Padding | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Inner margin. + * + * @param { Padding | Length | LocalizedPadding } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + padding(value: Padding | Length | LocalizedPadding): T; + + /** + * Inner safeArea padding. + * + * @param { Padding | LengthMetrics | LocalizedPadding } paddingValue - Indicates safeArea padding values + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + safeAreaPadding(paddingValue: Padding | LengthMetrics | LocalizedPadding): T; + + /** + * Outer Margin. + * + * @param { Margin | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Outer Margin. + * + * @param { Margin | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Outer Margin. + * + * @param { Margin | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Outer Margin. + * + * @param { Margin | Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Outer Margin. + * + * @param { Margin | Length | LocalizedMargin } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + margin(value: Margin | Length | LocalizedMargin): T; + + /** + * Background. + * + * @param { CustomBuilder } builder + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Background. + * + * @param { CustomBuilder } builder + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + background(builder: CustomBuilder, options?: { align?: Alignment }): T; + + /** + * Background color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundColor(value: ResourceColor): T; + + /** + * PixelRound + * + * @param { PixelRoundPolicy } value - indicates the pixel round policy. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + pixelRound(value: PixelRoundPolicy): T; + + /** + * Background image + * src: Image address url + * + * @param { ResourceStr } src + * @param { ImageRepeat } repeat + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background image + * src: Image address url + * + * @param { ResourceStr } src + * @param { ImageRepeat } repeat + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background image + * src: Image address url + * + * @param { ResourceStr } src + * @param { ImageRepeat } repeat + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background image + * src: Image address url + * + * @param { ResourceStr } src + * @param { ImageRepeat } repeat + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Background image + * src: Image address url + * + * @param { ResourceStr | PixelMap } src + * @param { ImageRepeat } repeat + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + backgroundImage(src: ResourceStr | PixelMap, repeat?: ImageRepeat): T; + + /** + * Background image size + * + * @param { SizeOptions | ImageSize } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background image size + * + * @param { SizeOptions | ImageSize } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background image size + * + * @param { SizeOptions | ImageSize } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background image size + * + * @param { SizeOptions | ImageSize } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundImageSize(value: SizeOptions | ImageSize): T; + + /** + * Background image position + * x:Horizontal coordinate;y:Vertical axis coordinate. + * + * @param { Position | Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background image position + * x:Horizontal coordinate;y:Vertical axis coordinate. + * + * @param { Position | Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background image position + * x:Horizontal coordinate;y:Vertical axis coordinate. + * + * @param { Position | Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background image position + * x:Horizontal coordinate;y:Vertical axis coordinate. + * + * @param { Position | Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundImagePosition(value: Position | Alignment): T; + + /** + * Background blur style. + * blurStyle:Blur style type. + * + * @param { BlurStyle } value + * @param { BackgroundBlurStyleOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background blur style. + * blurStyle:Blur style type. + * + * @param { BlurStyle } value + * @param { BackgroundBlurStyleOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background blur style. + * blurStyle:Blur style type. + * + * @param { BlurStyle } value + * @param { BackgroundBlurStyleOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundBlurStyle(value: BlurStyle, options?: BackgroundBlurStyleOptions): T; + + /** + * options:background effect options. + * + * @param { BackgroundEffectOptions } options - options indicates the effect options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * options:background effect options. + * + * @param { BackgroundEffectOptions } options - options indicates the effect options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundEffect(options: BackgroundEffectOptions): T; + + /** + * Background image resizable. + * value:resizable options + * + * @param { ResizableOptions } value - Indicates the resizable options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundImageResizable(value: ResizableOptions): T; + + /** + * Foreground effect. + * + * @param { ForegroundEffectOptions } options - options indicates the effect options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + foregroundEffect(options: ForegroundEffectOptions): T; + + + /** + * Unified visual effect interface. + * + * @param { VisualEffect } effect - Visual effect parameters. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + visualEffect(effect: VisualEffect): T; + + /** + * Filter applied to the background layer of the component. + * + * @param { Filter } filter - Filter effect parameters. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backgroundFilter(filter: Filter): T; + + /** + * Filter applied to the foreground layer of the component. + * + * @param { Filter } filter - Filter effect parameters. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + foregroundFilter(filter: Filter): T; + + /** + * Filter applied to the compositing layer of the component. + * + * @param { Filter } filter - Filter effect parameters. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + compositingFilter(filter: Filter): T; + + /** + * Foreground blur style. + * blurStyle:Blur style type. + * + * @param { BlurStyle } value + * @param { ForegroundBlurStyleOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Foreground blur style. + * blurStyle:Blur style type. + * + * @param { BlurStyle } value + * @param { ForegroundBlurStyleOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + foregroundBlurStyle(value: BlurStyle, options?: ForegroundBlurStyleOptions): T; + + /** + * Opacity + * + * @param { number | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Opacity + * + * @param { number | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Opacity + * + * @param { number | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Opacity + * + * @param { number | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + opacity(value: number | Resource): T; + + /** + * Opacity + * width:Border width;color:Border color;radius:Border radius; + * + * @param { BorderOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Opacity + * width:Border width;color:Border color;radius:Border radius; + * + * @param { BorderOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Opacity + * width:Border width;color:Border color;radius:Border radius; + * + * @param { BorderOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Opacity + * width:Border width;color:Border color;radius:Border radius; + * + * @param { BorderOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + border(value: BorderOptions): T; + + /** + * Border style + * + * @param { BorderStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Border style + * + * @param { BorderStyle | EdgeStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border style + * + * @param { BorderStyle | EdgeStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border style + * + * @param { BorderStyle | EdgeStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + borderStyle(value: BorderStyle | EdgeStyles): T; + + /** + * Border width + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Border width + * + * @param { Length | EdgeWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border width + * + * @param { Length | EdgeWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border width + * + * @param { Length | EdgeWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border width + * + * @param { Length | EdgeWidths | LocalizedEdgeWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + borderWidth(value: Length | EdgeWidths | LocalizedEdgeWidths): T; + + /** + * Border color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Border color + * + * @param { ResourceColor | EdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border color + * + * @param { ResourceColor | EdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border color + * + * @param { ResourceColor | EdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border color + * + * @param { ResourceColor | EdgeColors | LocalizedEdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + borderColor(value: ResourceColor | EdgeColors | LocalizedEdgeColors): T; + + /** + * Border radius + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Border radius + * + * @param { Length | BorderRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border radius + * + * @param { Length | BorderRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border radius + * + * @param { Length | BorderRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Border radius + * + * @param { Length | BorderRadiuses | LocalizedBorderRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + borderRadius(value: Length | BorderRadiuses | LocalizedBorderRadiuses): T; + + /** + * Border image + * + * @param { BorderImageOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border image + * + * @param { BorderImageOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border image + * + * @param { BorderImageOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + borderImage(value: BorderImageOption): T; + + /** + * Outline + * width:Outline width;color:Outline color;radius:Outline radius;style:Outline style; + * + * @param { OutlineOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Outline + * width:Outline width;color:Outline color;radius:Outline radius;style:Outline style; + * + * @param { OutlineOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outline(value: OutlineOptions): T; + + /** + * Outline style + * The input parameter default value is OutlineStyle.SOLID + * + * @param { OutlineStyle | EdgeOutlineStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Outline style + * + * @param { OutlineStyle | EdgeOutlineStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outlineStyle(value: OutlineStyle | EdgeOutlineStyles): T; + + /** + * Outline width + * The input parameter default value is 0 + * + * @param { Dimension | EdgeOutlineWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Outline width + * + * @param { Dimension | EdgeOutlineWidths } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outlineWidth(value: Dimension | EdgeOutlineWidths): T; + + /** + * Outline color + * The input parameter default value is Color.Black + * + * @param { ResourceColor | EdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Outline color + * + * @param { ResourceColor | EdgeColors | LocalizedEdgeColors } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outlineColor(value: ResourceColor | EdgeColors | LocalizedEdgeColors): T; + + /** + * Outline radius + * The input parameter default value is 0 + * + * @param { Dimension | OutlineRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Outline radius + * + * @param { Dimension | OutlineRadiuses } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + outlineRadius(value: Dimension | OutlineRadiuses): T; + + /** + * Provides the general foreground color capability of UI components, and assigns color values + * according to the characteristics of components. + * + * @param { ResourceColor | ColoringStrategy } value - indicates the color or color selection strategy + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Provides the general foreground color capability of UI components, and assigns color values + * according to the characteristics of components. + * + * @param { ResourceColor | ColoringStrategy } value - indicates the color or color selection strategy + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + foregroundColor(value: ResourceColor | ColoringStrategy): T; + + /** + * Trigger a click event when a click is clicked. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Trigger a click event when a click is clicked. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Trigger a click event when a click is clicked. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Trigger a click event when a click is clicked. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onClick(event: (event: ClickEvent) => void): T; + + /** + * Trigger a click event when a click is clicked, move distance should smaller than distanceThreshold. + * + * @param { function } event - this function callback executed when the click action is recognized + * @param { number } distanceThreshold - the distance threshold of finger's movement when detecting a click action + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + onClick(event: Callback, distanceThreshold: number): T; + + /** + * Trigger a hover event. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger a hover event. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onHover(event: (isHover: boolean, event: HoverEvent) => void): T; + + /** + * Trigger a accessibility hover event. + * + * @param { AccessibilityCallback } callback - A callback instance used when the component is touched after accessibility mode is enabled. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAccessibilityHover(callback: AccessibilityCallback): T; + + /** + * Set hover effect. + * + * @param { HoverEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set hover effect. + * + * @param { HoverEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set hover effect. + * + * @param { HoverEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hoverEffect(value: HoverEffect): T; + + /** + * Trigger a mouse event. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger a mouse event. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + onMouse(event: (event: MouseEvent) => void): T; + + /** + * Trigger a touch event when touched. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Trigger a touch event when touched. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger a touch event when touched. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onTouch(event: (event: TouchEvent) => void): T; + + /** + * Keyboard input + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keyboard input + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Keyboard input + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onKeyEvent(event: (event: KeyEvent) => void): T; + + /** + * Handle keyboard events before input method events. + * + * @param { Callback } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onKeyPreIme(event: Callback): T; + + /** + * Set focusable. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set focusable. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set focusable. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + focusable(value: boolean): T; + + /** + * Set TabStop on component focus + * + * @param { boolean } isTabStop + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + tabStop(isTabStop: boolean): T; + + /** + * Trigger a event when got focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger a event when got focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger a event when got focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onFocus(event: () => void): T; + + /** + * Trigger a event when lose focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger a event when lose focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger a event when lose focus. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onBlur(event: () => void): T; + + /** + * Set focus index by key tab. + * + * @param { number } index + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set focus index by key tab. + * + * @param { number } index + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set focus index by key tab. + * + * @param { number } index + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + tabIndex(index: number): T; + + /** + * Set default focused component when a page create. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set default focused component when a page create. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set default focused component when a page create. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + defaultFocus(value: boolean): T; + + /** + * Set default focused component when focus on a focus group. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set default focused component when focus on a focus group. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set default focused component when focus on a focus group. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + groupDefaultFocus(value: boolean): T; + + /** + * Set a component focused when the component be touched. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Set a component focused when the component be touched. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set a component focused when the component be touched. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + focusOnTouch(value: boolean): T; + + /** + * Set the component's focusBox style. + * + * @param { FocusBoxStyle } style + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + focusBox(style: FocusBoxStyle): T; + + /** + * Set container as a focus group with a specific identifier. + * + * @param { string } id - focus scope identifier. + * @param { boolean } [isGroup] - whether this scope is a focus group, the default value is false + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + focusScopeId(id: string, isGroup?: boolean): T; + /** + * Set container as a focus group with a specific identifier. + * + * @param { string } id - focus scope identifier. + * @param { boolean } [isGroup] - whether this scope is a focus group, the default value is false. + * @param { boolean } [arrowStepOut] - whether the arrow keys can move focus from inside the focus group to outside, + * only effective when isGroup is true, the default value is true. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + focusScopeId(id: string, isGroup?: boolean, arrowStepOut?: boolean): T; + + /** + * Set the focus priority of component in a specific focus scope. + * + * @param { string } scopeId + * @param { FocusPriority } [priority] - the default value is AUTO + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + focusScopePriority(scopeId: string, priority?: FocusPriority): T; + + /** + * animation + * + * @param { AnimateParam } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * animation + * + * @param { AnimateParam } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * animation + * + * @param { AnimateParam } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * animation + * + * @param { AnimateParam } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + animation(value: AnimateParam): T; + + /** + * Transition parameter + * + * @param { TransitionOptions | TransitionEffect } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Transition parameter + * + * @param { TransitionOptions | TransitionEffect } value - transition options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Transition parameter + * + * @param { TransitionOptions | TransitionEffect } value - transition options or transition effect + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Transition parameter + * + * @param { TransitionOptions | TransitionEffect } value - transition options or transition effect + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + transition(value: TransitionOptions | TransitionEffect): T; + + /** + * Set the transition effect of component when it appears and disappears. + * + * @param { TransitionEffect } effect - transition effect + * @param { Optional } onFinish - transition finish callback. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + transition(effect: TransitionEffect, onFinish: Optional): T; + + /** + * Bind gesture recognition. + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Bind gesture recognition. + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bind gesture recognition. + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + gesture(gesture: GestureType, mask?: GestureMask): T; + + /** + * Binding Preferential Recognition Gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Binding Preferential Recognition Gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Binding Preferential Recognition Gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + priorityGesture(gesture: GestureType, mask?: GestureMask): T; + + /** + * Binding gestures that can be triggered simultaneously with internal component gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Binding gestures that can be triggered simultaneously with internal component gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Binding gestures that can be triggered simultaneously with internal component gestures + * gesture:Bound Gesture Type,mask:GestureMask; + * + * @param { GestureType } gesture + * @param { GestureMask } mask + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + parallelGesture(gesture: GestureType, mask?: GestureMask): T; + + /** + * Adds the content blurring effect for the current component. The input parameter is the blurring radius. + * The larger the blurring radius, the more blurring the content. + * If the value is 0, the content blurring effect is not blurring. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds the content blurring effect for the current component. The input parameter is the blurring radius. + * The larger the blurring radius, the more blurring the content. + * If the value is 0, the content blurring effect is not blurring. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the content blurring effect for the current component. The input parameter is the blurring radius. + * The larger the blurring radius, the more blurring the content. + * If the value is 0, the content blurring effect is not blurring. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the content blurring effect for the current component. The input parameter is the blurring radius. + * The larger the blurring radius, the more blurring the content. + * If the value is 0, the content blurring effect is not blurring. + * + * @param { number } value - value indicates radius of backdrop blur. + * @param { BlurOptions } [options] - options indicates blur options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + blur(value: number, options?: BlurOptions): T; + + /** + * Adds the content linear gradient blurring effect for the current component. The input parameter is the blurring radius. + * + * @param { number } value - the blurring radius. + * The larger the blurring radius, the more blurring the content, and if the value is 0, the content blurring effect is not blurring. + * @param { LinearGradientBlurOptions } options - the linear gradient blur options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + linearGradientBlur(value: number, options: LinearGradientBlurOptions): T; + + /** + * Component motion blur interface. + * + * @param { MotionBlurOptions } value - the attributes of motion blur. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + motionBlur(value: MotionBlurOptions):T; + + /** + * Adds a highlight effect to the current component. + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * The component is displayed as all white (percentage). + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds a highlight effect to the current component. + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * The component is displayed as all white (percentage). + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a highlight effect to the current component. + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * The component is displayed as all white (percentage). + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a highlight effect to the current component. + * The input parameter is the highlight proportion. 0 indicates no highlight effect, and 1 indicates the maximum highlight proportion. + * The component is displayed as all white (percentage). + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + brightness(value: number): T; + + /** + * Adds a contrast effect to the current component. The input parameter is the contrast value. + * A larger contrast value indicates a sharper image. When the contrast value is 0, the image becomes gray. (%) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds a contrast effect to the current component. The input parameter is the contrast value. + * A larger contrast value indicates a sharper image. When the contrast value is 0, the image becomes gray. (%) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a contrast effect to the current component. The input parameter is the contrast value. + * A larger contrast value indicates a sharper image. When the contrast value is 0, the image becomes gray. (%) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a contrast effect to the current component. The input parameter is the contrast value. + * A larger contrast value indicates a sharper image. When the contrast value is 0, the image becomes gray. (%) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + contrast(value: number): T; + + /** + * Adds a grayscale effect to the current component. + * The value is the gray scale conversion ratio. If the input parameter is 1.0, the gray scale image is completely converted to the gray scale image. If the input parameter is 0.0, the image does not change. + * If the input parameter is between 0.0 and 1.0, the effect changes. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds a grayscale effect to the current component. + * The value is the gray scale conversion ratio. If the input parameter is 1.0, the gray scale image is completely converted to the gray scale image. If the input parameter is 0.0, the image does not change. + * If the input parameter is between 0.0 and 1.0, the effect changes. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a grayscale effect to the current component. + * The value is the gray scale conversion ratio. If the input parameter is 1.0, the gray scale image is completely converted to the gray scale image. If the input parameter is 0.0, the image does not change. + * If the input parameter is between 0.0 and 1.0, the effect changes. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a grayscale effect to the current component. + * The value is the gray scale conversion ratio. If the input parameter is 1.0, the gray scale image is completely converted to the gray scale image. If the input parameter is 0.0, the image does not change. + * If the input parameter is between 0.0 and 1.0, the effect changes. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + grayscale(value: number): T; + + /** + * Adds a color overlay effect for the current component. The input parameter is the superimposed color. + * + * @param { Color | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds a color overlay effect for the current component. The input parameter is the superimposed color. + * + * @param { Color | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a color overlay effect for the current component. The input parameter is the superimposed color. + * + * @param { Color | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a color overlay effect for the current component. The input parameter is the superimposed color. + * + * @param { Color | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + colorBlend(value: Color | string | Resource): T; + + /** + * Adds a saturation effect to the current component. + * The saturation is the ratio of the color-containing component to the achromatic component (gray). + * The larger the color-containing component, the greater the saturation. + * The larger the achromatic component, the smaller the saturation. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds a saturation effect to the current component. + * The saturation is the ratio of the color-containing component to the achromatic component (gray). + * The larger the color-containing component, the greater the saturation. + * The larger the achromatic component, the smaller the saturation. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds a saturation effect to the current component. + * The saturation is the ratio of the color-containing component to the achromatic component (gray). + * The larger the color-containing component, the greater the saturation. + * The larger the achromatic component, the smaller the saturation. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds a saturation effect to the current component. + * The saturation is the ratio of the color-containing component to the achromatic component (gray). + * The larger the color-containing component, the greater the saturation. + * The larger the achromatic component, the smaller the saturation. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + saturate(value: number): T; + + /** + * Converts the image to sepia. Value defines the scale of the conversion. + * A value of 1 is completely sepia, and a value of 0 does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Converts the image to sepia. Value defines the scale of the conversion. + * A value of 1 is completely sepia, and a value of 0 does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Converts the image to sepia. Value defines the scale of the conversion. + * A value of 1 is completely sepia, and a value of 0 does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Converts the image to sepia. Value defines the scale of the conversion. + * A value of 1 is completely sepia, and a value of 0 does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + sepia(value: number): T; + + /** + * Invert the input image. Value defines the scale of the conversion. 100% of the value is a complete reversal. + * A value of 0% does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Invert the input image. Value defines the scale of the conversion. 100% of the value is a complete reversal. + * A value of 0% does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Invert the input image. Value defines the scale of the conversion. 100% of the value is a complete reversal. + * A value of 0% does not change the image. (Percentage) + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Invert the input image. Value defines the scale of the conversion. 100% of the value is a complete reversal. + * A value of 0% does not change the image. (Percentage) + * + * @param { number | InvertOptions } value - value indicates the scale of the conversion or the options of invert. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + invert(value: number | InvertOptions): T; + + /** + * Sets system bar effect to the component. + * + * @returns { T } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + systemBarEffect(): T; + + /** + * Adds the hue rotation effect to the current component. + * The input parameter is the rotation angle. When the input parameter is 0deg, the image does not change (the default value is 0deg), and the input parameter does not have a maximum value. + * If the value exceeds 360deg, the image is circled again. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds the hue rotation effect to the current component. + * The input parameter is the rotation angle. When the input parameter is 0deg, the image does not change (the default value is 0deg), and the input parameter does not have a maximum value. + * If the value exceeds 360deg, the image is circled again. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the hue rotation effect to the current component. + * The input parameter is the rotation angle. When the input parameter is 0deg, the image does not change (the default value is 0deg), and the input parameter does not have a maximum value. + * If the value exceeds 360deg, the image is circled again. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the hue rotation effect to the current component. + * The input parameter is the rotation angle. When the input parameter is 0deg, the image does not change (the default value is 0deg), and the input parameter does not have a maximum value. + * If the value exceeds 360deg, the image is circled again. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + hueRotate(value: number | string): T; + + /** + * Add an attribute to control whether the shadows of the child nodes overlap each other. + * + * @param { boolean } value - true means the shadows of the child nodes overlap each other effect and drawn in batches. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Add an attribute to control whether the shadows of the child nodes overlap each other. + * + * @param { boolean } value - true means the shadows of the child nodes overlap each other effect and drawn in batches. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + useShadowBatching(value: boolean): T; + + /** + * Sets whether the component should apply the effects template defined by the parent effectComponent or window. + * If multiple parent effectComponents are found, the nearest one will be used. + * If no parent effectComponent is found, this method has no effect. + * + * @param { boolean } useEffect - true means the component should apply the effects template defined by the parent effectComponent or window. + * @param { EffectType } effectType - the effect type of the effects template, defined by the parent effectComponent or window. + * @returns { T } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ + useEffect(useEffect: boolean, effectType: EffectType): T; + + /** + * Sets whether the component should apply the effects template defined by the parent effectComponent. + * If multiple parent effectComponents are found, the nearest one will be used. + * If no parent effectComponent is found, this method has no effect. + * + * @param { boolean } value - true means the component should apply the effects template. + * @returns { T } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + useEffect(value: boolean): T; + + /** + * Adds the background blur effect for the current component. The input parameter is the blur radius. + * The larger the blur radius, the more blurred the background. If the value is 0, the background blur is not blurred. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adds the background blur effect for the current component. The input parameter is the blur radius. + * The larger the blur radius, the more blurred the background. If the value is 0, the background blur is not blurred. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adds the background blur effect for the current component. The input parameter is the blur radius. + * The larger the blur radius, the more blurred the background. If the value is 0, the background blur is not blurred. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adds the background blur effect for the current component. The input parameter is the blur radius. + * The larger the blur radius, the more blurred the background. If the value is 0, the background blur is not blurred. + * + * @param { number } value - value indicates radius of backdrop blur. + * @param { BlurOptions } [options] - options indicates the backdrop blur options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backdropBlur(value: number, options?: BlurOptions): T; + + /** + * Composite the contents of this view and its children into an offscreen cache before display in the screen. + * + * @param { boolean } value - if this view and its children need to composite into an offscreen cache. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Composite the contents of this view and its children into an offscreen cache before display in the screen. + * + * @param { boolean } value - if this view and its children need to composite into an offscreen cache. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Composite the contents of this view and its children into an offscreen cache before display in the screen. + * + * @param { boolean } value - if this view and its children need to composite into an offscreen cache. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + renderGroup(value: boolean): T; + + /** + * Sets whether the component should remain stationary, reusing the results of the current frame's off-screen rendering. + * If the input parameter is true, the component and subcomponent changes do not affect the display. + * + * @param { boolean } value - true means the component should remain stationary. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + freeze(value: boolean): T; + + /** + * Sets the translation effect during page transition. + * The value is the start point of entry and end point of exit. + * When this parameter is set together with slide, slide takes effect by default. + * + * @param { TranslateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the translation effect during page transition. + * The value is the start point of entry and end point of exit. + * When this parameter is set together with slide, slide takes effect by default. + * + * @param { TranslateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the translation effect during page transition. + * The value is the start point of entry and end point of exit. + * When this parameter is set together with slide, slide takes effect by default. + * + * @param { TranslateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set component translation. + * + * @param { TranslateOptions } value default:{x:0,y:0,z:0} + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + translate(value: TranslateOptions): T; + + /** + * Sets the zoom effect during page transition. The value is the start point of entry and end point of exit. + * + * @param { ScaleOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the zoom effect during page transition. The value is the start point of entry and end point of exit. + * + * @param { ScaleOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the zoom effect during page transition. The value is the start point of entry and end point of exit. + * + * @param { ScaleOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set component scaling. + * + * @param { ScaleOptions } value default:{x:1,y:1,z:1,centerX:'50%',centerY:'50%'} + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scale(value: ScaleOptions): T; + + /** + * Default number of occupied columns, indicating the number of occupied grid columns when the number of columns (span) of the corresponding size is not set in the useSizeType attribute. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Default number of occupied columns, indicating the number of occupied grid columns when the number of columns (span) of the corresponding size is not set in the useSizeType attribute. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default number of occupied columns, indicating the number of occupied grid columns when the number of columns (span) of the corresponding size is not set in the useSizeType attribute. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + gridSpan(value: number): T; + + /** + * The default offset column number indicates the number of offset columns of the current component in the start direction of the parent component when the useSizeType attribute does not set the offset of the corresponding dimension. That is, + * the current component is located in the nth column. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The default offset column number indicates the number of offset columns of the current component in the start direction of the parent component when the useSizeType attribute does not set the offset of the corresponding dimension. That is, + * the current component is located in the nth column. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The default offset column number indicates the number of offset columns of the current component in the start direction of the parent component when the useSizeType attribute does not set the offset of the corresponding dimension. That is, + * the current component is located in the nth column. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + gridOffset(value: number): T; + + /** + * Sets the rotation effect during assembly transition. + * The values are the start point during insertion and the end point during deletion. + * + * @param { RotateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the rotation effect during assembly transition. + * The values are the start point during insertion and the end point during deletion. + * + * @param { RotateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the rotation effect during assembly transition. + * The values are the start point during insertion and the end point during deletion. + * + * @param { RotateOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set component rotation. + * + * @param { RotateOptions } value default:{x:0,y:0,z:0,centerX:'50%',centerY:'50%',centerZ:0,perspective:0} + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + rotate(value: RotateOptions): T; + + /** + * Sets the transformation matrix for the current component. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the transformation matrix for the current component. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the transformation matrix for the current component. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + transform(value: object): T; + + /** + * This callback is triggered when a component mounts a display. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This callback is triggered when a component mounts a display. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * This callback is triggered when a component mounts a display. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * This callback is triggered when a component mounts a display. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onAppear(event: () => void): T; + + /** + * This callback is triggered when component uninstallation disappears. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This callback is triggered when component uninstallation disappears. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * This callback is triggered when component uninstallation disappears. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * This callback is triggered when component uninstallation disappears. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onDisAppear(event: () => void): T; + + /** + * This callback is triggered when a component mounts to view tree. + * + * @param { Callback } callback + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAttach(callback: Callback): T; + + /** + * This callback is triggered when a component is detached from view tree. + * + * @param { Callback } callback + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDetach(callback: Callback): T; + + /** + * This callback is triggered when the size or position of this component change finished. + * + * @param { function } event - event callback. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * This callback is triggered when the size or position of this component change finished. + * + * @param { function } event - event callback. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This callback is triggered when the size or position of this component change finished. + * + * @param { function } event - event callback. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAreaChange(event: (oldValue: Area, newValue: Area) => void): T; + + /** + * Controls the display or hide of the current component. + * + * @param { Visibility } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Controls the display or hide of the current component. + * + * @param { Visibility } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Controls the display or hide of the current component. + * + * @param { Visibility } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Controls the display or hide of the current component. + * + * @param { Visibility } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + visibility(value: Visibility): T; + + /** + * The percentage of the remaining space of the Flex container allocated to the component on which this property resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The percentage of the remaining space of the Flex container allocated to the component on which this property resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The percentage of the remaining space of the Flex container allocated to the component on which this property resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The percentage of the remaining space of the Flex container allocated to the component on which this property resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + flexGrow(value: number): T; + + /** + * The proportion of the Flex container compression size assigned to the component on which this attribute resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The proportion of the Flex container compression size assigned to the component on which this attribute resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The proportion of the Flex container compression size assigned to the component on which this attribute resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The proportion of the Flex container compression size assigned to the component on which this attribute resides. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + flexShrink(value: number): T; + + /** + * The base dimension of the assembly on which this attribute is located in the direction of the principal axis in the Flex container. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The base dimension of the assembly on which this attribute is located in the direction of the principal axis in the Flex container. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The base dimension of the assembly on which this attribute is located in the direction of the principal axis in the Flex container. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The base dimension of the assembly on which this attribute is located in the direction of the principal axis in the Flex container. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + flexBasis(value: number | string): T; + + /** + * Overrides the default configuration of alignItems in the Flex Layout container. + * + * @param { ItemAlign } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Overrides the default configuration of alignItems in the Flex Layout container. + * + * @param { ItemAlign } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Overrides the default configuration of alignItems in the Flex Layout container. + * + * @param { ItemAlign } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Overrides the default configuration of alignItems in the Flex Layout container. + * + * @param { ItemAlign } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignSelf(value: ItemAlign): T; + + /** + * Sets the current component and displays the priority in the layout container. This parameter is valid only in Row, Column, and Flex single-row layouts. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the current component and displays the priority in the layout container. This parameter is valid only in Row, Column, and Flex single-row layouts. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the current component and displays the priority in the layout container. This parameter is valid only in Row, Column, and Flex single-row layouts. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the current component and displays the priority in the layout container. This parameter is valid only in Row, Column, and Flex single-row layouts. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + displayPriority(value: number): T; + + /** + * The sibling components in the same container are hierarchically displayed. A larger value of z indicates a higher display level. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The sibling components in the same container are hierarchically displayed. A larger value of z indicates a higher display level. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The sibling components in the same container are hierarchically displayed. A larger value of z indicates a higher display level. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The sibling components in the same container are hierarchically displayed. A larger value of z indicates a higher display level. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + zIndex(value: number): T; + + /** + * If the components of the two pages are configured with the same ID, the shared element transition is performed during transition. If the parameter is set to an empty string, the shared element transition does not occur. For details about the options parameter, see the options parameter description. + * + * @param { string } id + * @param { sharedTransitionOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * If the components of the two pages are configured with the same ID, the shared element transition is performed during transition. If the parameter is set to an empty string, the shared element transition does not occur. For details about the options parameter, see the options parameter description. + * + * @param { string } id + * @param { sharedTransitionOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * If the components of the two pages are configured with the same ID, the shared element transition is performed during transition. If the parameter is set to an empty string, the shared element transition does not occur. For details about the options parameter, see the options parameter description. + * + * @param { string } id + * @param { sharedTransitionOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + sharedTransition(id: string, options?: sharedTransitionOptions): T; + + /** + * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). + * + * @param { Direction } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). + * + * @param { Direction } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). + * + * @param { Direction } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). + * + * @param { Direction } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + direction(value: Direction): T; + + /** + * align + * + * @param { Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * align + * + * @param { Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * align + * + * @param { Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * align + * + * @param { Alignment } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + align(value: Alignment): T; + + /** + * position + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * position + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * position + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * position + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * position + * + * @param { Position | Edges | LocalizedEdges } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + position(value: Position | Edges | LocalizedEdges): T; + + /** + * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. + * + * @param { Position | LocalizedPosition} value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + markAnchor(value: Position | LocalizedPosition): T; + + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. + * + * @param { Position } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Coordinate offset relative to the layout completion position. + * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. + * + * @param { Position | Edges | LocalizedEdges } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + offset(value: Position | Edges | LocalizedEdges): T; + + /** + * If the value is true, the component is available and can respond to operations such as clicking. + * If it is set to false, click operations are not responded. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * If the value is true, the component is available and can respond to operations such as clicking. + * If it is set to false, click operations are not responded. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * If the value is true, the component is available and can respond to operations such as clicking. + * If it is set to false, click operations are not responded. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * If the value is true, the component is available and can respond to operations such as clicking. + * If it is set to false, click operations are not responded. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + enabled(value: boolean): T; + + /** + * Sets the number of occupied columns and offset columns for a specific device width type. + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead grid_col/GridColColumnOption and grid_row/GridRowColumnOption + */ + useSizeType(value: { + xs?: number | { span: number; offset: number }; + sm?: number | { span: number; offset: number }; + md?: number | { span: number; offset: number }; + lg?: number | { span: number; offset: number }; + }): T; + + /** + * Specifies the alignRules of relative container + * + * @param { AlignRuleOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies the alignRules of relative container + * + * @param { AlignRuleOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies the alignRules of relative container + * + * @param { AlignRuleOption } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignRules(value: AlignRuleOption): T; + + /** + * Specifies the localized alignRules of relative container + * + * @param { LocalizedAlignRuleOptions } alignRule + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + alignRules(alignRule: LocalizedAlignRuleOptions): T; + + /** + * Specifies the direction and style of chain in relative container + * + * @param { Axis } direction - indicates direction of the chain + * @param { ChainStyle } style - indicates style of the chain + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + chainMode(direction: Axis, style: ChainStyle): T; + + /** + * Specifies the aspect ratio of the current component. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Specifies the aspect ratio of the current component. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies the aspect ratio of the current component. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies the aspect ratio of the current component. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + aspectRatio(value: number): T; + + /** + * The click effect level and scale number. + * + * @param { ClickEffect | null } value + * @returns { T } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The click effect level and scale number. + * + * @param { ClickEffect | null } value + * @returns { T } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + clickEffect(value: ClickEffect | null): T; + + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDragStart(event: (event: DragEvent, extraParams?: string) => CustomBuilder | DragItemInfo): T; + + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDragEnter(event: (event: DragEvent, extraParams?: string) => void): T; + + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDragMove(event: (event: DragEvent, extraParams?: string) => void): T; + + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDragLeave(event: (event: DragEvent, extraParams?: string) => void): T; + + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDrop(event: (event: DragEvent, extraParams?: string) => void): T; + + /** + * This function is called when the drag event is end. + * + * @param { function } event - indicates the function to be called. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * This function is called when the drag event is end. + * + * @param { function } event - indicates the function to be called. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * This function is called when the drag event is end. + * + * @param { function } event - indicates the function to be called. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDragEnd(event: (event: DragEvent, extraParams?: string) => void): T; -declare type SymbolGlyphModifier = import('../../resource/symbol').SymbolGlyphModifier; + /** + * Allowed drop uniformData type for this node. + * + * @param { Array } value - the uniformData type for this node. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Allowed drop uniformData type for this node. + * + * @param { Array } value - the uniformData type for this node. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Allowed drop uniformData type for this node. + * + * @param { Array | null } value - the uniformData type for this node. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + allowDrop(value: Array | null): T; -declare type ComponentContent = import('../api/arkui/ComponentContent').ComponentContent; + /** + * Enable the selectable area can be dragged. + * + * @param { boolean } value - true means the area can be dragged, false means the area can't be dragged. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Enable the selectable area can be dragged. + * + * @param { boolean } value - true means the area can be dragged, false means the area can't be dragged. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + draggable(value: boolean): T; -declare type AnimationRange = [from: T, to: T]; + /** + * Set preview of the component for dragging process + * + * @param { CustomBuilder | DragItemInfo } value - preview of the component for dragging process + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Set preview of the component for dragging process + * + * @param { CustomBuilder | DragItemInfo | string } value - preview of the component for dragging process + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + dragPreview(value: CustomBuilder | DragItemInfo | string): T; -declare interface Callback { - (data: T): V; + /** + * Set the selectable area drag preview options. + * + * @param { DragPreviewOptions } value - preview options value. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Set the selectable area drag preview options. + * + * @param { DragPreviewOptions } value - preview options value. + * @param { DragInteractionOptions } options - drag interaction options value. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + dragPreviewOptions(value: DragPreviewOptions, options?: DragInteractionOptions): T; + + /** + * After binding, a callback is triggered when the preDrag status change finished. + * + * @param { Callback } callback callback - The callback will be triggered when the preDrag status change. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + onPreDrag(callback: Callback): T; + + /** + * Add mask text to the current component. The layout is the same as that of the current component. + * + * @param { string } value + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Add mask text to the current component. The layout is the same as that of the current component. + * + * @param { string } value + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Add mask text to the current component. The layout is the same as that of the current component. + * + * @param { string | CustomBuilder } value + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Add mask text to the current component. The layout is the same as that of the current component. + * + * @param { string | CustomBuilder } value + * @param { object } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Add mask text to the current component. The layout is the same as that of the current component. + * + * @param { string | CustomBuilder | ComponentContent } value + * @param { OverlayOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + overlay(value: string | CustomBuilder | ComponentContent, options?: OverlayOptions): T; + + /** + * Linear Gradient + * angle: Angle of Linear Gradient. The default value is 180; + * direction: Direction of Linear Gradient. The default value is GradientDirection.Bottom; + * colors: Color description for gradients. + * repeating: repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Linear Gradient + * angle: Angle of Linear Gradient. The default value is 180; + * direction: Direction of Linear Gradient. The default value is GradientDirection.Bottom; + * colors: Color description for gradients. + * repeating: repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Linear Gradient + * angle: Angle of Linear Gradient. The default value is 180; + * direction: Direction of Linear Gradient. The default value is GradientDirection.Bottom; + * colors: Color description for gradients. + * repeating: repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Linear Gradient + * angle: Angle of Linear Gradient. The default value is 180; + * direction: Direction of Linear Gradient. The default value is GradientDirection.Bottom; + * colors: Color description for gradients. + * repeating: repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Linear Gradient + * angle: Angle of Linear Gradient. The default value is 180; + * direction: Direction of Linear Gradient. The default value is GradientDirection.Bottom; + * colors: Color description for gradients. + * repeating: repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + linearGradient(value: { + angle?: number | string; + direction?: GradientDirection; + colors: Array<[ResourceColor, number]>; + repeating?: boolean; + }): T; + + /** + * Angle Gradient + * center:is the center point of the angle gradient + * start:Start point of angle gradient. The default value is 0 + * end:End point of angle gradient. The default value is 0 + * number:number + * rotating:rotating. The default value is 0 + * colors:Color description for gradients + * repeating:repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Angle Gradient + * center:is the center point of the angle gradient + * start:Start point of angle gradient. The default value is 0 + * end:End point of angle gradient. The default value is 0 + * number:number + * rotating:rotating. The default value is 0 + * colors:Color description for gradients + * repeating:repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Angle Gradient + * center:is the center point of the angle gradient + * start:Start point of angle gradient. The default value is 0 + * end:End point of angle gradient. The default value is 0 + * number:number + * rotating:rotating. The default value is 0 + * colors:Color description for gradients + * repeating:repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Angle Gradient + * center:is the center point of the angle gradient + * start:Start point of angle gradient. The default value is 0 + * end:End point of angle gradient. The default value is 0 + * number:number + * rotating:rotating. The default value is 0 + * colors:Color description for gradients + * repeating:repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Angle Gradient + * center:is the center point of the angle gradient + * start:Start point of angle gradient. The default value is 0 + * end:End point of angle gradient. The default value is 0 + * number:number + * rotating:rotating. The default value is 0 + * colors:Color description for gradients + * repeating:repeating. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + sweepGradient(value: { + center: [Length, Length]; + start?: number | string; + end?: number | string; + rotation?: number | string; + colors: Array<[ResourceColor, number]>; + repeating?: boolean; + }): T; + + /** + * Radial Gradient + * center:Center point of radial gradient + * radius:Radius of Radial Gradient. value range [0, +∞) + * colors:Color description for gradients + * repeating: Refill. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Radial Gradient + * center:Center point of radial gradient + * radius:Radius of Radial Gradient. value range [0, +∞) + * colors:Color description for gradients + * repeating: Refill. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Radial Gradient + * center:Center point of radial gradient + * radius:Radius of Radial Gradient. value range [0, +∞) + * colors:Color description for gradients + * repeating: Refill. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Radial Gradient + * center:Center point of radial gradient + * radius:Radius of Radial Gradient. value range [0, +∞) + * colors:Color description for gradients + * repeating: Refill. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Radial Gradient + * center:Center point of radial gradient + * radius:Radius of Radial Gradient. value range [0, +∞) + * colors:Color description for gradients + * repeating: Refill. The default value is false + * + * @param { object } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + radialGradient(value: { + center: [Length, Length]; + radius: number | string; + colors: Array<[ResourceColor, number]>; + repeating?: boolean; + }): T; + + /** + * Set the motion path of the component + * path:Motion path for displacement animation, using the svg path string. + * from:Start point of the motion path. The default value is 0.0. + * to:End point of the motion path. The default value is 1.0. + * rotatable:Whether to follow the path for rotation. + * + * @param { MotionPathOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the motion path of the component + * path:Motion path for displacement animation, using the svg path string. + * from:Start point of the motion path. The default value is 0.0. + * to:End point of the motion path. The default value is 1.0. + * rotatable:Whether to follow the path for rotation. + * + * @param { MotionPathOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the motion path of the component + * path:Motion path for displacement animation, using the svg path string. + * from:Start point of the motion path. The default value is 0.0. + * to:End point of the motion path. The default value is 1.0. + * rotatable:Whether to follow the path for rotation. + * + * @param { MotionPathOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + motionPath(value: MotionPathOptions): T; + + /** + * Add a shadow effect to the current component + * + * @param { ShadowOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Add a shadow effect to the current component + * + * @param { ShadowOptions } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Add a shadow effect to the current component + * + * @param { ShadowOptions | ShadowStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Add a shadow effect to the current component + * + * @param { ShadowOptions | ShadowStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + shadow(value: ShadowOptions | ShadowStyle): T; + + /** + * Add a blendMode effect to the current component + * + * @param { BlendMode } value - Different hybrid modes + * @param { BlendApplyType } [type] - Different blend apply type + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Add a blendMode effect to the current component + * + * @param { BlendMode } value - Different hybrid modes + * @param { BlendApplyType } [type] - Different blend apply type + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + blendMode(value: BlendMode, type?: BlendApplyType): T; + + /** + * Add a blendMode effect to the current component.Cannot be used together with the blendMode interface. + * + * @param { BlendMode | Blender } effect - When the effect type is BlendMode type, define Different hybrid modes. + * When the effect type is Blender type, Define the corresponding blending effect. + * @param { BlendApplyType } [type] - Different blend apply type + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 13 + */ + advancedBlendMode(effect: BlendMode | Blender, type?: BlendApplyType): T; + + /** + * Whether to crop the sub components beyond the current component range. + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + clip(value: boolean): T; + + /** + * When the parameter is of the Shape type, the current component is cropped according to the specified shape. + * When the parameter is of the boolean type, this parameter specifies whether to crop based on the edge contour. + * + * @param { boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * When the parameter is of the Shape type, the current component is cropped according to the specified shape. + * When the parameter is of the boolean type, this parameter specifies whether to crop based on the edge contour. + * + * @param { boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * When the parameter is of the Shape type, the current component is cropped according to the specified shape. + * When the parameter is of the boolean type, this parameter specifies whether to crop based on the edge contour. + * + * @param { boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * When the parameter is of the Shape type, the current component is cropped according to the specified shape. + * When the parameter is of the boolean type, this parameter specifies whether to crop based on the edge contour. + * + * @param { boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead CommonMethod#clipShape + */ + clip(value: boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute): T; + + /** + * The current component is cropped according to the specified shape. + * + * @param { CircleShape | EllipseShape | PathShape | RectShape } value - indicates the shape of the clip. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + clipShape(value: CircleShape | EllipseShape | PathShape | RectShape): T; + + /** + * Sets the mask of the current component. + * + * @param { ProgressMask } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + mask(value: ProgressMask): T; + + /** + * Applies a mask of the specified shape to the current assembly. + * + * @param { CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Applies a mask of the specified shape to the current assembly. + * + * @param { CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask } value - indicates the shape of the mask. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Applies a mask of the specified shape to the current assembly. + * + * @param { CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask } value - indicates the shape of the mask. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Applies a mask of the specified shape to the current assembly. + * + * @param { CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask } value - indicates the shape of the mask. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead CommonMethod#maskShape + */ + mask(value: CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask): T; + + /** + * Applies a mask of the specified shape to the current assembly. + * + * @param { CircleShape | EllipseShape | PathShape | RectShape } value - indicates the shape of the mask. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + maskShape(value: CircleShape | EllipseShape | PathShape | RectShape): T; + + /** + * Key. User can set an key to the component to identify it. + * + * @param { string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + * @test + */ + key(value: string): T; + + /** + * Id. User can set an id to the component to identify it. + * + * @param { string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Id. User can set an id to the component to identify it. + * + * @param { string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Id. User can set an id to the component to identify it. + * + * @param { string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Id. User can set an id to the component to identify it. + * + * @param { string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + id(value: string): T; + + /** + * geometryTransition + * + * @param { string } id + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * geometryTransition + * + * @param { string } id + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * geometryTransition + * + * @param { string } id + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + geometryTransition(id: string): T; + /** + * Shared geometry transition + * + * @param { string } id - geometry transition id + * @param { GeometryTransitionOptions } options - Indicates the options of geometry transition. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Shared geometry transition + * + * @param { string } id - geometry transition id + * @param { GeometryTransitionOptions } options - Indicates the options of geometry transition. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + geometryTransition(id: string, options?: GeometryTransitionOptions): T; + + /** + * Popup control + * + * @param { boolean } show + * @param { PopupOptions } popup + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Popup control + * + * @param { boolean } show + * @param { PopupOptions | CustomPopupOptions } popup + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Popup control + * + * @param { boolean } show + * @param { PopupOptions | CustomPopupOptions } popup + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + bindPopup(show: boolean, popup: PopupOptions | CustomPopupOptions): T; + + /** + * Menu control + * + * @param { { value: ResourceStr; icon?: ResourceStr; action: () => void }[] | CustomBuilder } content + * action: () => void }[] | CustomBuilder } content - Indicates the content of menu. + * @param { MenuOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Menu control + * + * @param { { value: ResourceStr; icon?: ResourceStr; action: () => void }[] | CustomBuilder } content + * action: () => void }[] | CustomBuilder } content - Indicates the content of menu. + * @param { MenuOptions } options - Indicates the options of menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Menu control + * + * @param { Array | CustomBuilder } content - Indicates the content of menu. + * @param { MenuOptions } options - Indicates the options of menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + bindMenu(content: Array | CustomBuilder, options?: MenuOptions): T; + + /** + * Menu control + * + * @param { boolean } isShow true means display menu, false means hide menu. + * @param { Array | CustomBuilder } content - Indicates the content of menu. + * @param { MenuOptions } options - Indicates the options of menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Menu control + * + * @param { boolean } isShow true means display menu, false means hide menu. + * @param { Array | CustomBuilder } content - Indicates the content of menu. + * @param { MenuOptions } options - Indicates the options of menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindMenu(isShow: boolean, content: Array | CustomBuilder, options?: MenuOptions): T; + + /** + * ContextMenu control + * + * @param { CustomBuilder } content + * @param { ResponseType } responseType + * @param { ContextMenuOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * ContextMenu control + * + * @param { CustomBuilder } content - Indicates the content of context menu. + * @param { ResponseType } responseType - Indicates response type of context menu. + * @param { ContextMenuOptions } options - Indicates the options of context menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * ContextMenu control + * + * @param { CustomBuilder } content - Indicates the content of context menu. + * @param { ResponseType } responseType - Indicates response type of context menu. + * @param { ContextMenuOptions } options - Indicates the options of context menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + bindContextMenu(content: CustomBuilder, responseType: ResponseType, options?: ContextMenuOptions): T; + + /** + * ContextMenu control + * + * @param { boolean } isShown - true means display content, false means hide content. + * @param { CustomBuilder } content - Indicates the content of context menu. + * @param { ContextMenuOptions } [options] - Indicates the options of context menu. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindContextMenu(isShown: boolean, content: CustomBuilder, options?: ContextMenuOptions): T; + + /** + * Bind content cover + * + * @param { boolean } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ModalTransition } type - transition type. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bind content cover + * + * @param { boolean } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ModalTransition } type - transition type. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Bind content cover + * + * @param { Optional } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ModalTransition } [type] - transition type. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindContentCover(isShow: Optional, builder: CustomBuilder, type?: ModalTransition): T; + + /** + * Bind content cover + * + * @param { boolean } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ContentCoverOptions } options - options of content cover. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bind content cover + * + * @param { boolean } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ContentCoverOptions } options - options of content cover. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Bind content cover + * + * @param { Optional } isShow - true means display content, false means hide content. + * @param { CustomBuilder } builder - the content to be displayed. + * @param { ContentCoverOptions } [options] - options of content cover. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindContentCover(isShow: Optional, builder: CustomBuilder, options?: ContentCoverOptions): T; + + /** + * Bind sheet + * + * @param { boolean } isShow - true means display sheet, false means hide sheet. + * @param { CustomBuilder } builder - the sheet to be displayed. + * @param { SheetOptions } options - options of sheet. + * @returns { T } - template type + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bind sheet + * + * @param { boolean } isShow - true means display sheet, false means hide sheet. + * @param { CustomBuilder } builder - the sheet to be displayed. + * @param { SheetOptions } options - options of sheet. + * @returns { T } - template type + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Bind sheet + * + * @param { Optional } isShow - true means display sheet, false means hide sheet. + * @param { CustomBuilder } builder - the sheet to be displayed. + * @param { SheetOptions } [options] - options of sheet. + * @returns { T } - template type + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + bindSheet(isShow: Optional, builder: CustomBuilder, options?: SheetOptions): T; + + /** + * Sets styles for component state. + * + * @param { StateStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets styles for component state. + * + * @param { StateStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets styles for component state. + * + * @param { StateStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets styles for component state. + * + * @param { StateStyles } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stateStyles(value: StateStyles): T; + + /** + * id for distribute identification. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * id for distribute identification. + * + * @param { number } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + restoreId(value: number): T; + + /** + * Trigger a visible area change event. + * + * @param { Array } ratios + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Trigger a visible area change event. + * + * @param { Array } ratios + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger a visible area change event. + * + * @param { Array } ratios + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Trigger a visible area change event. + * + * @param { Array } ratios + * @param { VisibleAreaChangeCallback } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onVisibleAreaChange(ratios: Array, event: VisibleAreaChangeCallback): T; + + /** + * Set the spherical effect of the component. + * + * @param { number } value - set the degree of spherical effect, value range [0, 1]. + * If the value is 0, the component keep same, else the value is 1, component are fully spherical. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + sphericalEffect(value: number): T; + + /** + * Set the light up effect of the component + * + * @param { number } value - set the degree to which the component lights up, value range [0, 1]. + * The color brightness in the component rendering content area is greater than the value and can be displayed, otherwise it will not be displayed. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lightUpEffect(value: number): T; + + /** + * Set the edge pixel stretch effect of the Component. + * + * @param { PixelStretchEffectOptions } options + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pixelStretchEffect(options: PixelStretchEffectOptions): T; + + /** + * Sets hot keys + * + * @param { string | FunctionKey } value - Character of the combination key. + * @param { Array } keys - The modifier keys modify the action of key when the key are pressed at the same time. + * @param { function } [action] - Callback function, triggered when the shortcut keyboard is pressed. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets hot keys + * + * @param { string | FunctionKey } value - Character of the combination key. + * @param { Array } keys - The modifier keys modify the action of key when the key are pressed at the same time. + * @param { function } [action] - Callback function, triggered when the shortcut keyboard is pressed. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + keyboardShortcut(value: string | FunctionKey, keys: Array, action?: () => void): T; + + /** + * Sets accessibilityGroup + * + * @param { boolean } value - set group with accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets accessibilityGroup + * + * @param { boolean } value - set group with accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets accessibilityGroup + * + * @param { boolean } value - set group with accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityGroup(value: boolean): T; + + /** + * Sets accessibilityGroup + * + * @param { boolean } isGroup - set group with accessibility + * @param { AccessibilityOptions } accessibilityOptions - accessibilityOptions for accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + accessibilityGroup(isGroup: boolean, accessibilityOptions: AccessibilityOptions): T; + + /** + * Sets accessibilityText + * + * @param { string } value - set accessibility text + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets accessibilityText + * + * @param { string } value - set accessibility text + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets accessibilityText + * + * @param { string } value - set accessibility text + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityText(value: string): T; + + /** + * Sets accessibilityText + * + * @param { Resource } text - set accessibility text + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityText(text: Resource): T; + + /** + * Sets accessibilityTextHint + * + * @param { string } value - set accessibility text hint + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityTextHint(value: string): T; + + /** + * Sets accessibilityDescription + * + * @param { string } value - set description of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets accessibilityDescription + * + * @param { string } value - set description of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets accessibilityDescription + * + * @param { string } value - set description of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityDescription(value: string): T; + + /** + * Sets accessibilityDescription + * + * @param { Resource } description - set description of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityDescription(description: Resource): T; + + /** + * Sets accessibilityLevel + * + * @param { string } value - set accessibility level + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets accessibilityLevel + * + * @param { string } value - set accessibility level + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets accessibilityLevel + * + * @param { string } value - set accessibility level + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityLevel(value: string): T; + + /** + * Sets accessibilityVirtualNode + * + * @param { CustomBuilder } builder - set virtual node of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets accessibilityVirtualNode + * + * @param { CustomBuilder } builder - set virtual node of accessibility + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + accessibilityVirtualNode(builder: CustomBuilder): T; + + /** + * Sets accessibilityChecked + * + * @param { boolean } isCheck - set accessibility checked status + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + accessibilityChecked(isCheck: boolean): T; + + /** + * Sets accessibilitySelected + * + * @param { boolean } isSelect - set accessibility selected status + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + accessibilitySelected(isSelect: boolean): T; + + /** + * Sets obscured + * + * @param { Array } reasons - reasons of obscuration + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets obscured + * + * @param { Array } reasons - reasons of obscuration + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + obscured(reasons: Array): T; + + /** + * Reuse id is used for identify the reuse type for each custom node. + * + * @param { string } id - The id for reusable custom node. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Reuse id is used for identify the reuse type for each custom node. + * + * @param { string } id - The id for reusable custom node. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + reuseId(id: string): T; + + /** + * Sets how content is drawn within nodes duration animation + * + * @param { RenderFit } fitMode - The render fit mode of content. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets how content is drawn within nodes duration animation + * + * @param { RenderFit } fitMode - The render fit mode of content. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + renderFit(fitMode: RenderFit): T; + + /** + * Sets the attribute modifier. + * + * @param { AttributeModifier } modifier + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets the attribute modifier. + * + * @param { AttributeModifier } modifier + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + attributeModifier(modifier: AttributeModifier): T; + + /** + * Sets the gesture modifier. + * + * @param { GestureModifier } modifier + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + gestureModifier(modifier: GestureModifier): T; + + /** + * Adds a background dynamic light up effect to the current component. + * + * @param { BackgroundBrightnessOptions } params - params indicates BackgroundBrightnessOptions + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + backgroundBrightness(params: BackgroundBrightnessOptions): T; + + /** + * When a gesture bound to this component will be accepted, a user-defined callback is triggered to get the result + * + * @param { function } callback - A callback instance used when a gesture bound to this component will be accepted. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * When a gesture bound to this component will be accepted, a user-defined callback is triggered to get the result + * + * @param { function } callback - A callback instance used when a gesture bound to this component will be accepted. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onGestureJudgeBegin(callback: (gestureInfo: GestureInfo, event: BaseGestureEvent) => GestureJudgeResult): T; + + /** + * When a gesture bound to this component will be accepted, a user-defined callback is triggered to get the result + * + * @param { GestureRecognizerJudgeBeginCallback } callback - A callback instance used when a gesture bound to this component will be accepted. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onGestureRecognizerJudgeBegin(callback: GestureRecognizerJudgeBeginCallback): T; + + /** + * When a gesture bound to this component will be accepted, a user-defined callback is triggered to get the result + * + * @param { GestureRecognizerJudgeBeginCallback } callback - A callback instance used when a gesture bound to this component will be accepted. + * @param { boolean } exposeInnerGesture - This parameter is a flag. This flag determines whether to expose internal gestures. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * + * @since 13 + */ + onGestureRecognizerJudgeBegin(callback: GestureRecognizerJudgeBeginCallback, exposeInnerGesture: boolean): T; + + /** + * In the touch test phase, the recognizer is selected to form a parallel relationship with other recognizers on the response chain. + * + * @param { ShouldBuiltInRecognizerParallelWithCallback } callback - A callback instance used when a component is doing touch test. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + shouldBuiltInRecognizerParallelWith(callback: ShouldBuiltInRecognizerParallelWithCallback): T; + + /** + * Events are monopolized by components. + * + * @param { boolean } monopolize - indicate the monopoly of events + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Events are monopolized by components. + * + * @param { boolean } monopolize - indicate the monopoly of events + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + monopolizeEvents(monopolize: boolean): T; + + /** + * When the component does a touch test, a user-defined callback is triggered. + * + * @param { Callback } callback - A callback instance used when the component does a touch test. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onTouchIntercept(callback: Callback): T; + + /** + * This callback is triggered when the size of this component change finished. + * + * @param { SizeChangeCallback } event - event callback. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + onSizeChange(event: SizeChangeCallback): T; } -declare interface BaseEvent {} +/** + * CommonAttribute for ide. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * CommonAttribute for ide. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CommonAttribute for ide. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CommonAttribute for ide. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CommonAttribute extends CommonMethod {} -declare interface ClickEvent extends BaseEvent { +/** + * CommonInterface for ide. + * + * @interface CommonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * CommonInterface for ide. + * + * @interface CommonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CommonInterface for ide. + * + * @interface CommonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CommonInterface for ide. + * + * @interface CommonInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface CommonInterface { + /** + * Constructor. + * + * @returns { CommonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Constructor + * + * @returns { CommonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Constructor + * + * @returns { CommonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructor + * + * @returns { CommonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (): CommonAttribute; +} + +/** + * CommonInstance for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * CommonInstance for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CommonInstance for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CommonInstance for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const CommonInstance: CommonAttribute; + +/** + * Common for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Common for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Common for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Common for ide. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Common: CommonInterface; + +/** + * Defines the CustomBuilder Type. + * + * @typedef { (() => any) | void } CustomBuilder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the CustomBuilder Type. + * + * @typedef { (() => any) | void } CustomBuilder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the CustomBuilder Type. + * + * @typedef { (() => any) | void } CustomBuilder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the CustomBuilder Type. + * + * @typedef { (() => any) | void } CustomBuilder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type CustomBuilder = (() => any) | void; + +/** + * Defines the OverlayOptions interface. + * + * @typedef OverlayOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface OverlayOptions { + /** + * Defines align type. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines align type. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines align type. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines align type. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + align?: Alignment; + + /** + * Defines offset type. + * + * @type { ?OverlayOffset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines offset type. + * + * @type { ?OverlayOffset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines offset type. + * + * @type { ?OverlayOffset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines offset type. + * + * @type { ?OverlayOffset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + offset?: OverlayOffset; +} + +/** + * Defines the OverlayOffset. + * + * @typedef OverlayOffset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface OverlayOffset { + /** + * Defines x. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines x. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines x. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines x. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: number; + /** + * Defines y. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines y. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines y. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines y. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: number; +} + +/** + * Defines the segment of blur. + * The first element in the tuple means fraction. + * The range of this value is [0,1]. A value of 1 means opaque and 0 means completely transparent. + * The second element means the stop position. + * The range of this value is [0,1]. A value of 1 means region ending position and 0 means region starting position. + * + * @typedef { [ number, number ] } FractionStop + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare type FractionStop = [ number, number ]; + +/** + * CommonShapeMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * CommonShapeMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * CommonShapeMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * CommonShapeMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CommonShapeMethod extends CommonMethod { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 9 + */ + constructor(); + + /** + * border Color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * border Color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * border Color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * border Color + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + stroke(value: ResourceColor): T; + + /** + * Fill color. + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Fill color. + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Fill color. + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Fill color. + * + * @param { ResourceColor } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fill(value: ResourceColor): T; + + /** + * Offset from the start point of the border drawing. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Offset from the start point of the border drawing. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Offset from the start point of the border drawing. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Offset from the start point of the border drawing. + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeDashOffset(value: number | string): T; + + /** + * Path endpoint drawing style. + * + * @param { LineCapStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Path endpoint drawing style. + * + * @param { LineCapStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Path endpoint drawing style. + * + * @param { LineCapStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Path endpoint drawing style. + * + * @param { LineCapStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeLineCap(value: LineCapStyle): T; + + /** + * Border corner drawing style. + * + * @param { LineJoinStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Border corner drawing style. + * + * @param { LineJoinStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Border corner drawing style. + * + * @param { LineJoinStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Border corner drawing style. + * + * @param { LineJoinStyle } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeLineJoin(value: LineJoinStyle): T; + + /** + * Limits for drawing acute angles as bevels + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Limits for drawing acute angles as bevels + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Limits for drawing acute angles as bevels + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Limits for drawing acute angles as bevels + * + * @param { number | string } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeMiterLimit(value: number | string): T; + + /** + * Sets the opacity of the border. + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the opacity of the border. + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the opacity of the border. + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the opacity of the border. + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeOpacity(value: number | string | Resource): T; + + /** + * fill Opacity + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * fill Opacity + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * fill Opacity + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * fill Opacity + * + * @param { number | string | Resource } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fillOpacity(value: number | string | Resource): T; + + /** + * Sets the width of the dividing line. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the width of the dividing line. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the width of the dividing line. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the width of the dividing line. + * + * @param { Length } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeWidth(value: Length): T; + + /** + * Indicates whether to enable anti-aliasing + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether to enable anti-aliasing + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates whether to enable anti-aliasing + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates whether to enable anti-aliasing + * + * @param { boolean } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + antiAlias(value: boolean): T; + + /** + * Sets the gap for the border. + * + * @param { Array } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the gap for the border. + * + * @param { Array } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the gap for the border. + * + * @param { Array } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the gap for the border. + * + * @param { Array } value + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeDashArray(value: Array): T; +} + +/** + * Linear Gradient Interface + * + * @interface LinearGradient + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Linear Gradient Interface + * + * @interface LinearGradient + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Linear Gradient Interface + * + * @interface LinearGradient + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface LinearGradient { + /** + * Linear Gradient Angle + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Linear Gradient Angle + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Linear Gradient Angle + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + angle?: number | string; + /** + * Linear Gradient Direction + * + * @type { ?GradientDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Linear Gradient Direction + * + * @type { ?GradientDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Linear Gradient Direction + * + * @type { ?GradientDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + direction?: GradientDirection; + /** + * Linear Gradient Colors + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Linear Gradient Colors + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Linear Gradient Colors + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Linear Gradient Colors + * + * @type { Array<[ResourceColor, number]> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + colors: Array<[ResourceColor, number]>; + /** + * Linear Gradient Repeating + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Linear Gradient Repeating + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Linear Gradient Repeating + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + repeating?: boolean; +} + +/** + * Defines the pixel round property. + * + * @interface PixelRoundPolicy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface PixelRoundPolicy { + /** + * start property. + * + * @type { ?PixelRoundCalcPolicy } + * @default PixelRoundCalcPolicy.NO_FORCE_ROUND + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + start?: PixelRoundCalcPolicy; + + /** + * top property. + * + * @type { ?PixelRoundCalcPolicy } + * @default PixelRoundCalcPolicy.NO_FORCE_ROUND + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + top?: PixelRoundCalcPolicy; + + /** + * end property. + * + * @type { ?PixelRoundCalcPolicy } + * @default PixelRoundCalcPolicy.NO_FORCE_ROUND + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + end?: PixelRoundCalcPolicy; + + /** + * bottom property. + * + * @type { ?PixelRoundCalcPolicy } + * @default PixelRoundCalcPolicy.NO_FORCE_ROUND + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + bottom?: PixelRoundCalcPolicy; +} + +/** + * Linear Gradient Blur Interface + * + * @interface LinearGradientBlurOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface LinearGradientBlurOptions { + /** + * Percentage of blurring effect. + * + * @type { FractionStop[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + fractionStops: FractionStop[]; + /** + * Direction of linear gradient blur. + * + * @type { GradientDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + direction: GradientDirection; +} + +/** + * Define motion blur anchor coordinates. + * + * @interface MotionBlurAnchor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface MotionBlurAnchor { + /** + * Define anchor coordinate x-value.Value range [0.0, 1.0]. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + x: number; + /** + * Define anchor coordinate y-value.Value range [0.0, 1.0]. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + y: number; +} + +/** + * Define motion blur options. + * + * @interface MotionBlurOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface MotionBlurOptions { + /** + * Define the size of motion blur radius.The range of this value is [0.0, ∞). + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + radius: number; + /** + * Define motion blur anchor coordinates. + * + * @type { MotionBlurAnchor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + anchor: MotionBlurAnchor; +} + +/** + * Sub component border info. + * + * @interface LayoutBorderInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ +declare interface LayoutBorderInfo { + /** + * Sub component borderWidth info. + * + * @type { EdgeWidths } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + borderWidth: EdgeWidths; + + /** + * Sub component margin info. + * + * @type { Margin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + margin: Margin, + + /** + * Sub component padding info. + * + * @type { Padding } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + padding: Padding, +} + +/** + * Sub component layout info. + * + * @interface LayoutInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ +declare interface LayoutInfo { + /** + * Sub component position info. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + position: Position, + + /** + * Sub component constraint info. + * + * @type { ConstraintSizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + constraint: ConstraintSizeOptions, +} + +/** + * Sub component info passed from framework when layout and measure happens. + * + * @interface LayoutChild + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ +declare interface LayoutChild { + /** + * Sub component name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + name: string, + + /** + * Sub component id. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + id: string, + + /** + * Sub component constraint. + * + * @type { ConstraintSizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + constraint: ConstraintSizeOptions, + + /** + * Sub component border info. + * + * @type { LayoutBorderInfo } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + borderInfo: LayoutBorderInfo, + + /** + * Sub component position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + position: Position, + + /** + * Call this measure method in onMeasure callback to supply sub component size. + * + * @param { ConstraintSizeOptions } childConstraint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + measure(childConstraint: ConstraintSizeOptions), + + /** + * Call this layout method in onLayout callback to assign layout info to sub component. + * + * @param { LayoutInfo } childLayoutInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + */ + layout(childLayoutInfo: LayoutInfo), +} + +/** + * Sub component layout info. + * + * @interface GeometryInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sub component layout info. + * + * @interface GeometryInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface GeometryInfo extends SizeResult { + /** + * Sub component borderWidth info. + * + * @type { EdgeWidth } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sub component borderWidth info. + * + * @type { EdgeWidth } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + borderWidth: EdgeWidth; + + /** + * Sub component margin info. + * + * @type { Margin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sub component margin info. + * + * @type { Margin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + margin: Margin, + + /** + * Sub component padding info. + * + * @type { Padding } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sub component padding info. + * + * @type { Padding } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + padding: Padding, +} + +/** + * Sub component info passed from framework when layout happens. + * + * @interface Layoutable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sub component info passed from framework when layout happens. + * + * @interface Layoutable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface Layoutable { + /** + * Measurement result of the child component. + * + * @type { MeasureResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Measurement result of the child component. + * + * @type { MeasureResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + measureResult: MeasureResult, + + /** + * Call this layout method in onLayout callback to assign layout info to sub component. + * + * @param { Position } position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Call this layout method in onLayout callback to assign layout info to sub component. + * + * @param { Position } position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + layout(position: Position): void, + + /** + * Call this method to get the margin of sub component. + * + * @returns { DirectionalEdgesT } the margin of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getMargin() : DirectionalEdgesT, + + /** + * Call this method to get the padding of sub component. + * + * @returns { DirectionalEdgesT } the padding of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getPadding() : DirectionalEdgesT, + + /** + * Call this method to get the borderWidth of sub component. + * + * @returns { DirectionalEdgesT } the borderWidth of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getBorderWidth() : DirectionalEdgesT, +} + +/** + * Sub component info passed from framework when measure happens. + * + * @interface Measurable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sub component info passed from framework when measure happens. + * + * @interface Measurable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface Measurable { + /** + * Call this measure method in onMeasure callback to supply sub component size. + * + * @param { ConstraintSizeOptions } constraint + * @returns { MeasureResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Call this measure method in onMeasure callback to supply sub component size. + * + * @param { ConstraintSizeOptions } constraint + * @returns { MeasureResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + measure(constraint: ConstraintSizeOptions) : MeasureResult, + + /** + * Call this method to get the margin of sub component. + * + * @returns { DirectionalEdgesT } the margin of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getMargin() : DirectionalEdgesT, + + /** + * Call this method to get the padding of sub component. + * + * @returns { DirectionalEdgesT } the padding of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getPadding() : DirectionalEdgesT, + + /** + * Call this method to get the borderWidth of sub component. + * + * @returns { DirectionalEdgesT } the borderWidth of sub component, unit is vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getBorderWidth() : DirectionalEdgesT, +} + +/** + * Sub component SizeResult info. + * + * @interface SizeResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sub component SizeResult info. + * + * @interface SizeResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SizeResult { + /** + * Width obtained from the measurement result. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Width obtained from the measurement result. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + width: number, + + /** + * Height obtained from the measurement result. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Height obtained from the measurement result. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + height: number, +} + +/** + * Sub component MeasureResult info. + * + * @interface MeasureResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Sub component MeasureResult info. + * + * @interface MeasureResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MeasureResult extends SizeResult { + +} + +/** + * The navigation destination information. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * The navigation destination information. + * + * @typedef {import('../api/@ohos.arkui.observer').default.NavDestinationInfo} NavDestinationInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type NavDestinationInfo = import('../api/@ohos.arkui.observer').default.NavDestinationInfo; + +/** + * The navigation information. + * + * @typedef {import('../api/@ohos.arkui.observer').default.NavigationInfo} NavigationInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type NavigationInfo = import('../api/@ohos.arkui.observer').default.NavigationInfo; + +/** + * The router page information. + * + * @typedef {import('../api/@ohos.arkui.observer').default.RouterPageInfo} RouterPageInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type RouterPageInfo = import('../api/@ohos.arkui.observer').default.RouterPageInfo; + +/** + * UIContext + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * UIContext + * + * @typedef { import('../api/@ohos.arkui.UIContext').UIContext } UIContext + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type UIContext = import('../api/@ohos.arkui.UIContext').UIContext; + +/** + * DrawContext + * + * @typedef { import('../api/arkui/Graphics').DrawContext } DrawContext + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type DrawContext = import('../api/arkui/Graphics').DrawContext; + +/** + * VisualEffect + * + * @typedef { import('../api/@ohos.graphics.uiEffect').default.VisualEffect } VisualEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type VisualEffect = import('../api/@ohos.graphics.uiEffect').default.VisualEffect; - displayX: number; - displayY: number; -} +/** + * Filter + * + * @typedef { import('../api/@ohos.graphics.uiEffect').default.Filter } Filter + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type Filter = import('../api/@ohos.graphics.uiEffect').default.Filter; -declare interface CommonConfiguration { +/** + * Blender + * + * @typedef { import('../api/@ohos.graphics.uiEffect').default.Blender } Blender + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 13 + */ +declare type Blender = import('../api/@ohos.graphics.uiEffect').default.Blender; - enabled: boolean, +/** + * ComponentContent. + * + * @typedef {import('../api/arkui/ComponentContent').ComponentContent} ComponentContent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ComponentContent = import('../api/arkui/ComponentContent').ComponentContent; - contentModifier: ContentModifier -} +/** + * Theme. + * + * @typedef {import('../api/@ohos.arkui.theme').Theme} Theme + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type Theme = import('../api/@ohos.arkui.theme').Theme; -interface ICurve { +/** + * Custom Component + * + * @extends CommonAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Custom Component + * + * @extends CommonAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Custom Component + * + * @extends CommonAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Custom Component + * + * @extends CommonAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class CustomComponent extends CommonAttribute { + /** + * Customize the pop-up content constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Customize the pop-up content constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Customize the pop-up content constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Customize the pop-up content constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + build(): void; - interpolate(fraction: number): number; -} + /** + * aboutToAppear Method + * + * The aboutToAppear function is executed after a new instance of the custom component is created, before its build() function is executed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * aboutToAppear Method + * + * The aboutToAppear function is executed after a new instance of the custom component is created, before its build() function is executed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * aboutToAppear Method + * + * The aboutToAppear function is executed after a new instance of the custom component is created, before its build() function is executed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * aboutToAppear Method + * + * The aboutToAppear function is executed after a new instance of the custom component is created, before its build() function is executed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + aboutToAppear?(): void; -declare interface StateStyles { + /** + * aboutToDisappear Method + * + * The aboutToDisappear function executes before a custom component is destroyed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * aboutToDisappear Method + * + * The aboutToDisappear function executes before a custom component is destroyed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * aboutToDisappear Method + * + * The aboutToDisappear function executes before a custom component is destroyed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * aboutToDisappear Method + * + * The aboutToDisappear function executes before a custom component is destroyed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + aboutToDisappear?(): void; - normal?: any; -} + /** + * aboutToReuse Method + * + * @param { object } params - Custom component init params. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * aboutToReuse Method + * + * @param { object } params - Custom component init params. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + aboutToReuse?(params: { [key: string]: unknown }): void; -declare interface AttributeModifier{} -declare interface ContentModifier{} + /** + * aboutToRecycle Method + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * aboutToRecycle Method + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + aboutToRecycle?(): void; -declare interface SheetTitleOptions { - title: ResourceStr; - subtitle?: ResourceStr; -} + /** + * The onWillApplyTheme function is a custom hook to get active theme object from the context + * + * @param { Theme } theme - Custom theme init params. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillApplyTheme?(theme: Theme): void; -declare interface UICommonEvent { - setOnClick(callback: Callback | undefined): void; -} + /** + * Custom component override this method to layout each of its sub components. + * + * @param { Array } children + * @param { ConstraintSizeOptions } constraint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + * @useinstead CustomComponent#onPlaceChildren + */ + onLayout?(children: Array, constraint: ConstraintSizeOptions): void; -declare enum SheetSize { - MEDIUM, - LARGE, - FIT_CONTENT = 2, -} + /** + * Custom component override this method to layout each of its sub components. + * + * @param { GeometryInfo } selfLayoutInfo + * @param { Array } children + * @param { ConstraintSizeOptions } constraint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Custom component override this method to layout each of its sub components. + * + * @param { GeometryInfo } selfLayoutInfo + * @param { Array } children + * @param { ConstraintSizeOptions } constraint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onPlaceChildren?(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): void; -declare enum SheetType { - BOTTOM = 0, - CENTER = 1, - POPUP = 2, -} + /** + * Custom component override this method to measure each of its sub components. + * + * @param { Array } children + * @param { ConstraintSizeOptions } constraint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + * @deprecated since 10 + * @useinstead CustomComponent#onMeasureSize + */ + onMeasure?(children: Array, constraint: ConstraintSizeOptions): void; -declare enum SheetMode { - OVERLAY = 0, - EMBEDDED = 1, -} + /** + * Custom component override this method to measure each of its sub components. + * @param { GeometryInfo } selfLayoutInfo + * @param { Array } children - indicate the measure child + * @param { ConstraintSizeOptions } constraint - indicate child constraint size + * @returns { SizeResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Custom component override this method to measure each of its sub components. + * @param { GeometryInfo } selfLayoutInfo + * @param { Array } children - indicate the measure child + * @param { ConstraintSizeOptions } constraint - indicate child constraint size + * @returns { SizeResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onMeasureSize?(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): SizeResult; -declare enum ShadowStyle { - OUTER_DEFAULT_XS, - OUTER_DEFAULT_SM, - OUTER_DEFAULT_MD, - OUTER_DEFAULT_LG, - OUTER_FLOATING_SM, - OUTER_FLOATING_MD, -} + /** + * onPageShow Method + * + * The page is triggered once each time it is displayed, including scenarios such as the routing process and the application entering the foreground + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * onPageShow Method + * + * The page is triggered once each time it is displayed, including scenarios such as the routing process and the application entering the foreground + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * onPageShow Method + * + * The page is triggered once each time it is displayed, including scenarios such as the routing process and the application entering the foreground + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onPageShow?(): void; -declare enum ShadowType { - COLOR, - BLUR, -} + /** + * onPageHide Method + * + * It is triggered once each time the page is hidden, including scenarios such as the routing process and the application entering the background + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * onPageHide Method + * + * It is triggered once each time the page is hidden, including scenarios such as the routing process and the application entering the background + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * onPageHide Method + * + * It is triggered once each time the page is hidden, including scenarios such as the routing process and the application entering the background + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onPageHide?(): void; -declare interface ShadowOptions { - radius: number | Resource; - type?: ShadowType; - color?: Color | string | Resource | ColoringStrategy; - offsetX?: number | Resource; - offsetY?: number | Resource; - fill?: boolean; -} + /** + * onFormRecycle Method, this is only for ArkTS form, if form was marked recyclable by form user, when system memory is low, + * it will be recycled after calling this method, you should return a string of params that you wish to be saved, it will be + * passed back as params in onFormRecover, in which you can recover the form + * + * @returns { string } status data of ArkTS form UI, this data will be passed in when recover form later + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * onFormRecycle Method, this is only for ArkTS form, if form was marked recyclable by form user, when system memory is low, + * it will be recycled after calling this method, you should return a string of params that you wish to be saved, it will be + * passed back as params in onFormRecover, in which you can recover the form + * + * @returns { string } status data of ArkTS form UI, this data will be passed in when recover form later + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + onFormRecycle?(): string; -declare interface SheetDismiss { - dismiss: () => void; -} + /** + * onFormRecover Method, this is only for ArkTS form + * + * @param { string } statusData - indicate status data of ArkTS form UI, which is acquired by calling onFormRecycle, it is used to recover form + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * onFormRecover Method, this is only for ArkTS form + * + * @param { string } statusData - indicate status data of ArkTS form UI, which is acquired by calling onFormRecycle, it is used to recover form + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + onFormRecover?(statusData: string): void; -declare enum DismissReason { - PRESS_BACK = 0, - TOUCH_OUTSIDE = 1, - CLOSE_BUTTON = 2, - SLIDE_DOWN = 3 -} + /** + * onBackPress Method + * + * Triggered when the user clicks the back button + * + * @returns { void | boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * onBackPress Method + * + * Triggered when the user clicks the back button + * + * @returns { void | boolean } true means that the page itself processes the return logic. + * false means that the default return logic is used. + * If no value is returned, the default return logic is used. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * onBackPress Method + * + * Triggered when the user clicks the back button + * + * @returns { void | boolean } true means that the page itself processes the return logic. + * false means that the default return logic is used. + * If no value is returned, the default return logic is used. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onBackPress?(): void | boolean; -declare interface DismissSheetAction { - dismiss: Callback; - reason: DismissReason; -} + /** + * PageTransition Method. + * Implement Animation when enter this page or move to other pages. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * PageTransition Method. + * Implement Animation when enter this page or move to other pages. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * PageTransition Method. + * Implement Animation when enter this page or move to other pages. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pageTransition?(): void; -declare interface SpringBackAction { - springBack: Callback; -} + /** + * Get current UIContext + * + * @returns { UIContext } The UIContext that the custom component belongs to. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get current UIContext + * + * @returns { UIContext } The UIContext that the custom component belongs to. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getUIContext(): UIContext; -declare type CustomBuilder = (() => any) | void; + /** + * Get uniqueId of the custom component. + * + * @returns { number } - The uniqueId of the custom component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getUniqueId(): number; -declare interface BindOptions { - backgroundColor?: ResourceColor; - onAppear?: () => void; - onDisappear?: () => void; - onWillAppear?: () => void; - onWillDisappear?: () => void; -} + /** + * Queries the navigation destination information. + * + * @returns { NavDestinationInfo | undefined } The navigation destination information, or undefined if it is not available. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Queries the navigation destination information. + * + * @returns { NavDestinationInfo | undefined } The navigation destination information, or undefined if it is not available. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + queryNavDestinationInfo(): NavDestinationInfo | undefined; -declare type UIContext = import('../api/@ohos.arkui.UIContext').UIContext; // hack + /** + * Query the navigation information of the current custom component. + * + * @returns { NavigationInfo | undefined } The navigation information, or undefined if it is not available + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + queryNavigationInfo(): NavigationInfo | undefined; -declare enum ScrollSizeMode { - FOLLOW_DETENT = 0, - CONTINUOUS = 1, -} + /** + * Query the router page information of the current custom component. + * + * @returns { RouterPageInfo | undefined } The router page information, or undefined if it is not available. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + queryRouterPageInfo(): RouterPageInfo | undefined; -declare enum SheetKeyboardAvoidMode { - NONE = 0, - TRANSLATE_AND_RESIZE = 1, - RESIZE_ONLY = 2, - TRANSLATE_AND_SCROLL = 3, + /** + * The callback method after the custom component is built. + * + * Triggered when the custom component has been built. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidBuild?(): void; } -declare interface SheetOptions extends BindOptions { - height?: SheetSize | Length; - dragBar?: boolean; - maskColor?: ResourceColor; - detents?: [(SheetSize | Length), (SheetSize | Length)?, (SheetSize | Length)?]; - blurStyle?: BlurStyle; - showClose?: boolean | Resource; - preferType?: SheetType; - title?: SheetTitleOptions | CustomBuilder; - shouldDismiss?: (sheetDismiss: SheetDismiss) => void; - onWillDismiss?: Callback; - onWillSpringBackWhenDismiss?: Callback; - enableOutsideInteractive?: boolean; - width?: Dimension; - borderWidth?: Dimension | EdgeWidths | LocalizedEdgeWidths; - borderColor?: ResourceColor | EdgeColors | LocalizedEdgeColors; - borderStyle?: BorderStyle | EdgeStyles; - shadow?: ShadowOptions | ShadowStyle; - onHeightDidChange?: Callback; - mode?: SheetMode; - scrollSizeMode?: ScrollSizeMode; - onDetentsDidChange?: Callback; - onWidthDidChange?: Callback; - onTypeDidChange?: Callback; - uiContext?: UIContext; - keyboardAvoidMode?: SheetKeyboardAvoidMode; - offset?: Position; +/** + * View + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ +/** + * View + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 9 + */ +declare class View { + /** + * Just use for generate tsbundle + * + * @param { any } value + * @returns { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 7 + */ + /** + * Just use for generate tsbundle + * + * @param { any } value + * @returns { any } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 9 + */ + create(value: any): any; } -declare enum BlurStyle { - Thin = 0, -} +/** + * Rect info. + * + * @interface RectResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Rect info. + * + * @interface RectResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RectResult { + /** + * x:Horizontal coordinate relative to the component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * x:Horizontal coordinate relative to the component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + x: number; -declare enum ThemeColorMode { - SYSTEM = 0, - LIGHT = 1, - DARK = 2 -} + /** + * y:Vertical axis coordinate relative to the component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * y:Vertical axis coordinate relative to the component. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + y: number; -declare enum AdaptiveColor { - DEFAULT = 0, -} + /** + * Get the width of the current textRect. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get the width of the current textRect. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + width: number; -declare interface BlurOptions { - grayscale: [number, number]; + /** + * Get the height of the current textRect. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get the height of the current textRect. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + height: number; } +/** + * CaretOffset info. + * + * @interface CaretOffset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * CaretOffset info. + * + * @interface CaretOffset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CaretOffset { + /** + * Get the index of the CaretOffset + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Get the index of the CaretOffset + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + index: number; - -declare interface BlurStyleOptions { - colorMode?: ThemeColorMode; - adaptiveColor?: AdaptiveColor; - scale?: number; - blurOptions?: BlurOptions; + /** + * Get the x of the relative position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Get the x of the relative position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + x: number; + + /** + * Get the y of the relative position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Get the y of the relative position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + y: number; } -declare enum BlurStyleActivePolicy { - /** - * The component has the blur effect only when the window is focused. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - FOLLOWS_WINDOW_ACTIVE_STATE = 0, +/** + * TextContentControllerBase + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * TextContentControllerBase + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare abstract class TextContentControllerBase { + /** + * Get the index and relative position of the CaretOffset. + * + * @returns { CaretOffset } index and relative position of the CaretOffset. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the index and relative position of the CaretOffset. + * + * @returns { CaretOffset } index and relative position of the CaretOffset. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getCaretOffset() : CaretOffset; - /** - * The component always has the blur effect, regardless of whether the window is focused. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - ALWAYS_ACTIVE = 1, + /** + * Get the start and end positions of the text content. + * + * @returns { RectResult } Text content rect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the start and end positions of the text content. + * + * @returns { RectResult } Text content rect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getTextContentRect() : RectResult; - /** - * The component does not have the blur effect, regardless of whether the window is focused. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - ALWAYS_INACTIVE = 2, + /** + * Get the lines number of the text content. + * + * @returns { number } Text content line count + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Get the lines number of the text content. + * + * @returns { number } Text content line count + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getTextContentLineCount() : number; } -declare enum BlurType { - /** - * The blur is applied within the window. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - WITHIN_WINDOW = 0, - /** - * The blur is applied behind the window. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - BEHIND_WINDOW = 1 -} +/** + * Enum of scrollable containers' content clip mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare enum ContentClipMode { + /** + * Clip to content rect inside margin & padding. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + CONTENT_ONLY = 0, -declare interface BackgroundBlurStyleOptions extends BlurStyleOptions { - policy?: BlurStyleActivePolicy; - inactiveColor?: ResourceColor; -} + /** + * Clip to scrollable's outer rect, including padding but inside margin. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + BOUNDARY = 1, -declare interface SizeResult { - width: number, - height: number, + /** + * Clip to the safeArea of scrollable container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + SAFE_AREA = 2, } -declare type EdgeWidths = { - top?: Length; - right?: Length; - bottom?: Length; - left?: Length; -}; - -declare type EdgeWidth = EdgeWidths; +/** + * CommonScrollableMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * CommonScrollableMethod + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class ScrollableCommonMethod extends CommonMethod { + /** + * Scrollbar status. + * + * @param { BarState } barState - Scrollbar status. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBar(barState: BarState): T; -declare type Padding = { - top?: Length; - right?: Length; - bottom?: Length; - left?: Length; -}; + /** + * Color of the scrollbar. + * + * @param { Color | number | string } color - Color of the scrollbar. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarColor(color: Color | number | string): T; -declare interface LocalizedEdgeWidths { - top?: LengthMetrics; - end?: LengthMetrics; - bottom?: LengthMetrics; - start?: LengthMetrics; -}; + /** + * Width of the scrollbar. + * + * @param { number | string } value - Width of the scrollbar. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarWidth(value: number | string): T; -declare type EdgeColors = { - top?: ResourceColor; - right?: ResourceColor; - bottom?: ResourceColor; - left?: ResourceColor; -}; + /** + * Edge scrolling effect. + * + * @param { EdgeEffect } edgeEffect - edge scrolling effect. + * @param { EdgeEffectOptions } options - edge scrolling effect options. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + edgeEffect(edgeEffect: EdgeEffect, options?: EdgeEffectOptions): T; -declare interface LocalizedEdgeColors { - top?: ResourceColor; - end?: ResourceColor; - bottom?: ResourceColor; - start?: ResourceColor; -}; + /** + * Called when setting whether to enable fading Edge effect. + * + * @param { Optional } enabled - Whether to turn on the edge fade effect + * @param { FadingEdgeOptions } [options] - The options of fadingEdge. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + fadingEdge(enabled: Optional, options?: FadingEdgeOptions): T; -declare type BorderRadiuses = { - topLeft?: Length; - topRight?: Length; - bottomLeft?: Length; - bottomRight?: Length; -}; + /** + * Nested scrolling options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: NestedScrollOptions): T; -declare interface LocalizedBorderRadiuses { - topStart?: LengthMetrics; - topEnd?: LengthMetrics; - bottomStart?: LengthMetrics; - bottomEnd?: LengthMetrics; -}; + /** + * Whether to support scroll gestures by finger or mouse. + * + * @param { boolean } value - Whether to support scroll gestures by finger or mouse. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableScrollInteraction(value: boolean): T; -declare enum BorderStyle { - Dotted, - Dashed, - Solid, -} + /** + * Friction coefficient. + * + * @param { number | Resource } value - friction coefficient. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + friction(value: number | Resource): T; -declare type EdgeStyles = { - top?: BorderStyle; - right?: BorderStyle; - bottom?: BorderStyle; - left?: BorderStyle; -}; + /** + * Called when the scrollable scrolls. + * + * @param { function } event - callback of scrollable, + * scrollOffset is offset per frame scrolling, ScrollState is current scroll state. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead ScrollableCommonMethod#onDidScroll + */ + onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void): T; -declare interface BorderOptions { - //width?: EdgeWidths | Length | LocalizedEdgeWidths; - //color?: EdgeColors | ResourceColor | LocalizedEdgeColors; - //radius?: BorderRadiuses | Length | LocalizedBorderRadiuses; - //style?: EdgeStyles | BorderStyle; -} + /** + * Called when the scrollable will scroll. + * + * @param { Optional } handler - callback of scrollable. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillScroll(handler: Optional): T; -declare enum DragPreviewMode { - AUTO = 1, - DISABLE_SCALE = 2, - ENABLE_DEFAULT_SHADOW = 3, - ENABLE_DEFAULT_RADIUS = 4, -} + /** + * Called when the scrollable did scroll. + * + * @param { OnScrollCallback } handler - callback of scrollable, + * scrollOffset is offset this frame did scroll, scrollState is current scroll state. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + onDidScroll(handler: OnScrollCallback): T; -declare type ImageModifier = import('../api/arkui/ImageModifier').ImageModifier; // hack + /** + * Called when the scrollable reaches the start position. + * + * @param { function } event - Callback function, triggered when the scrollable reaches the start position. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReachStart(event: () => void): T; -declare interface DragPreviewOptions { - mode?: DragPreviewMode | Array; - modifier?: ImageModifier; - numberBadge?: boolean | number; -} + /** + * Called when the scrollable reaches the end position. + * + * @param { function } event - Callback function, triggered when the scrollable reaches the end position. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReachEnd(event: () => void): T; -declare interface DragInteractionOptions { + /** + * Called when the scrollable starts scrolling. + * + * @param { function } event - Callback function, triggered when the scrollable starts scrolling. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollStart(event: () => void): T; - isMultiSelectionEnabled?: boolean; + /** + * Called when the scrollable stops scrolling. + * + * @param { function } event - Callback function, triggered when the scrollable stops scrolling. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollStop(event: () => void): T; - defaultAnimationBeforeLifting?: boolean; -} + /** + * Limit the max speed when fling. + * + * @param { number } speedLimit - Max fling speed, the minimum value is 0, the maximum value is not limited. + * The unit is vp/s. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + flingSpeedLimit(speedLimit: number): T; -declare enum GradientDirection { - Left, - Top, - Right, - Bottom, - LeftTop, - LeftBottom, - RightTop, - RightBottom, - None, + /** + * Clip the content of the scrollable container, excluding background. + * + * @param { ContentClipMode | RectShape } clip - A value from enum ContentClipMode or a customized clip rect. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + clipContent(clip: ContentClipMode | RectShape): T; } -declare interface LinearGradient { - angle?: number | string; - direction?: GradientDirection; - colors: Array<[ResourceColor, number]>; - repeating?: boolean; +/** + * The actual offset by which the scrollable scrolls. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ScrollResult { + /** + * Actual offset by which the scrollable scrolls in vp. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offsetRemain: number; } -declare class AttributeModifier {} +/** + * Called before scroll to allow developer to control real offset the Scrollable can scroll. + * + * @typedef { function } OnWillScrollCallback + * @param { number } scrollOffset - offset this frame will scroll, which may or may not be reached. + * @param { ScrollState } scrollState - current scroll state. + * @param { ScrollSource } scrollSource - source of current scroll. + * @returns { void | ScrollResult } the remain offset for the scrollable, + * same as scrollOffset when no ScrollResult is returned. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type OnWillScrollCallback = +(scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => void | ScrollResult; -declare class CommonMethod { +/** + * On scroll callback using in scrollable onDidScroll. + * + * @typedef { function } OnScrollCallback + * @param { number } scrollOffset - offset this frame did scroll. + * @param { ScrollState } scrollState - current scroll state. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type OnScrollCallback = (scrollOffset: number, scrollState: ScrollState) => void; - constructor(); +/** + * Defines the onMove callback. + * + * @typedef { function } OnMoveHandler + * @param { number } from - Index number for moving elements. + * @param { number } to - Target index number for moving elements. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type OnMoveHandler = (from: number, to: number) => void; - stateStyles(value: StateStyles): T; +/** + * Define DynamicNode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class DynamicNode { + /** + * Set the move action. + * + * @param { Optional } handler + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onMove(handler: Optional): T; +} - backdropBlur(value: number, options?: BlurOptions): T; +/** + * Define EdgeEffect Options. + * + * @interface EdgeEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Define EdgeEffect Options. + * + * @interface EdgeEffectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface EdgeEffectOptions { + /** + * Enable Sliding effect when component does not full screen. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Enable Sliding effect when component does not full screen. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + alwaysEnabled: boolean; +} - width(value: Length): T; +/** + * Indicates children main size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ChildrenMainSize { + /** + * Creates an instance of ChildrenMainSize. + * + * @param { number } childDefaultSize - default main size, in vp. If the main axis is vertical, it indicates height. + * If the main axis is horizontal, it indicates width. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(childDefaultSize: number); - height(value: Length): T; + /** + * Set default size. + * + * @param { number } value - default main size, in vp. If the main axis is vertical, it indicates height. + * If the main axis is horizontal, it indicates width. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + set childDefaultSize(value: number); - key(value: string): T; + /** + * Get default size + * + * @returns { number } - default main size, in vp. If the main axis is vertical, it indicates height. + * If the main axis is horizontal, it indicates width. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + get childDefaultSize(): number; - restoreId(value: number): T; + /** + * Changes children main size by removing or replacing existing elements and/or adding new elements in place. + * + * @param { number } start - Zero-based index at which to start changing the children main size. + * @param { number } [deleteCount] - Indicating the number of children main size to remove from start. + * @param { Array } [childrenSize] - Add the new children main size, beginning from start. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + * @example splice(1, 0, [100]), Insert a child after first child, the child's main size is 100vp. + * splice(1, 1), Delete the second child. + * splice(1, 2, [100, 100]), Change the main size of the second and third children to 100vp. + */ + splice(start: number, deleteCount?: number, childrenSize?: Array): void; - padding(value: Padding | Dimension): T; + /** + * Updates main size for specified child. + * + * @param { number } index - index of child to be updated. + * @param { number } childSize - new section options. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + update(index: number, childSize: number): void; +} - bindSheet(isShow: Optional, builder: CustomBuilder, options?: SheetOptions): T; +/** + * Define BackgroundBrightness Options. + * + * @interface BackgroundBrightnessOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface BackgroundBrightnessOptions { - backgroundBlurStyle(value: BlurStyle, options?: BackgroundBlurStyleOptions): T; + /** + * Rate represents the rate at which lightUpDegree + * decreases with increasing pixel brightness. + * + * @type { number } -The default value is 0.0, value range: (0.0, +∞). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + rate: number; - dragPreviewOptions(value: DragPreviewOptions, options?: DragInteractionOptions): T; + /** + * LightUpDegree represents the degree of brightness + * of the rgb value changes when its brightness + * is 0. + * + * @type { number } -The default value is 0.0, value range: [-1.0, 1.0]. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + lightUpDegree: number; +} - linearGradient(value: { - angle?: number | string; - direction?: GradientDirection; - colors: Array<[ResourceColor, number]>; - repeating?: boolean; - }): T; +/** + * PointLightStyle info + * + * @interface PointLightStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ +declare interface PointLightStyle { + /** + * Defines the PointLight light intensity and position. + * + * @type { ?LightSource } + * @default undefined + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + lightSource?: LightSource; + /** + * Defines the PointLight illuminated type. + * + * @type { ?IlluminatedType } + * @default IlluminatedType.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + illuminated?: IlluminatedType; + /** + * Defines the PointLight bloom. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + bloom?: number; +} - border(value: BorderOptions): T; +/** + * LightSource info + * + * @interface LightSource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ +declare interface LightSource { + /** + * Defines the PointLight light positionX. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + positionX: Dimension; + /** + * Defines the PointLight light positionX. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + positionY: Dimension; + /** + * Defines the PointLight light positionX. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + positionZ: Dimension; + /** + * Defines the PointLight light intensity. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + intensity: number; + /** + * Defines the PointLight light color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + color?: ResourceColor; +} - onChildTouchTest(event: (value: Array) => string): T; +/** + * Defining wrapBuilder function. + * @param { function } builder + * @returns { WrappedBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defining wrapBuilder function. + * @param { function } builder + * @returns { WrappedBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare function wrapBuilder(builder: (...args: Args) => void): WrappedBuilder; - attributeModifier(modifier: AttributeModifier): T +/** + * Defines the WrappedBuilder class. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the WrappedBuilder class. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class WrappedBuilder { + /** + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + builder: (...args: Args) => void; - gestureModifier(modifier: GestureModifier): T; + /** + * @param { function } builder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * @param { function } builder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(builder: (...args: Args) => void); +} - onGestureRecognizerJudgeBegin(callback: GestureRecognizerJudgeBeginCallback): T; - onClick(event: (event: ClickEvent) => void): T; +/** + * Defines the overall animation parameters of the keyframe animation. + * + * @interface KeyframeAnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the overall animation parameters of the keyframe animation. + * + * @interface KeyframeAnimateParam + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface KeyframeAnimateParam { + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Animation delay time, in ms. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + delay?: number; - onClick(event: Callback, distanceThreshold: number): T; + /** + * Animation iterations. When set to -1, the animation playing it repeatedly. The value range is greater than or equal to -1. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Animation iterations. When set to -1, the animation playing it repeatedly. The value range is greater than or equal to -1. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + iterations?: number; - /////////////// recently added /////////////// + /** + * Callback invoked when the whole keyframe animation is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Callback invoked when the whole keyframe animation is complete or the ability is about to enter the background. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onFinish?: () => void; +} - backgroundColor(value: ResourceColor): T; +/** + * Defines a keyframe state. + * + * @interface KeyframeState + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines a keyframe state. + * + * @interface KeyframeState + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface KeyframeState { + /** + * Animation duration of this keyframe, in ms. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Animation duration of this keyframe, in ms. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + duration: number; - margin(value: Margin | Length | LocalizedMargin): T; + /** + * Animation curve of this keyframe. + * + * @type { ?(Curve | string | ICurve) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Animation curve of this keyframe. + * + * @type { ?(Curve | string | ICurve) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + curve?: Curve | string | ICurve; - clip(value: boolean): T; + /** + * The closure function to specify the terminating state of this keyframe. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The closure function to specify the terminating state of this keyframe. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + event: () => void; +} - zIndex(value: number): T; - aspectRatio(value: number): T; +/** + * Defines the basic callback. + * + * @typedef Callback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface Callback { + /** + * Defines the callback info. + * + * @param { T } data - the data will be used in the callback. + * @returns { V } - Returns result of the callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (data: T): V; +} - visibility(value: Visibility): T; +/** + * Defines the callback type used in hover events. + * The value of isHover indicates whether the mouse is hovering over the component. + * The value of event contains information about HoverEvent. + * + * @typedef HoverCallback + * @param { boolean } isHover + * @param { HoverEvent} event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type HoverCallback = (isHover: boolean, event: HoverEvent) => void - backgroundImage(src: ResourceStr | PixelMap, repeat?: ImageRepeat): T; - - backgroundImageSize(value: SizeOptions | ImageSize): T; +/** + * Defines the callback type used in accessibility hover events. + * The value of isHover indicates whether the touch is hovering over the component. + * The value of event contains information about AccessibilityHoverEvent. + * + * @typedef { function } + * @param { boolean } isHover + * @param { AccessibilityHoverEvent } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type AccessibilityCallback = (isHover: boolean, event: AccessibilityHoverEvent) => void - offset(value: Position | Edges | LocalizedEdges): T; +/** + * Defines the options about VisibleAreaEvent. + * + * @interface VisibleAreaEventOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface VisibleAreaEventOptions { + /** + * Each number in ratios indicates the value of visibility ratio. Each number in the Array value range in [0, 1]. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ratios: Array; - enabled(value: boolean): T; + /** + * The value of expectedUpdateInterval indicates desired update period(ms). + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + expectedUpdateInterval?: number; } -declare interface Rectangle { - - x?: Length; +/** + * Defines the callback type used in VisibleAreaChange events. + * + * @typedef { function } VisibleAreaChangeCallback + * @param { boolean } isVisible - Indicates the ratio of the visible area to its own area compared to the last change. + * It is true as the ratio increases and false as the ratio decreases. + * @param { number } currentRatio - The value of currentRatio indicates the visibility ratio of the current component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +/** + * Defines the callback type used in VisibleAreaChange events. + * + * @typedef { function } VisibleAreaChangeCallback + * @param { boolean } isExpanding - Indicates the ratio of the visible area to its own area compared to the last change. + * It is true as the ratio increases and false as the ratio decreases. + * @param { number } currentRatio - The value of currentRatio indicates the visibility ratio of the current component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type VisibleAreaChangeCallback = (isExpanding: boolean, currentRatio: number) => void; - y?: Length; +/** + * Defines a UICommonEvent which is used to set different common event to target component. + * + * @interface UICommonEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface UICommonEvent { + /** + * Set or reset the callback which will be triggered a click event when clicked. + * + * @param { Callback | undefined } callback - The callback about the click event. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnClick(callback: Callback | undefined): void; - width?: Length; + /** + * Set or reset the callback which will be triggered a touch event when touched. + * + * @param { Callback | undefined } callback - The callback about the touch event. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnTouch(callback: Callback | undefined): void; - height?: Length; -} + /** + * Set or reset the callback is triggered when a component mounts a display. + * + * @param { Callback | undefined } callback - The callback will be triggered when a component mounts a display. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnAppear(callback: Callback | undefined): void; -declare interface RectResult { - x: number; - y: number; - width: number; - height: number; -} + /** + * Set or reset the callback is triggered when component uninstallation disappears. + * + * @param { Callback | undefined } callback - The callback will be triggered when component uninstallation disappears. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnDisappear(callback: Callback | undefined): void; -declare class TouchTestInfo { - windowX: number; - windowY: number; - parentX: number; - parentY: number; - x: number; - y: number; - rect: RectResult; - id: string; -} -declare interface CommonInterface { - (): CommonAttribute -} -declare class CommonAttribute extends CommonMethod { -} + /** + * Set or reset the callback is triggered when component has keyboard input. + * + * @param { Callback | undefined } callback - The callback will be triggered when has keyboard input. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnKeyEvent(callback: Callback | undefined): void; -declare const Common: CommonInterface + /** + * Set or reset the callback which is triggered when component get focus. + * + * @param { Callback | undefined } callback - The callback will be triggered when a component get focus. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnFocus(callback: Callback | undefined): void; -declare class CustomComponent extends CommonAttribute { - build(): void; - aboutToAppear?(): void; - aboutToDisappear?(): void; - aboutToReuse?(params: { [key: string]: unknown }): void; - aboutToRecycle?(): void; -} + /** + * Set or reset the callback which is triggered when lose focus. + * + * @param { Callback | undefined } callback - The callback will be triggered when a component lose focus. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnBlur(callback: Callback | undefined): void; -declare class CommonShapeMethod extends CommonMethod { - constructor(); + /** + * Set or reset the callback which is triggered when has a hover event. + * + * @param { HoverCallback | undefined } callback - The callback will be triggered when has a hover event. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnHover(callback: HoverCallback | undefined): void; - stroke(value: ResourceColor): T; -} + /** + * Set or reset the callback which is triggered when has a mouse event. + * + * @param { Callback | undefined } callback - The callback will be triggered when has mouse input. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnMouse(callback: Callback | undefined): void; -declare class ScrollableCommonMethod extends CommonMethod { - scrollBarWidth(value: number | string): T; -} + /** + * Set or reset the callback which is triggered when the size of component changed. + * + * @param { SizeChangeCallback | undefined } callback - The callback will be triggered when the size of component changed. If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnSizeChange(callback: SizeChangeCallback | undefined): void; -declare enum SourceTool { - Unknown, - Finger, - Pen, - MOUSE, - TOUCHPAD, - JOYSTICK, + /** + * Set or reset the callback which is triggered when the visibleArea of component changed. + * + * @param { VisibleAreaEventOptions } options - The options for the visibility event. + * @param { VisibleAreaChangeCallback | undefined } event - The callback will be triggered when the visibleArea of component changed and get close to any number in ratios defined by options. + * If set undefined will reset the target callback. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setOnVisibleAreaApproximateChange(options: VisibleAreaEventOptions, event: VisibleAreaChangeCallback | undefined): void; } +/** + * Defines a UIGestureEvent which is used to set different gestures to target component. + * + * @interface UIGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ declare interface UIGestureEvent { - + /** + * Add a gesture bound to the component. + * + * @param { GestureHandler } gesture - gesture indicates the gesture bound to a component. + * @param { GesturePriority } priority - priority indicates the gesture's priority. + * @param { GestureMask } mask - mask indicates the gesture's GestureMask value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ addGesture(gesture: GestureHandler, priority?: GesturePriority, mask?: GestureMask): void; + + /** + * Add a parallel gesture bound to the component. + * + * @param { GestureHandler } gesture - gesture indicates the gesture bound to a component. + * @param { GestureMask } mask - mask indicates the gesture's GestureMask value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + addParallelGesture(gesture: GestureHandler, mask?: GestureMask): void; + + /** + * Remove the gesture that is bound to the component and marked as tag. + * + * @param { string } tag - tag indicates the gesture's tag. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeGestureByTag(tag: string): void; + + /** + * Clear gestures bound to the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + clearGestures(): void; } +/** + * Defines the gesture modifier. + * + * @interface GestureModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ declare interface GestureModifier { - applyGesture(): void; + /** + * Defines the gesture update function. + * + * @param { UIGestureEvent } event + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ applyGesture(event: UIGestureEvent): void; } -declare type GestureRecognizerJudgeBeginCallback = (event: BaseGestureEvent, current: GestureRecognizer, recognizers: Array) => GestureJudgeResult; - - -declare module 'commonEvent' { - module 'commonEvent' { - // @ts-ignore - export { UICommonEvent }; - } +/** + * Defines the selection options. + * + * @interface SelectionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SelectionOptions { + /** + * Menu pop-up policy. + * + * @type { ?MenuPolicy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + menuPolicy?: MenuPolicy; } -declare module 'commonAttribute'{ - module 'commonAttribute' { - // @ts-ignore - export { CommonAttribute }; - } +/** + * enum keyboard avoid mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum KeyboardAvoidMode { + /** + * Defines avoid keyboard when keyboard shows. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DEFAULT = 0, + + /** + * Defines not avoid keyboard when keyboard shows. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NONE = 1, } -/////////////// recently added /////////////// +/** + * Enumerates the type of area in hover mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare enum HoverModeAreaType { -declare interface LightSource { - positionX: Dimension; - positionY: Dimension; - positionZ: Dimension; - intensity: number; - color?: ResourceColor; - } + /** + * Layout top half screen when the phone in hover mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + TOP_SCREEN = 0, -declare interface PointLightStyle { - lightSource?: LightSource; - illuminated?: IlluminatedType; - bloom?: number; - } + /** + * Layout bottom half screen when the phone in hover mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + BOTTOM_SCREEN = 1, +} diff --git a/tests/arkts-subset/ets/counter.d.ts b/tests/arkts-subset/ets/counter.d.ts deleted file mode 100644 index 7577a72b..00000000 --- a/tests/arkts-subset/ets/counter.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2024 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. - */ - - -interface CounterInterface { - (): CounterAttribute; - } - - declare class CounterAttribute extends CommonMethod { - onInc(event: VoidCallback): CounterAttribute; - onDec(event: VoidCallback): CounterAttribute; - enableDec(value: boolean): CounterAttribute; - enableInc(value: boolean): CounterAttribute; - } - declare const CounterInstance: CounterAttribute; - declare const Counter: CounterInterface; - \ No newline at end of file diff --git a/tests/arkts-subset/ets/divider.d.ts b/tests/arkts-subset/ets/divider.d.ts deleted file mode 100644 index 1bbc5daf..00000000 --- a/tests/arkts-subset/ets/divider.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 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. - */ - -interface DividerInterface { - (): DividerAttribute; - } - - declare class DividerAttribute extends CommonMethod { - vertical(value: boolean): DividerAttribute; - color(value: ResourceColor): DividerAttribute; - strokeWidth(value: number | string): DividerAttribute; - lineCap(value: LineCapStyle): DividerAttribute; - } \ No newline at end of file diff --git a/tests/arkts-subset/ets/ellipse.d.ts b/tests/arkts-subset/ets/ellipse.d.ts new file mode 100644 index 00000000..e85a455c --- /dev/null +++ b/tests/arkts-subset/ets/ellipse.d.ts @@ -0,0 +1,333 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Ellipse constructor options. + * + * @interface EllipseOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +interface EllipseOptions { + /** + * Set width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set width. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: string | number; + + /** + * Set height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set height. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: string | number; +} + +/** + * Ellipse drawing. + * + * @interface EllipseInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Ellipse drawing. + * + * @interface EllipseInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Ellipse drawing. + * + * @interface EllipseInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Ellipse drawing. + * + * @interface EllipseInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface EllipseInterface { + /** + * use new function to set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * use new function to set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * use new function to set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * use new function to set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * use new function to set the value. + * + * @param { EllipseOptions } [options] - ellipse options + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + new (options?: EllipseOptions): EllipseAttribute; + + /** + * Set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Set the value. + * + * @param { EllipseOptions } [options] - ellipse options + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options?: EllipseOptions): EllipseAttribute; +} + +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class EllipseAttribute extends CommonShapeMethod {} + +/** + * Defines Ellipse Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Ellipse Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Ellipse Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Ellipse Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Ellipse: EllipseInterface; + +/** + * Defines Ellipse Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Ellipse Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Ellipse Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Ellipse Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const EllipseInstance: EllipseAttribute; diff --git a/tests/arkts-subset/ets/enums.d.ts b/tests/arkts-subset/ets/enums.d.ts index 91a96f01..db46717e 100644 --- a/tests/arkts-subset/ets/enums.d.ts +++ b/tests/arkts-subset/ets/enums.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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 @@ -13,171 +13,9810 @@ * limitations under the License. */ +/** + * @file + * @kit ArkUI + */ + +/** + * common enum of the checkbox shape + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * common enum of the checkbox shape + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum CheckBoxShape { + /** + * Circle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Circle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + CIRCLE = 0, + + /** + * Rounded Square. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Rounded Square. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + ROUNDED_SQUARE = 1, +} + +/** + * common enum of color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * common enum of color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * common enum of color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * common enum of color + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare enum Color { - White, - Black, + /** + * White. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * White. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * White. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * White. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + White, + + /** + * Black. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Black. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Black. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Black. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Black, + + /** + * Blue. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Blue. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Blue. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Blue. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Blue, + + /** + * Brown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Brown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Brown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Brown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Brown, + + /** + * Gray. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Gray. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Gray. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Gray. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Gray, + + /** + * Green. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Green. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Green. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Green. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Green, + + /** + * Grey. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Grey. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Grey. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Grey. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Grey, + + /** + * Orange. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Orange. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Orange. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Orange. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Orange, + + /** + * color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Pink, + + /** + * Red. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Red. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Red. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Red. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Red, + + /** + * Yellow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Yellow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Yellow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Yellow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Yellow, + + /** + * Transparent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Transparent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Transparent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Transparent, +} + +/** + * Common enum of color strategy + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Common enum of color strategy + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ColoringStrategy { + /** + * Use the inverse color strategy. Gets the inverse of the background color. Only applies to foregroundColor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Use the inverse color strategy. Gets the inverse of the background color. Only applies to foregroundColor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + INVERT = 'invert', + + /** + * Use the average color strategy. Get the average color of the background. Only applies to shadow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Use the average color strategy. Get the average color of the background. Only applies to shadow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + AVERAGE = 'average', + + /** + * Use the primary color strategy. Get the color that dominate the background color. Only applies to shadow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Use the primary color strategy. Get the color that dominate the background color. Only applies to shadow. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PRIMARY = 'primary', +} + +/** + * Image display mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Image display mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Image display mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Image display mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ImageFit { + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Contain, + + /** + * Keep the aspect ratio to zoom out or zoom in so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Cover, + + /** + * Adaptive display + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Adaptive display + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Adaptive display + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Adaptive display + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Auto, + + /** + * Zoom in or out without maintaining the aspect ratio so that the image fills the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Zoom in or out without maintaining the aspect ratio so that the image fills the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Zoom in or out without maintaining the aspect ratio so that the image fills the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Zoom in or out without maintaining the aspect ratio so that the image fills the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Fill, + + /** + * Keep the aspect ratio displayed, and the image zooms out or remains unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the aspect ratio displayed, and the image zooms out or remains unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the aspect ratio displayed, and the image zooms out or remains unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the aspect ratio displayed, and the image zooms out or remains unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + ScaleDown, + + /** + * Keep the original size and display it in the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the original size and display it in the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the original size and display it in the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the original size and display it in the center. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * Top Start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + TOP_START = 7, + + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + TOP = 8, + + /** + * Top tail end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + TOP_END = 9, + + /** + * The starting end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + START = 10, + + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + CENTER = 11, + + /** + * The tail end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + END = 12, + + /** + * Bottom starting end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + BOTTOM_START = 13, + + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + BOTTOM = 14, + + /** + * Bottom end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + BOTTOM_END = 15, +} + +/** + * Border Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Border Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Border Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Border Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum BorderStyle { + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Displays as a series of dots with a radius of half the borderWidth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Dotted, + + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Shows as a series of short square dashed lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Dashed, + + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Shows as a solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Solid, +} + +/** + * Line Join Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Line Join Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Line Join Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Line Join Style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum LineJoinStyle { + /** + * Connect path segments using bevels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Connect path segments using bevels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Connect path segments using bevels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Connect path segments using bevels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Miter, + + /** + * Connect path segments using sharp corners. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Connect path segments using sharp corners. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Connect path segments using sharp corners. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Connect path segments using sharp corners. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Round, + + /** + * Connect path segments using fillets. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Connect path segments using fillets. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Connect path segments using fillets. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Connect path segments using fillets. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bevel, +} + +/** + * Function Called by Touch + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Function Called by Touch + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Function Called by Touch + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum TouchType { + /** + * Triggered when the finger is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Triggered when the finger is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the finger is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Down, + + /** + * Triggered when the finger is raised. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Triggered when the finger is raised. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the finger is raised. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Up, + + /** + * Triggered when the finger presses on the screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Triggered when the finger presses on the screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the finger presses on the screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Move, + + /** + * Triggers when the touch event cancels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Triggers when the touch event cancels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggers when the touch event cancels. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Cancel, +} + +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum MouseButton { + /** + * Mouse Left Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse Left Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse Left Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Left, + + /** + * Mouse Right Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse Right Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse Right Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Right, + + /** + * Mouse Middle Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse Middle Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse Middle Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Middle, + + /** + * Mouse Back Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse Back Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse Back Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Back, + + /** + * Mouse Forward Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse Forward Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse Forward Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Forward, + + /** + * Mouse None Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Mouse None Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mouse None Button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, +} + +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Function Called by Mouse + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum MouseAction { + /** + * Triggered when the mouse is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Triggered when the mouse is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the mouse is pressed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Press, + + /** + * Triggered when the mouse is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Triggered when the mouse is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the mouse is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Release, + + /** + * Triggered when the mouse is Moved. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Triggered when the mouse is Moved. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the mouse is Moved. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Move, + + /** + * Triggered when the mouse is Hovered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Triggered when the mouse is Hovered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Triggered when the mouse is Hovered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Hover +} + +/** + * Animation status. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Animation status. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Animation status. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum AnimationStatus { + /** + * Initial state of the animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Initial state of the animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Initial state of the animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Initial, + + /** + * The animation is playing. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation is playing. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation is playing. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Running, + + /** + * The animation is paused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation is paused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation is paused. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Paused, + + /** + * The animation is stopped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation is stopped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation is stopped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Stopped, +} + +/** + * Sets the animation playback mode. By default, the animation starts to play again after the playback is complete. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Sets the animation playback mode. By default, the animation starts to play again after the playback is complete. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Sets the animation playback mode. By default, the animation starts to play again after the playback is complete. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Sets the animation playback mode. By default, the animation starts to play again after the playback is complete. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Curve { + /** + * Indicates that the speed of the animation is the same from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates that the speed of the animation is the same from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates that the speed of the animation is the same from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates that the speed of the animation is the same from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Linear, + + /** + * Indicates that the animation starts at a low speed, then accelerates, and then slows down before it ends, CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates that the animation starts at a low speed, then accelerates, and then slows down before it ends, CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates that the animation starts at a low speed, then accelerates, and then slows down before it ends, CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates that the animation starts at a low speed, then accelerates, and then slows down before it ends, CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Ease, + + /** + * Indicates that the animation starts at a low speed, CubicBezier(0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates that the animation starts at a low speed, CubicBezier(0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates that the animation starts at a low speed, CubicBezier(0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates that the animation starts at a low speed, CubicBezier(0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + EaseIn, + + /** + * Indicates that the animation ends at a low speed, CubicBezier(0.0, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates that the animation ends at a low speed, CubicBezier(0.0, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates that the animation ends at a low speed, CubicBezier(0.0, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates that the animation ends at a low speed, CubicBezier(0.0, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + EaseOut, + + /** + * Indicates that the animation starts and ends at a slow speed, CubicBezier(0.42, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates that the animation starts and ends at a slow speed, CubicBezier(0.42, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates that the animation starts and ends at a slow speed, CubicBezier(0.42, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates that the animation starts and ends at a slow speed, CubicBezier(0.42, 0.0, 0.78, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + EaseInOut, + + /** + * Slow-in, fast-out + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Slow-in, fast-out + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Slow-in, fast-out + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Slow-in, fast-out + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + FastOutSlowIn, + + /** + * Linear Out Slow In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Linear Out Slow In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Linear Out Slow In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Linear Out Slow In + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LinearOutSlowIn, + + /** + * Fast Out Linear In. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Fast Out Linear In. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Fast Out Linear In. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Fast Out Linear In. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + FastOutLinearIn, + + /** + * Extreme Deceleration. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Extreme Deceleration. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Extreme Deceleration. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Extreme Deceleration. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + ExtremeDeceleration, + + /** + * Sharp. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sharp. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sharp. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sharp. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Sharp, + + /** + * Rhythm. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rhythm. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rhythm. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rhythm. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Rhythm, + + /** + * Smooth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Smooth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Smooth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Smooth. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Smooth, + + /** + * Damping curve, CubicBezier(0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Damping curve, CubicBezier(0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Damping curve, CubicBezier(0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Damping curve, CubicBezier(0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Friction, +} + +/** + * Sets the state before and after the animation starts. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Sets the state before and after the animation starts. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Sets the state before and after the animation starts. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FillMode { + /** + * Restores to the initial state after the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Restores to the initial state after the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Restores to the initial state after the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * Retains the state at the end of the animation when the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Retains the state at the end of the animation when the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Retains the state at the end of the animation when the playback is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Forwards, + + /** + * Applies the start attribute value for the period specified by animation-delay before the animation is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Applies the start attribute value for the period specified by animation-delay before the animation is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Applies the start attribute value for the period specified by animation-delay before the animation is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Backwards, + + /** + * Both forward and backward fill modes are applied. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Both forward and backward fill modes are applied. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Both forward and backward fill modes are applied. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Both, +} + +/** + * Play Mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Play Mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Play Mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Play Mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum PlayMode { + /** + * The animation plays normally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation plays normally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The animation plays normally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation plays normally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Normal, + + /** + * The animation plays backwards. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation plays backwards. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The animation plays backwards. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation plays backwards. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Reverse, + + /** + * The animation plays forward on odd numbers (1, 3, 7...) and backward on even numbers (2, 4, 6...). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation plays forward on odd numbers (1, 3, 7...) and backward on even numbers (2, 4, 6...). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The animation plays forward on odd numbers (1, 3, 7...) and backward on even numbers (2, 4, 6...). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation plays forward on odd numbers (1, 3, 7...) and backward on even numbers (2, 4, 6...). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Alternate, + + /** + * The animation plays backwards on odd numbers (1, 3, 7...) and forwards on even numbers (2, 4, 6...).. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The animation plays backwards on odd numbers (1, 3, 7...) and forwards on even numbers (2, 4, 6...).. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The animation plays backwards on odd numbers (1, 3, 7...) and forwards on even numbers (2, 4, 6...).. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The animation plays backwards on odd numbers (1, 3, 7...) and forwards on even numbers (2, 4, 6...).. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + AlternateReverse, +} + +/** + * Type of a key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Type of a key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Type of a key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum KeyType { + /** + * Press the key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Press the key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Press the key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Down, + + /** + * The key is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The key is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The key is released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Up, +} + +/** + * Type of the input device that triggers the current key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Type of the input device that triggers the current key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Type of the input device that triggers the current key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum KeySource { + /** + * The input device type is unknown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The input device type is unknown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The input device type is unknown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Unknown, + + /** + * Set Device Type to Keyboard. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set Device Type to Keyboard. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set Device Type to Keyboard. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Keyboard, +} + +/** + * Edge. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Edge. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Edge. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum Edge { + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Top, + + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Center, + + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * Cross axis direction text baseline alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Baseline, + + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Start, + + /** + * Middle + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Middle, + + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Align the head of the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + End, +} + +/** + * Set Weekend + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Set Weekend + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Set Weekend + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum Week { + /** + * Monday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Monday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Monday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Mon, + + /** + * Tuesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Tuesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Tuesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Tue, + + /** + * Wednesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Wednesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Wednesday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Wed, + + /** + * Thursday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Thursday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Thursday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Thur, + + /** + * Friday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Friday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Friday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Fri, + + /** + * Saturday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Saturday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Saturday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Sat, + + /** + * Sunday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sunday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sunday. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Sun, +} + +/** + * Sets the horizontal layout of elements. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Sets the horizontal layout of elements. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Sets the horizontal layout of elements. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Sets the horizontal layout of elements. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Direction { + /** + * Elements are laid out from left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elements are laid out from left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elements are laid out from left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elements are laid out from left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Ltr, + + /** + * Elements are laid out from right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elements are laid out from right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elements are laid out from right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elements are laid out from right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Rtl, + + /** + * Use the default layout direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Use the default layout direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Use the default layout direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Use the default layout direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Auto, +} + +/** + * Used to set the status of the scroll bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Used to set the status of the scroll bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Used to set the status of the scroll bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Used to set the status of the scroll bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum BarState { + /** + * Not displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Not displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Not displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Not displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Off, + + /** + * On-demand display (displayed when you touch it and disappears after 2 seconds). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * On-demand display (displayed when you touch it and disappears after 2 seconds). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * On-demand display (displayed when you touch it and disappears after 2 seconds). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * On-demand display (displayed when you touch it and disappears after 2 seconds). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Auto, + + /** + * Resident display. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Resident display. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Resident display. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Resident display. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + On, +} + +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum EdgeEffect { + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Spring, + + /** + * Fade. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Fade. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Fade. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Fade. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Fade, + + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, +} + +/** + * Alignment enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Alignment enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Alignment enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Alignment enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Alignment { + /** + * Top Start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Top Start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Top Start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top Start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + TopStart, + + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The top is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Top, + + /** + * Top tail end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Top tail end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Top tail end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top tail end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + TopEnd, + + /** + * The starting end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The starting end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The starting end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The starting end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Center horizontal and vertical. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * The tail end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The tail end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The tail end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The tail end is centered longitudinally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, + + /** + * Bottom starting end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Bottom starting end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Bottom starting end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Bottom starting end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BottomStart, + + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The bottom is centered horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * Bottom end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Bottom end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Bottom end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Bottom end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + BottomEnd, +} + +/** + * TransitionType enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * TransitionType enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * TransitionType enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * TransitionType enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TransitionType { + /** + * Specifies that the current transition action takes effect in all change scenarios of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Specifies that the current transition action takes effect in all change scenarios of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies that the current transition action takes effect in all change scenarios of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies that the current transition action takes effect in all change scenarios of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + All, + + /** + * Specifies the insertion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Specifies the insertion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies the insertion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies the insertion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Insert, + + /** + * Specifies the deletion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Specifies the deletion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies the deletion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies the deletion scenario in which the current transition action takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Delete, +} + +/** + * RelateType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * RelateType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * RelateType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum RelateType { + /** + * Scales the current component to fill the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Scales the current component to fill the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scales the current component to fill the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + FILL, + + /** + * Scales the current component to fit the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Scales the current component to fit the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scales the current component to fit the parent component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + FIT, +} + +/** + * Controls the display or hide of the current component + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Controls the display or hide of the current component + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Controls the display or hide of the current component + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Controls the display or hide of the current component + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Visibility { + /** + * Show + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Show + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Show + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Show + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Visible, + + /** + * Hide, but participate in layout for placeholder. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Hide, but participate in layout for placeholder. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Hide, but participate in layout for placeholder. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Hide, but participate in layout for placeholder. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Hidden, + + /** + * Hides but does not participate in layout and does not take place. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Hides but does not participate in layout and does not take place. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Hides but does not participate in layout and does not take place. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Hides but does not participate in layout and does not take place. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, +} + +/** + * LineCapStyle enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * LineCapStyle enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * LineCapStyle enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * LineCapStyle enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum LineCapStyle { + /** + * The two ends of the dividing line are parallel lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The two ends of the dividing line are parallel lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The two ends of the dividing line are parallel lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The two ends of the dividing line are parallel lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Butt, + + /** + * The two ends of the dividing line are semicircles. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The two ends of the dividing line are semicircles. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The two ends of the dividing line are semicircles. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The two ends of the dividing line are semicircles. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Round, + + /** + * Extends half a circle at the end of the path with a width equal to half the line width and a height equal to the line width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Extends half a circle at the end of the path with a width equal to half the line width and a height equal to the line width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Extends half a circle at the end of the path with a width equal to half the line width and a height equal to the line width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Extends half a circle at the end of the path with a width equal to half the line width and a height equal to the line width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Square, +} + +/** + * Axis enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Axis enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Axis enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Axis enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum Axis { + /** + * Longitudinal arrangement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Longitudinal arrangement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Longitudinal arrangement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Longitudinal arrangement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Vertical, + + /** + * Horizontal arrangement. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Horizontal arrangement. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Horizontal arrangement. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Horizontal arrangement. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Horizontal, +} + +/** + * HorizontalAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * HorizontalAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * HorizontalAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * HorizontalAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum HorizontalAlign { + /** + * Aligns the start end in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Aligns the start end in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Aligns the start end in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Aligns the start end in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * Aligns the ends in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Aligns the ends in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Aligns the ends in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Aligns the ends in the language direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, +} + +/** + * FlexAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * FlexAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * FlexAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * FlexAlign enumeration description. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FlexAlign { + /** + * The element is aligned at the head of the principal axis, + * the first element is aligned with the head of the row, and subsequent elements are aligned with the previous one. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The element is aligned at the head of the principal axis, + * the first element is aligned with the head of the row, and subsequent elements are aligned with the previous one. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The element is aligned at the head of the principal axis, + * the first element is aligned with the head of the row, and subsequent elements are aligned with the previous one. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The element is aligned at the head of the principal axis, + * the first element is aligned with the head of the row, and subsequent elements are aligned with the previous one. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * The elements are centered in the direction of the principal axis, + * and the first element is the same distance from the beginning of the row as the last element is from the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The elements are centered in the direction of the principal axis, + * and the first element is the same distance from the beginning of the row as the last element is from the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The elements are centered in the direction of the principal axis, + * and the first element is the same distance from the beginning of the row as the last element is from the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The elements are centered in the direction of the principal axis, + * and the first element is the same distance from the beginning of the row as the last element is from the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * The element is aligned at the tail of the principal axis, + * the last element is aligned at the end of the row, and the other elements are aligned with the next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The element is aligned at the tail of the principal axis, + * the last element is aligned at the end of the row, and the other elements are aligned with the next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The element is aligned at the tail of the principal axis, + * the last element is aligned at the end of the row, and the other elements are aligned with the next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The element is aligned at the tail of the principal axis, + * the last element is aligned at the end of the row, and the other elements are aligned with the next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, + + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. + * The first element aligns with the beginning of the line, and the last element aligns with the end of the line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. + * The first element aligns with the beginning of the line, and the last element aligns with the end of the line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. + * The first element aligns with the beginning of the line, and the last element aligns with the end of the line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. + * The first element aligns with the beginning of the line, and the last element aligns with the end of the line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + SpaceBetween, + + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. Half the distance between adjacent elements as the distance between + * the first element and the distance between the last element and the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. Half the distance between adjacent elements as the distance between + * the first element and the distance between the last element and the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. Half the distance between adjacent elements as the distance between + * the first element and the distance between the last element and the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elastic elements are evenly distributed in the direction of the Flex principal axis, + * with the same distance between adjacent elements. Half the distance between adjacent elements as the distance between + * the first element and the distance between the last element and the end of the row. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + SpaceAround, + + /** + * Elements in the Flex axis direction are evenly spaced. + * The spacing between adjacent elements, the spacing between the first element and the beginning of the row, + * and the spacing between the last element and the end of the row are the same. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Elements in the Flex axis direction are evenly spaced. + * The spacing between adjacent elements, the spacing between the first element and the beginning of the row, + * and the spacing between the last element and the end of the row are the same. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Elements in the Flex axis direction are evenly spaced. + * The spacing between adjacent elements, the spacing between the first element and the beginning of the row, + * and the spacing between the last element and the end of the row are the same. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Elements in the Flex axis direction are evenly spaced. + * The spacing between adjacent elements, the spacing between the first element and the beginning of the row, + * and the spacing between the last element and the end of the row are the same. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + SpaceEvenly, +} + +/** + * ItemAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * ItemAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * ItemAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * ItemAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ItemAlign { + /** + * Use the default configuration in the Flex container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Use the default configuration in the Flex container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Use the default configuration in the Flex container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Use the default configuration in the Flex container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Auto, + + /** + * The element is in the Flex container with the cross-axis direction head aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The element is in the Flex container with the cross-axis direction head aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The element is in the Flex container with the cross-axis direction head aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The element is in the Flex container with the cross-axis direction head aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * The element is centered in the Flex container with the cross axis direction aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The element is centered in the Flex container with the cross axis direction aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The element is centered in the Flex container with the cross axis direction aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The element is centered in the Flex container with the cross axis direction aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * The element is bottom aligned in the Flex container with the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The element is bottom aligned in the Flex container with the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The element is bottom aligned in the Flex container with the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The element is bottom aligned in the Flex container with the cross axis direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, + + /** + * Element In the Flex container, the cross-axis direction text baseline is aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Element In the Flex container, the cross-axis direction text baseline is aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Element In the Flex container, the cross-axis direction text baseline is aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Element In the Flex container, the cross-axis direction text baseline is aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Baseline, + + /** + * Element In a Flex container, the fill is stretched across the axis and, when no dimension is set, to the container size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Element In a Flex container, the fill is stretched across the axis and, when no dimension is set, to the container size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Element In a Flex container, the fill is stretched across the axis and, when no dimension is set, to the container size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Element In a Flex container, the fill is stretched across the axis and, when no dimension is set, to the container size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Stretch, +} + +/** + * FlexDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * FlexDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * FlexDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * FlexDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FlexDirection { + /** + * The main axis is consistent with the row direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The main axis is consistent with the row direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The main axis is consistent with the row direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The main axis is consistent with the row direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Row, + + /** + * The main axis is consistent with the column direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The main axis is consistent with the column direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The main axis is consistent with the column direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The main axis is consistent with the column direction as the layout mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Column, + + /** + * The layout is in the opposite direction to the Row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The layout is in the opposite direction to the Row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The layout is in the opposite direction to the Row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The layout is in the opposite direction to the Row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + RowReverse, + + /** + * Layout in the opposite direction to the column. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Layout in the opposite direction to the column. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Layout in the opposite direction to the column. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Layout in the opposite direction to the column. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + ColumnReverse, +} + +/** + * Pixel Round Direction + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum PixelRoundCalcPolicy { + /** + * No Force round the component boundary coordinates to integer pixel. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + NO_FORCE_ROUND = 0, + /** + * Force ceil the component boundary coordinates to integer pixel. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + FORCE_CEIL = 1, + /** + * Force floor the component boundary coordinates to integer pixel. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + FORCE_FLOOR = 2, +} + +/** + * FlexWrap enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * FlexWrap enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * FlexWrap enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * FlexWrap enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FlexWrap { + /** + * The Flex container has a single row/column layout of elements, and children are allowed to go beyond the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Flex container has a single row/column layout of elements, and children are allowed to go beyond the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The Flex container has a single row/column layout of elements, and children are allowed to go beyond the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The Flex container has a single row/column layout of elements, and children are allowed to go beyond the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + NoWrap, + + /** + * The elements of the Flex container are arranged in multiple rows or columns, and the sub-items are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The elements of the Flex container are arranged in multiple rows or columns, and the sub-items are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The elements of the Flex container are arranged in multiple rows or columns, and the sub-items are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The elements of the Flex container are arranged in multiple rows or columns, and the sub-items are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Wrap, + + /** + * The elements of the Flex container are arranged in reverse multiple rows/columns, and children are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The elements of the Flex container are arranged in reverse multiple rows/columns, and children are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The elements of the Flex container are arranged in reverse multiple rows/columns, and children are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The elements of the Flex container are arranged in reverse multiple rows/columns, and children are allowed to exceed the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + WrapReverse, +} + +/** + * VerticalAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * VerticalAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * VerticalAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * VerticalAlign enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum VerticalAlign { + /** + * Top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Top, + + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Center alignment. The default alignment mode is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * Bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bottom, +} + +/** + * ImageRepeat enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * ImageRepeat enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * ImageRepeat enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * ImageRepeat enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ImageRepeat { + /** + * Do not draw the picture again. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Do not draw the picture again. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Do not draw the picture again. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Do not draw the picture again. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + NoRepeat, + + /** + * Repeat the drawing only on the horizontal axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Repeat the drawing only on the horizontal axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Repeat the drawing only on the horizontal axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Repeat the drawing only on the horizontal axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + X, + + /** + * Repeat the drawing only on the vertical axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Repeat the drawing only on the vertical axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Repeat the drawing only on the vertical axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Repeat the drawing only on the vertical axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Y, + + /** + * Draw the picture repeatedly on both axes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Draw the picture repeatedly on both axes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Draw the picture repeatedly on both axes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Draw the picture repeatedly on both axes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + XY, +} + +/** + * ImageSize enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * ImageSize enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * ImageSize enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * ImageSize enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ImageSize { + /** + * Keep the scale of the original image unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the scale of the original image unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the scale of the original image unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the scale of the original image unchanged. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Auto, + + /** + * Default value. Keep the aspect ratio to zoom in or out the image so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Default value. Keep the aspect ratio to zoom in or out the image so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Default value. Keep the aspect ratio to zoom in or out the image so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Default value. Keep the aspect ratio to zoom in or out the image so that both sides of the image are greater than or equal to the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Cover, + + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Keep the aspect ratio to zoom out or zoom in so that the image is completely displayed within the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Contain, + + /** + * Zoom in or out without maintaining the aspect ratio so that the image fills the display boundary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FILL = 3, +} + +/** + * GradientDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * GradientDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * GradientDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * GradientDirection enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum GradientDirection { + /** + * Right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Left, + + /** + * From the bottom up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * From the bottom up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * From the bottom up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * From the bottom up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Top, + + /** + * From left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * From left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * From left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * From left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Right, + + /** + * From the top down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * From the top down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * From the top down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * From the top down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * Top Left + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Top Left + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Top Left + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Top Left + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LeftTop, + + /** + * Left Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Left Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Left Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Left Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LeftBottom, + + /** + * Right Top + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Right Top + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Right Top + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Right Top + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + RightTop, + + /** + * Right Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Right Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Right Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Right Bottom + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + RightBottom, + + /** + * None + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * None + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * None + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * None + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, +} + +/** + * SharedTransitionEffectType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * SharedTransitionEffectType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * SharedTransitionEffectType enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SharedTransitionEffectType { + /** + * The location of the destination page element remains unchanged, and you can configure the transparency animation. Currently, + * only the static effect configured for redirecting to the target page takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The location of the destination page element remains unchanged, and you can configure the transparency animation. Currently, + * only the static effect configured for redirecting to the target page takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The location of the destination page element remains unchanged, and you can configure the transparency animation. Currently, + * only the static effect configured for redirecting to the target page takes effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Static, + + /** + * Move the source page element to the destination page element location and scale it appropriately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Move the source page element to the destination page element location and scale it appropriately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Move the source page element to the destination page element location and scale it appropriately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Exchange, +} + +/** + * Text style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Text style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Text style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Text style + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FontStyle { + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Normal, + + /** + * Italic style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Italic style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Italic style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Italic style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Italic, +} + +/** + * The font weight of the text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The font weight of the text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * The font weight of the text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * The font weight of the text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum FontWeight { + /** + * Defines a lighter value than [Inherited Value].. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines a lighter value than [Inherited Value].. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines a lighter value than [Inherited Value].. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines a lighter value than [Inherited Value].. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Lighter, + + /** + * Normal font. Equivalent to a digital value of 400. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Normal font. Equivalent to a digital value of 400. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Normal font. Equivalent to a digital value of 400. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Normal font. Equivalent to a digital value of 400. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Normal, + + /** + * Defines a more general value than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines a more general value than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines a more general value than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines a more general value than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Regular, + + /** + * Defines a value that is more centered than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines a value that is more centered than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines a value that is more centered than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines a value that is more centered than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Medium, + + /** + * Bold. Equivalent to a numeric value of 700. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Bold. Equivalent to a numeric value of 700. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Bold. Equivalent to a numeric value of 700. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Bold. Equivalent to a numeric value of 700. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bold, + + /** + * Defines a value that is heavier than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines a value that is heavier than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines a value that is heavier than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines a value that is heavier than [Inherited Value]. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Bolder, +} + +/** + * Alignment of text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Alignment of text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Alignment of text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Alignment of text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TextAlign { + /** + * Center the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Center the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Center the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Center the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * The text is aligned in the same direction as the writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The text is aligned in the same direction as the writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The text is aligned in the same direction as the writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The text is aligned in the same direction as the writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * The text is aligned in the opposite direction of writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The text is aligned in the opposite direction of writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The text is aligned in the opposite direction of writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The text is aligned in the opposite direction of writing + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, + + /** + * Justify the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Justify the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + JUSTIFY, +} + +/** + * Declare how text overflows. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare how text overflows. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare how text overflows. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare how text overflows. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TextOverflow { + /** + * When the text overflows its dimensions, the text will not be cropped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * When the text overflows its dimensions, the text will not be cropped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * When the text overflows its dimensions, the text will not be cropped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * When the text overflows its dimensions, the text will not be cropped. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * When the text overflows its dimensions, the text will be cropped and displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * When the text overflows its dimensions, the text will be cropped and displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * When the text overflows its dimensions, the text will be cropped and displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * When the text overflows its dimensions, the text will be cropped and displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Clip, + + /** + * If the text overflows its dimensions, the text that cannot be displayed shall be replaced by ellipsis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * If the text overflows its dimensions, the text that cannot be displayed shall be replaced by ellipsis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * If the text overflows its dimensions, the text that cannot be displayed shall be replaced by ellipsis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * If the text overflows its dimensions, the text that cannot be displayed shall be replaced by ellipsis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Ellipsis, + + /** + * When the text overflows its dimensions, the text will scroll for displaying. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * When the text overflows its dimensions, the text will scroll for displaying. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MARQUEE, +} + +/** + * Type of text modifier. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Type of text modifier. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Type of text modifier. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Type of text modifier. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TextDecorationType { + /** + * Do not use text decorative lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Do not use text decorative lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Do not use text decorative lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Do not use text decorative lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * Underline the words. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Underline the words. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Underline the words. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Underline the words. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Underline, + + /** + * Text is in all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text is in all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text is in all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text is in all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Overline, + + /** + * A modifier line that passes through the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * A modifier line that passes through the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * A modifier line that passes through the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * A modifier line that passes through the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LineThrough, +} + +/** + * Letter type in text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Letter type in text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Letter type in text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Letter type in text + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum TextCase { + /** + * The default is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The default is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The default is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The default is normal. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Normal, + + /** + * The text is all lowercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The text is all lowercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The text is all lowercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The text is all lowercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LowerCase, + + /** + * The text is all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The text is all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The text is all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The text is all uppercase. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + UpperCase, +} + +/** + * Enum of text height adaptation + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum of text height adaptation + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum TextHeightAdaptivePolicy { + /** + * Priority is given to using the maxLines attribute to adapt the text height. + * If the layout size using the maxLines attribute exceeds the layout constraint, try reducing the font size to + * display more text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Priority is given to using the maxLines attribute to adapt the text height. + * If the layout size using the maxLines attribute exceeds the layout constraint, try reducing the font size to + * display more text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MAX_LINES_FIRST, + + /** + * Priority is given to using the minFontSize attribute to adapt the text height. + * If the text can be layout in a single line using the minFontSize property, try increasing the font size and using + * the maximum possible font size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Priority is given to using the minFontSize attribute to adapt the text height. + * If the text can be layout in a single line using the minFontSize property, try increasing the font size and using + * the maximum possible font size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MIN_FONT_SIZE_FIRST, + + /** + * Priority is given to using the layout constraint to adapt the text height. + * If the layout size exceeds the layout constraint, try reducing the font size. If the layout size still exceeds + * the layout constraint after reducing the font size to minFontSize, remove the lines that exceed the layout + * constraint. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Priority is given to using the layout constraint to adapt the text height. + * If the layout size exceeds the layout constraint, try reducing the font size. If the layout size still exceeds + * the layout constraint after reducing the font size to minFontSize, remove the lines that exceed the layout + * constraint. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LAYOUT_CONSTRAINT_FIRST, +} + +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ResponseType { + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RightClick, + + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LongPress, +} + +/** + * HoverEffect enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * HoverEffect enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * HoverEffect enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum HoverEffect { + /** + * Default effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Default effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Auto, + + /** + * Zoom in and out effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Zoom in and out effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Zoom in and out effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Scale, + + /** + * Highlight effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Highlight effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Highlight effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Highlight, + + /** + * None effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * None effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * None effect + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, +} + +/** + * Placement enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Placement enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Placement enumeration description + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum Placement { + /** + * Left placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Left placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Left placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Left, + + /** + * Right placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Right placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Right placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Right, + + /** + * Top placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Top placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Top placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Top, + + /** + * Bottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Bottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Bottom, + + /** + * TopLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * TopLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * TopLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TopLeft, + + /** + * TopRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * TopRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * TopRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TopRight, + + /** + * BottomLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * BottomLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * BottomLeft placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BottomLeft, + + /** + * BottomRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * BottomRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * BottomRight placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BottomRight, + + /** + * LeftTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * LeftTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * LeftTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LeftTop, + + /** + * LeftBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * LeftBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * LeftBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LeftBottom, + + /** + * RightTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * RightTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * RightTop placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RightTop, + + /** + * RightBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * RightBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * RightBottom placement + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RightBottom, +} + +/** + * ArrowPointPosition enumeration description + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * ArrowPointPosition enumeration description + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum ArrowPointPosition { + /** + * Target start position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Target start position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + START = 'Start', + + /** + * Target center position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Target center position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CENTER = 'Center', + + /** + * Target end position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Target end position + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + END = 'End', +} + +/** + * Indicates the share option. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Indicates the share option. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Indicates the share option. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum CopyOptions { + /** + * Not allow share. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Not allow share. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Not allow share. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None = 0, + + /** + * Share in app. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Share in app. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Share in app. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + InApp = 1, + + /** + * Share in local device. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Share in local device. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Share in local device. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + LocalDevice = 2, + + /** + * Share in cross Device + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + * @deprecated since 12 + */ + CROSS_DEVICE = 3, +} + +/** + * Defines the hit test mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the hit test mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the hit test mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum HitTestMode { + /** + * Both self and children nodes respond to the hit test for touch events, + * but block hit test of the other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Both self and children nodes respond to the hit test for touch events, + * but block hit test of the other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Both self and children nodes respond to the hit test for touch events, + * but block hit test of the other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Default, + + /** + * Self respond to the hit test for touch events, + * but block hit test of children and other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Self respond to the hit test for touch events, + * but block hit test of children and other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Self respond to the hit test for touch events, + * but block hit test of children and other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Block, + + /** + * Self and children respond to the hit test for touch events, + * and allow hit test of other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Self and children respond to the hit test for touch events, + * and allow hit test of other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Self and children respond to the hit test for touch events, + * and allow hit test of other nodes which is masked by this node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Transparent, + + /** + * Self not respond to the hit test for touch events, + * but children respond to the hit test for touch events. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Self not respond to the hit test for touch events, + * but children respond to the hit test for touch events. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Self not respond to the hit test for touch events, + * but children respond to the hit test for touch events. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, +} + +/** + * Title height. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Title height. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Title height. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum TitleHeight { + /** + * Title height when only main title is available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Title height when only main title is available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Title height when only main title is available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MainOnly, + + /** + * Title height when main title and subtitle are both available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Title height when main title and subtitle are both available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Title height when main title and subtitle are both available. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MainWithSub, +} + +/** + * Modifier key for hot key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Modifier key for hot key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ModifierKey { + /** + * ctrl. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * ctrl. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CTRL, + + /** + * shift. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * shift. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SHIFT, + + /** + * alt. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * alt. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ALT, } -declare enum Curve { - Linear, - Ease, +/** + * Function key for hot key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Function key for hot key. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum FunctionKey { + /** + * Escape key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Escape key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ESC, + + /** + * F1 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F1 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F1, + + /** + * F2 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F2 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F2, + + /** + * F3 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F3 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F3, + + /** + * F4 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F4 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F4, + + /** + * F5 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F5 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F5, + + /** + * F6 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F6 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F6, + + /** + * F7 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F7 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F7, + + /** + * F8 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F8 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F8, + + /** + * F9 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F9 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F9, + + /** + * F10 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F10 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F10, + + /** + * F11 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F11 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F11, + + /** + * F12 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * F12 key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + F12, + + /** + * Tab key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TAB, + + /** + * Up arrow key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DPAD_UP, + + /** + * Down arrow key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DPAD_DOWN, + + /** + * Left arrow key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DPAD_LEFT, + + /** + * Right arrow key. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DPAD_RIGHT, } -declare enum TextHeightAdaptivePolicy { - MAX_LINES_FIRST, - MIN_FONT_SIZE_FIRST, - LAYOUT_CONSTRAINT_FIRST, +/** + * The alignment of ImageSpan + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The alignment of ImageSpan + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ImageSpanAlignment { + /** + * Indicating that the bottom of the ImageSpan should be aligned with the baseline of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicating that the bottom of the ImageSpan should be aligned with the baseline of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BASELINE, + + /** + * Indicating that the bottom of the ImageSpan should be aligned with the bottom of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicating that the bottom of the ImageSpan should be aligned with the bottom of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOTTOM, + + /** + * Indicating that the center of the ImageSpan should be aligned with the center of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicating that the center of the ImageSpan should be aligned with the center of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CENTER, + + /** + * Indicating that the top of the ImageSpan should be aligned with the top of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicating that the top of the ImageSpan should be aligned with the top of the surrounding text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TOP, } -declare enum TextOverflow { - None, - Clip, - Ellipsis, - MARQUEE, +/** + * ObscuredReasons. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * ObscuredReasons. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ObscuredReasons { + /** + * Displayed data should appear as generic placeholders. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Displayed data should appear as generic placeholders. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + PLACEHOLDER = 0, } -declare enum FontWeight { - Lighter, - Normal, - Regular, - Medium, - Bold, - Bolder, +/** + * Text content style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Text content style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum TextContentStyle { + /** + * Text content default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text content default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DEFAULT, + + /** + * Text content inline style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text content inline style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + INLINE } -declare enum FontStyle { - Normal, - Italic, +/** + * Enum of click effect level. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum of click effect level. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ClickEffectLevel { + /** + * Click effect level1. + * The default scale number of this click effect level1 is 0.90. + * The animation type is interpolatingSpring, velocity:10, mass:1, stiffness:410, damping:38. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Click effect level1. + * The default scale number of this click effect level1 is 0.90. + * The animation type is interpolatingSpring, velocity:10, mass:1, stiffness:410, damping:38. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LIGHT, + + /** + * Click effect level2. + * The default scale number of this click effect level2 is 0.95. + * The animation type is interpolatingSpring, velocity:10, mass:1, stiffness:350, damping:35. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Click effect level2. + * The default scale number of this click effect level2 is 0.95. + * The animation type is interpolatingSpring, velocity:10, mass:1, stiffness:350, damping:35. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MIDDLE, + + /** + * Click effect level3. + * The default scale number of this click effect level3 is 0.95. + * The animation type is interpolatingSpring, velocity:0, mass:1, stiffness:240, damping:28. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Click effect level3. + * The default scale number of this click effect level3 is 0.95. + * The animation type is interpolatingSpring, velocity:0, mass:1, stiffness:240, damping:28. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + HEAVY, } -declare enum ColoringStrategy { - INVERT = 'invert', - AVERAGE = 'average', - PRIMARY = 'primary', +/** + * The type of XComponent + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * The type of XComponent + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +/** + * The type of XComponent + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum XComponentType { + /** + * Surface type. The default type is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Surface type. The default type is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Surface type. The default type is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SURFACE, + + /** + * Component type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Component type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + * @deprecated since 12 + */ + COMPONENT, + + /** + * Texture type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Texture type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + TEXTURE, + + /** + * Node type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + NODE, } -declare enum EmbeddedType { - EMBEDDED_UI_EXTENSION = 0, +/** + * Nested scroll nested mode + + * @enum { number } NestedScrollMode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Nested scroll nested mode + + * @enum { number } NestedScrollMode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum NestedScrollMode { + /** + * Only Self response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Only Self response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SELF_ONLY, + + /** + * Self priority response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Self priority response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + SELF_FIRST, + + /** + * Parent scrollable component priority response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Parent scrollable component priority response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + PARENT_FIRST, + + /** + * Both self and parent scrollable component response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Both self and parent scrollable component response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + PARALLEL, } -declare enum Axis { - Vertical, - Horizontal, +/** + * The possible source of scroll event + * @enum { number } ScrollSource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum ScrollSource { + /** + * Drag events. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DRAG = 0, + + /** + * Fling after the drag has ended with velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FLING, + + /** + * Over scroll with EdgeEffect.Spring. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + EDGE_EFFECT, + + /** + * Other user input except drag, such as mouse wheel, key event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + OTHER_USER_INPUT, + + /** + * Drag events of scroll bar. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SCROLL_BAR, + + /** + * Fling after the drag on scroll bar has ended with velocity. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SCROLL_BAR_FLING, + + /** + * Member methods of Scroller without animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SCROLLER, + + /** + * Member methods of Scroller with animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SCROLLER_ANIMATION, } -declare enum VerticalAlign { - Top, - Center, - Bottom, +/** + * Enum of RenderFit + * + * @enum { number } RenderFit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum of RenderFit + * + * @enum { number } RenderFit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum RenderFit { + /** + * Without scaling the content area, the content area is drawn in the center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CENTER = 0, + /** + * Without scaling the content area, the content area is drawn in the top center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the top center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TOP = 1, + /** + * Without scaling the content area, the content area is drawn in the bottom center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the bottom center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOTTOM = 2, + /** + * Without scaling the content area, the content area is drawn in the left center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the left center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + LEFT = 3, + /** + * Without scaling the content area, the content area is drawn in the right center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the right center of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RIGHT = 4, + /** + * Without scaling the content area, the content area is drawn in the top left of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the top left of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TOP_LEFT = 5, + /** + * Without scaling the content area, the content area is drawn in the top right of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the top right of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TOP_RIGHT = 6, + /** + * Without scaling the content area, the content area is drawn in the bottom left of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the bottom left of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOTTOM_LEFT = 7, + /** + * Without scaling the content area, the content area is drawn in the bottom right of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Without scaling the content area, the content area is drawn in the bottom right of the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BOTTOM_RIGHT = 8, + /** + * Scale the length and width of the content area to the node size to fill the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length and width of the content area to the node size to fill the node. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_FILL = 9, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node, and the content after scaling + * is centered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node, and the content after scaling + * is centered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_CONTAIN = 10, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node. If the height of the scaled content + * is less than or equal to the height of the node, the scaled content area is displayed at the top; otherwise, + * the width of the scaled content is less than or equal to the width of the node, the scaled content area is + * displayed at the left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node. If the height of the scaled content + * is less than or equal to the height of the node, the scaled content area is displayed at the top; otherwise, + * the width of the scaled content is less than or equal to the width of the node, the scaled content area is + * displayed at the left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_CONTAIN_TOP_LEFT = 11, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node. If the height of the scaled content + * is less than or equal to the height of the node, the scaled content area is displayed at the bottom; otherwise, + * the width of the scaled content is less than or equal to the width of the node, the scaled content area is + * displayed at the right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is less than or equal to the corresponding side of the node. If the height of the scaled content + * is less than or equal to the height of the node, the scaled content area is displayed at the bottom; otherwise, + * the width of the scaled content is less than or equal to the width of the node, the scaled content area is + * displayed at the right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_CONTAIN_BOTTOM_RIGHT = 12, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node, and the content after scaling + * displays the center area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node, and the content after scaling + * displays the center area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_COVER = 13, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node. If the height of the scaled content + * is greater than or equal to the height of the node, the scaled content area displays the top area; otherwise, + * the width of the scaled content is greater than or equal to the width of the node, the scaled content area + * displays the left area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node. If the height of the scaled content + * is greater than or equal to the height of the node, the scaled content area displays the top area; otherwise, + * the width of the scaled content is greater than or equal to the width of the node, the scaled content area + * displays the left area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_COVER_TOP_LEFT = 14, + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node. If the height of the scaled content + * is greater than or equal to the height of the node, the scaled content area displays the bottom area; otherwise, + * the width of the scaled content is greater than or equal to the width of the node, the scaled content area + * displays the right area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scale the length or width of the content to the length or width of the node, ensuring that one side is equal, + * the other side is greater than or equal to the corresponding side of the node. If the height of the scaled content + * is greater than or equal to the height of the node, the scaled content area displays the bottom area; otherwise, + * the width of the scaled content is greater than or equal to the width of the node, the scaled content area + * displays the right area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RESIZE_COVER_BOTTOM_RIGHT = 15, } -/////////////// recently added /////////////// +/** + * The Button Style of dialog, + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The Button Style of dialog, + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum DialogButtonStyle { + /** + * Default Style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default Style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DEFAULT = 0, -declare enum FlexDirection { - Row, - Column, - RowReverse, - ColumnReverse, + /** + * Highlight Style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Highlight Style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + HIGHLIGHT = 1 } -declare enum FlexWrap { - NoWrap, - Wrap, - WrapReverse, +/** + * Enum of word break + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum WordBreak { + /** + * By default, CJK text can be wrapped between any 2 characters, and non-CJK text can only be wrapped in spaces. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NORMAL = 0, + + /** + * Non-CJK text be wrapped at any character + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BREAK_ALL = 1, + + /** + * Non-CJK text can be wrapped at any character + * and if a complete word can be preserved in space breaks, the word must be kept on the line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BREAK_WORD = 2, } -declare enum FlexAlign { - Start, - Center, - End, - SpaceBetween, - SpaceAround, - SpaceEvenly, +/** + * Enum of line break strategy + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum LineBreakStrategy { + /** + * By default. Display as many characters as possible on each line until no more characters + * can be displayed on that line, and do not automatically add hyphens under this strategy + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + GREEDY = 0, + + /** + * High quality folding. Optimize the layout of the entire text's line breaks and automatically + * add hyphens if necessary. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HIGH_QUALITY = 1, + + /** + * Balanced folding. We will try our best to ensure that the width of each line in a paragraph + * is the same, and if necessary, we will add conjunction + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BALANCED = 2, } -declare enum ItemAlign { - Auto, - Start, - Center, - End, - Baseline, - Stretch, +/** + * Enum of ellipsisMode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Enum of ellipsisMode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum EllipsisMode { + /** + * The ellipsis is in the head. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The ellipsis is in the head. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + START = 0, + + /** + * The ellipsis is in the middle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The ellipsis is in the middle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CENTER = 1, + + /** + * The ellipsis is at the end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The ellipsis is at the end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + END = 2, +} + +/** + * A type which can be undefined + * + * @typedef { T | undefined } Nullable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * A type which can be undefined + * + * @typedef { T | undefined } Nullable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type Nullable = T | undefined; + + +/** + * Decide whether the width of select menu fit the trigger or content + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Decide whether the width of select menu fit the trigger or content + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum OptionWidthMode { + /** + * The menu width fit the content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The menu width fit the content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FIT_CONTENT = 'fit_content', + + /** + * The menu width fit the trigger. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The menu width fit the trigger. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FIT_TRIGGER = 'fit_trigger', } +/** + * Enum of Illuminated type + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ declare enum IlluminatedType { + /** + * Component is not illuminated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ NONE = 0, + /** + * Border is illuminated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ BORDER = 1, + /** + * Content is illuminated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ CONTENT = 2, + /** + * Border and Content is illuminated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ BORDER_CONTENT = 3, + /** + * Border is illuminated, and the border have a bloom effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ BLOOM_BORDER = 4, + /** + * Border and Content is illuminated, and the border have a bloom effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ BLOOM_BORDER_CONTENT = 5 } -declare enum TextAlign { - Center, - Start, - End, - JUSTIFY, +/** + * Enumerates the fold status. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Enumerates the fold status. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum FoldStatus { + /** + * Fold Status Unknown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Fold Status Unknown. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLD_STATUS_UNKNOWN = 0, + /** + * Fold Status Expanded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Fold Status Expanded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLD_STATUS_EXPANDED = 1, + /** + * Fold Status Folded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Fold Status Folded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLD_STATUS_FOLDED = 2, + /** + * Fold Status Half Folded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Fold Status Half Folded. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FOLD_STATUS_HALF_FOLDED = 3, } -declare enum ImageFit { - Contain, - Cover, - Auto, - Fill, - ScaleDown, - None, - TOP_START = 7, - TOP = 8, - TOP_END = 9, - START = 10, - CENTER = 11, - END = 12, - BOTTOM_START = 13, - BOTTOM = 14, - BOTTOM_END = 15, +/** + * Enumerates the app rotation. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum AppRotation { + + /** + * App does not rotate to display vertically. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ROTATION_0 = 0, + + /** + * App rotates 90 degrees clockwise to display horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ROTATION_90 = 1, + + /** + * App rotates 180 degrees clockwise to display vertically in reverse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ROTATION_180 = 2, + + /** + * App rotates 270 degrees clockwise to display horizontally in reverse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ROTATION_270 = 3 } -declare enum BarState { - Off, - Auto, - On, +/** + * Enum of EmbeddedType + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum EmbeddedType { + /** + * The EmbeddedComponent show the UI in EmbeddedUIExtensionAbility. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + EMBEDDED_UI_EXTENSION = 0, } -declare enum ImageRepeat { - NoRepeat, - X, - Y, - XY, +/** + * Marquee scrolling strategy after text update + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum MarqueeUpdateStrategy { + /** + * Reset scroll position and restart scroll. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DEFAULT = 0, + + /** + * Preserve scroll position, just change to new text + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PRESERVE_POSITION = 1 } -declare enum Visibility { - Visible, - Hidden, - None, +/** + * Type of text decoration line style. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum TextDecorationStyle { + /** + * Solid line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SOLID = 0, + + /** + * Double lines. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DOUBLE = 1, + + /** + * Dotted line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DOTTED = 2, + + /** + * Dashed line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DASHED = 3, + + /** + * Wavy line. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + WAVY = 4, } -declare enum ImageSize { - Auto, - Cover, - Contain, - FILL = 3, +/** + * Type of text selectable. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum TextSelectableMode { + /** + * set text selectable and unfocusable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SELECTABLE_UNFOCUSABLE = 0, + + /** + * set text selectable and focusable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SELECTABLE_FOCUSABLE = 1, + + /** + * set text unselectable and unfocusable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + UNSELECTABLE = 2, } -declare enum Alignment { - TopStart, - Top, - TopEnd, - Start, - Center, - End, - BottomStart, - Bottom, - BottomEnd, +/** + * Type of accessibility hover event. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum AccessibilityHoverType { + /** + * Hover enter type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HOVER_ENTER = 0, + + /** + * Hover move type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HOVER_MOVE = 1, + + /** + * Hover exit type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HOVER_EXIT = 2, + + /** + * Hover cancel type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + HOVER_CANCEL = 3, } -declare enum LineCapStyle { - Butt, - Round, - Square, +/** + * Type of window width breakpoint. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +declare enum WidthBreakpoint { + /** + * Window width < 320vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_XS = 0, + + /** + * Window width >= 320vp and < 600vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_SM = 1, + + /** + * Window width >= 600vp and < 840vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_MD = 2, + + /** + * Window width >= 840vp and < 1440vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_LG = 3, + + /** + * Window width >= 1440vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_XL = 4, +} + +/** + * Type of window height breakpoint. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +declare enum HeightBreakpoint { + /** + * Window aspectRatio < 0.8 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_SM = 0, + + /** + * Window aspectRatio >= 0.8 and < 1.2 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_MD = 1, + + /** + * Window aspectRatio >= 1.2 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_LG = 2, } \ No newline at end of file diff --git a/tests/arkts-subset/ets/focus.d.ts b/tests/arkts-subset/ets/focus.d.ts new file mode 100644 index 00000000..2d58b4b4 --- /dev/null +++ b/tests/arkts-subset/ets/focus.d.ts @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file Provide some common interface for focus. + * @kit ArkUI + */ + +/** + * Focus box style. + * + * @interface FocusBoxStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface FocusBoxStyle { + /** + * Describes the focus-box margin. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + margin?: LengthMetrics; + /** + * Describes the focus-box color. + * + * @type { ?ColorMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + strokeColor?: ColorMetrics; + /** + * Describes the focus-box stroke width. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + strokeWidth?: LengthMetrics; +} + +/** + * Focus Priority + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum FocusPriority { + /** + * Default priority. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + AUTO = 0, + + /** + * Prior priority. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PRIOR = 2000, + + /** + * Previous focus priority. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PREVIOUS = 3000, +} \ No newline at end of file diff --git a/tests/arkts-subset/ets/form_component.d.ts b/tests/arkts-subset/ets/form_component.d.ts deleted file mode 100644 index e04095b3..00000000 --- a/tests/arkts-subset/ets/form_component.d.ts +++ /dev/null @@ -1,19 +0,0 @@ - -interface FormCallbackInfo { - - id: number; - idString: string; -} - -declare interface FormComponentInterface { - (): FormComponentAttribute -} - -declare class FormComponentAttribute extends CommonMethod { - - size(value: { width: number; height: number }): FormComponentAttribute; - - onAcquired(callback: Callback): FormComponentAttribute; -} - -declare const FormComponent: FormComponentInterface \ No newline at end of file diff --git a/tests/arkts-subset/ets/gesture.d.ts b/tests/arkts-subset/ets/gesture.d.ts index fb60ef03..f62fc0d9 100644 --- a/tests/arkts-subset/ets/gesture.d.ts +++ b/tests/arkts-subset/ets/gesture.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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 @@ -13,113 +13,3991 @@ * limitations under the License. */ -declare enum GesturePriority { +/** + * @file + * @kit ArkUI + */ - NORMAL = 0, - PRIORITY = 1, -} +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum PanDirection { + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, -declare enum GestureMask { + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Horizontal, - Normal, - IgnoreInternal, -} + /** + * Sliding left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Left, -declare enum GestureRecognizerState { + /** + * Sliding right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Right, - READY = 0, - DETECTING = 1, - PENDING = 2, - BLOCKED = 3, - SUCCESSFUL = 4, - FAILED = 5, + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Vertical, + + /** + * Sliding up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding up. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Up, + + /** + * Sliding Down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding Down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding Down. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Down, + + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + All, } -interface GestureInterface { +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum SwipeDirection { + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, - tag(tag: string): T; + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding horizontally. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Horizontal, + + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding Vertical + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Vertical, - allowedTypes(value: Array): T; + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sliding in all directions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + All, } -declare class GestureHandler implements GestureInterface { +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum GestureMode { + /** + * Sequential gesture recognition is performed in sequence according to the gesture registration sequence. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sequential gesture recognition is performed in sequence according to the gesture registration sequence. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sequential gesture recognition is performed in sequence according to the gesture registration sequence. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Sequence, - tag(tag: string): T; + /** + * Simultaneous recognition. Registration gestures participate in recognition. Everything can be triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Simultaneous recognition. Registration gestures participate in recognition. Everything can be triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Simultaneous recognition. Registration gestures participate in recognition. Everything can be triggered. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Parallel, - allowedTypes(types: Array): T; + /** + * Mutually exclusive recognition. Only one gesture is successfully recognized. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Mutually exclusive recognition. Only one gesture is successfully recognized. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Mutually exclusive recognition. Only one gesture is successfully recognized. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Exclusive, } +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 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. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Normal, -interface FingerInfo { + /** + * Ignore internal gestures and recognize the current gesture first. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Ignore internal gestures and recognize the current gesture first. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Ignore internal gestures and recognize the current gesture first. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + IgnoreInternal, +} - id: number; - globalX: number; - globalY: number; - localX: number; - localY: number; - displayX: number; - displayY: number; +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum GestureJudgeResult { + /** + * The system gesture determination is not affected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The system gesture determination is not affected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CONTINUE = 0, + + /** + * The user-defined gesture determination result of the current component is fail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The user-defined gesture determination result of the current component is fail. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + REJECT = 1, } +/** + * Creating an Object + * + * @namespace GestureControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Creating an Object + * + * @namespace GestureControl + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ declare namespace GestureControl { - + /** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ enum GestureType { - + /** + * TapGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * TapGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ TAP_GESTURE = 0, + + /** + * LongPressGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * LongPressGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ LONG_PRESS_GESTURE = 1, + + /** + * PanGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * PanGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ PAN_GESTURE = 2, + + /** + * PinchGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * PinchGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ PINCH_GESTURE = 3, + + /** + * SwipeGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * SwipeGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ SWIPE_GESTURE = 4, + + /** + * RotationGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * RotationGesture. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ ROTATION_GESTURE = 5, + + /** + * Drag. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Drag. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ DRAG = 6, + + /** + * Click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ CLICK = 7, } } +/** + * The description of gesture information. + * + * @interface GestureInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * The description of gesture information. + * + * @interface GestureInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GestureInfo { + /** + * The tag of gesture. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The tag of gesture. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + tag?: string; + + /** + * The type of gesture. + * + * @type { GestureControl.GestureType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The type of gesture. + * + * @type { GestureControl.GestureType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: GestureControl.GestureType; + + /** + * The flag whether it is a system gesture. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The flag whether it is a system gesture. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isSystemGesture: boolean; +} + +/** + * Type of the finger information. + * + * @interface FingerInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Type of the finger information. + * + * @interface FingerInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Type of the finger information. + * + * @interface FingerInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface FingerInfo { + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Finger unique identifier. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + id: number; + + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + globalX: number; + + /** + * The Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + globalY: number; + + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X coordinate of the touch point relative to the left edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + localX: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y coordinate of the touch point relative to the upper edge of the touched element. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + localY: number; + + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + displayX: number; + + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + displayY: number; +} + +/** + * Defines the Gesture Type. + * + * @typedef { TapGestureInterface | LongPressGestureInterface | PanGestureInterface | PinchGestureInterface | SwipeGestureInterface | RotationGestureInterface | GestureGroupInterface } PointerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Gesture Type. + * + * @typedef { TapGestureInterface | LongPressGestureInterface | PanGestureInterface | PinchGestureInterface | SwipeGestureInterface | RotationGestureInterface | GestureGroupInterface } PointerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the Gesture Type. + * + * @typedef { TapGestureInterface | LongPressGestureInterface | PanGestureInterface | PinchGestureInterface | SwipeGestureInterface | RotationGestureInterface | GestureGroupInterface } PointerStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ declare type GestureType = TapGestureInterface - | LongPressGestureInterface; + | LongPressGestureInterface + | PanGestureInterface + | PinchGestureInterface + | SwipeGestureInterface + | RotationGestureInterface + | GestureGroupInterface; -interface TapGestureInterface { - onAction(event: (event: BaseGestureEvent) => void): TapGestureInterface; +/** + * Defines the gesture base event. + * + * @interface BaseGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the gesture base event. + * + * @interface BaseGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface BaseGestureEvent extends BaseEvent { + /** + * All finger information. + * + * @type { FingerInfo[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * All finger information. + * + * @type { FingerInfo[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingerList: FingerInfo[]; } -interface LongPressGestureInterface extends GestureInterface { - onAction(event: (event: BaseGestureEvent) => void): LongPressGestureInterface; - onActionEnd(event: (event: BaseGestureEvent) => void): LongPressGestureInterface; - onActionCancel(event: () => void): LongPressGestureInterface; +/** + * Defines event info for tap gesture. + * + * @interface TapGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for tap gesture. + * + * @interface TapGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface TapGestureEvent extends BaseGestureEvent { } -interface BaseGestureEvent extends BaseEvent { +/** + * Defines event info for long press gesture. + * + * @interface LongPressGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for long press gesture. + * + * @interface LongPressGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface LongPressGestureEvent extends BaseGestureEvent { + /** + * Indicates whether an event is triggered repeatedly. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Indicates whether an event is triggered repeatedly. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + repeat: boolean; +} + +/** + * Defines event info for pan gesture. + * + * @interface PanGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for pan gesture. + * + * @interface PanGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PanGestureEvent extends BaseGestureEvent { + /** + * Gesture event offset X. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gesture event offset X. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offsetX: number; + + /** + * Gesture event offset Y. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gesture event offset Y. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offsetY: number; + + /** + * X-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * X-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + velocityX: number; + + /** + * Y-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Y-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + velocityY: number; + + /** + * velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + velocity: number; +} + +/** + * Defines event info for pinch gesture. + * + * @interface PinchGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for pinch gesture. + * + * @interface PinchGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PinchGestureEvent extends BaseGestureEvent { + /** + * Scaling ratio. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Scaling ratio. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scale: number; + + /** + * X-axis coordinate of the kneading center point. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * X-axis coordinate of the kneading center point. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pinchCenterX: number; + + /** + * Y-axis coordinate of the kneading center point. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Y-axis coordinate of the kneading center point. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pinchCenterY: number; +} + +/** + * Defines event info for rotation gesture. + * + * @interface RotationGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for rotation gesture. + * + * @interface RotationGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface RotationGestureEvent extends BaseGestureEvent { + /** + * Gesture event direction angle. + * The unit is deg. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gesture event direction angle. + * The unit is deg. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + angle: number; +} + +/** + * Defines event info for swipe gesture. + * + * @interface SwipeGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines event info for swipe gesture. + * + * @interface SwipeGestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 112 + */ +interface SwipeGestureEvent extends BaseGestureEvent { + /** + * Gesture event direction angle. + * The unit is deg. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gesture event direction angle. + * The unit is deg. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + angle: number; + + /** + * Gesture event slide speed. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gesture event slide speed. + * The unit is vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + speed: number; +} + +/** + * Defines event info for gesture. + * + * @interface GestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines event info for gesture. + * + * @interface GestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines event info for gesture. + * + * @interface GestureEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface GestureEvent extends BaseEvent { + /** + * Indicates whether an event is triggered repeatedly. + * Used in LongPressGesture. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether an event is triggered repeatedly. + * Used in LongPressGesture. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates whether an event is triggered repeatedly. + * Used in LongPressGesture. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + repeat: boolean; + /** + * All finger information. + * Used in LongPressGesture and TapGesture. + * + * @type { FingerInfo[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * All finger information. + * Used in LongPressGesture and TapGesture. + * + * @type { FingerInfo[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * All finger information. + * Used in LongPressGesture and TapGesture. + * + * @type { FingerInfo[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ fingerList: FingerInfo[]; + + /** + * Gesture event offset X. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Gesture event offset X. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Gesture event offset X. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetX: number; + + /** + * Gesture event offset Y. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Gesture event offset Y. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Gesture event offset Y. + * The unit is vp. + * Used in PanGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetY: number; + + /** + * Gesture event direction angle. + * The unit is deg. + * Used in RotationGesture and SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Gesture event direction angle. + * The unit is deg. + * Used in RotationGesture and SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Gesture event direction angle. + * The unit is deg. + * Used in RotationGesture and SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + angle: number; + + /** + * Gesture event slide speed. + * The unit is vp. + * Used in SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Gesture event slide speed. + * The unit is vp. + * Used in SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Gesture event slide speed. + * The unit is vp. + * Used in SwipeGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + speed: number; + + /** + * Scaling ratio. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Scaling ratio. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scaling ratio. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scale: number; + + /** + * X-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * X-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pinchCenterX: number; + + /** + * Y-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Y-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y-axis coordinate of the kneading center point. + * The unit is vp. + * Used in PinchGesture. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pinchCenterY: number; + + /** + * X-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * X-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + velocityX: number; + + /** + * Y-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Y-axis velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + velocityY: number; + + /** + * velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * velocity of the gesture. + * @type {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + velocity: number; } +/** + * Defines Gesture interface. + * + * @interface GestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface GestureInterface { + /** + * Set gesture's tag. + * + * @param { string } tag + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + tag(tag: string): T; -declare enum GestureJudgeResult { + /** + * Input source type for gesture response. + * + * @param { Array } types - indicate the allowed input source for gesture to response + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + allowedTypes(types: Array): T; +} - CONTINUE = 0, - REJECT = 1, +/** + * Defines TapGesture parameters. + * + * @interface TapGestureParameters + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TapGestureParameters { + /** + * Number of consecutive clicks recognized. If the value is less than 1, the default value is used. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + count?: number; + /** + * The hand index that triggers the click. If the value is less than 1, the default value is used. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fingers?: number; + /** + * The limited move distance of click. If the value is less than 0, the default value is used. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + distanceThreshold?: number; } -declare class EventTargetInfo { +/** + * Defines TapGesture interface. + * + * @interface TapGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TapGesture interface. + * + * @interface TapGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TapGesture interface extends GestureInterface. + * + * @interface TapGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface TapGestureInterface extends GestureInterface { + /** + * 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. + * + * @param { object } value + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @param { object } value + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * 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. + * + * @param { object } value + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Set the value. + * TapGestureParameters: The parameters of the tapGesture. + * + * @param { TapGestureParameters } value + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (value?: TapGestureParameters): TapGestureInterface; + /** + * Tap gesture recognition success callback. + * + * @param { function } event + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Tap gesture recognition success callback. + * + * @param { function } event + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Tap gesture recognition success callback. + * + * @param { function } event + * @returns { TapGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAction(event: (event: GestureEvent) => void): TapGestureInterface; +} + +/** + * Defines LongPressGesture interface. + * + * @interface LongPressGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines LongPressGesture interface. + * + * @interface LongPressGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines LongPressGesture interface extends GestureInterface. + * + * @interface LongPressGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface LongPressGestureInterface extends GestureInterface { + /** + * Set the value. + * 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. + * + * @param { object } value + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * 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. + * + * @param { object } value + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * 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. + * + * @param { object } value + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { fingers?: number; repeat?: boolean; duration?: number }): LongPressGestureInterface; + + /** + * LongPress gesture recognition success callback. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * LongPress gesture recognition success callback. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * LongPress gesture recognition success callback. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAction(event: (event: GestureEvent) => void): LongPressGestureInterface; + + /** + * The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionEnd(event: (event: GestureEvent) => void): LongPressGestureInterface; + + /** + * The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { LongPressGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionCancel(event: () => void): LongPressGestureInterface; +} + +/** + * Defines the PanGesture options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the PanGesture options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the PanGesture options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class PanGestureOptions { + /** + * Constructor parameters. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Constructor parameters. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Constructor parameters. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(value?: { fingers?: number; direction?: PanDirection; distance?: number }); + + /** + * Sets the direction attribute. + * + * @param { PanDirection } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the direction attribute. + * + * @param { PanDirection } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the direction attribute. + * + * @param { PanDirection } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setDirection(value: PanDirection); + + /** + * Sets the setDistance attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the setDistance attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the setDistance attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setDistance(value: number); + + /** + * Sets the setFingers attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the setFingers attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the setFingers attribute. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setFingers(value: number); + + /** + * Get the pan direction attribute. + * + * @returns { PanDirection } - Pan gesture direction + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getDirection(): PanDirection; +} + +/** + * Defines the PanGesture interface. + * + * @interface PanGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the PanGesture interface. + * + * @interface PanGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PanGesture interface extends GestureInterface. + * + * @interface PanGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface PanGestureInterface extends GestureInterface { + /** + * Set the value. + * + * @param { { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions } value + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * + * @param { { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions } value + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * + * @param { { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions } value + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions): PanGestureInterface; + + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionStart(event: (event: GestureEvent) => void): PanGestureInterface; + + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionUpdate(event: (event: GestureEvent) => void): PanGestureInterface; + + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionEnd(event: (event: GestureEvent) => void): PanGestureInterface; + + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PanGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionCancel(event: () => void): PanGestureInterface; +} + +/** + * Defines the SwipeGesture interface. + * + * @interface SwipeGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the SwipeGesture interface. + * + * @interface SwipeGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines SwipeGesture interface extends GestureInterface. + * + * @interface SwipeGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface SwipeGestureInterface extends GestureInterface { + /** + * Set the value. + * + * @param { object } value + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { fingers?: number; direction?: SwipeDirection; speed?: number }): SwipeGestureInterface; + + /** + * Slide gesture recognition success callback. + * + * @param { function } event + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Slide gesture recognition success callback. + * + * @param { function } event + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Slide gesture recognition success callback. + * + * @param { function } event + * @returns { SwipeGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onAction(event: (event: GestureEvent) => void): SwipeGestureInterface; +} + +/** + * Defines the PinchGesture interface. + * + * @interface PinchGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the PinchGesture interface. + * + * @interface PinchGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PinchGesture interface extends GestureInterface. + * + * @interface PinchGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface PinchGestureInterface extends GestureInterface { + /** + * Set the value. + * + * @param { object } value + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { fingers?: number; distance?: number }): PinchGestureInterface; + + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionStart(event: (event: GestureEvent) => void): PinchGestureInterface; + + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionUpdate(event: (event: GestureEvent) => void): PinchGestureInterface; + + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionEnd(event: (event: GestureEvent) => void): PinchGestureInterface; + + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { PinchGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionCancel(event: () => void): PinchGestureInterface; +} + +/** + * Defines the RotationGesture interface. + * + * @interface RotationGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the RotationGesture interface. + * + * @interface RotationGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines RotationGesture interface extends GestureInterface. + * + * @interface RotationGestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface RotationGestureInterface extends GestureInterface { + /** + * Set the value. + * + * @param { object } value + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the value. + * + * @param { object } value + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: { fingers?: number; angle?: number }): RotationGestureInterface; + + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pan gesture recognition success callback. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionStart(event: (event: GestureEvent) => void): RotationGestureInterface; + + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback when the Pan gesture is moving. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionUpdate(event: (event: GestureEvent) => void): RotationGestureInterface; + + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionEnd(event: (event: GestureEvent) => void): RotationGestureInterface; + + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { RotationGestureInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onActionCancel(event: () => void): RotationGestureInterface; +} + +/** + * Defines the GestureGroup interface. + * + * @interface GestureGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the GestureGroup interface. + * + * @interface GestureGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the GestureGroup interface. + * + * @interface GestureGroupInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface GestureGroupInterface { + /** + * Return to Obtain GestureGroup. + * + * @param { GestureMode } mode + * @param { GestureType[] } gesture + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Return to Obtain GestureGroup. + * + * @param { GestureMode } mode + * @param { GestureType[] } gesture + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Return to Obtain GestureGroup. + * + * @param { GestureMode } mode + * @param { GestureType[] } gesture + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (mode: GestureMode, ...gesture: GestureType[]): GestureGroupInterface; + + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { function } event + * @returns { GestureGroupInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onCancel(event: () => void): GestureGroupInterface; +} + +/** + * Defines TapGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TapGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TapGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const TapGesture: TapGestureInterface; + +/** + * Defines LongPressGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines LongPressGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines LongPressGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const LongPressGesture: LongPressGestureInterface; + +/** + * Defines PanGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines PanGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PanGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const PanGesture: PanGestureInterface; + +/** + * Defines SwipeGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines SwipeGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines SwipeGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const SwipeGesture: SwipeGestureInterface; + +/** + * Defines PinchGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines PinchGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines PinchGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const PinchGesture: PinchGestureInterface; + +/** + * Defines RotationGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines RotationGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines RotationGesture Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const RotationGesture: RotationGestureInterface; + +/** + * Defines GestureGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines GestureGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines GestureGroup Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const GestureGroup: GestureGroupInterface; + +/** + * Defines the gesture handler. + * + * @implements GestureInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class GestureHandler implements GestureInterface { + /** + * Set the GestureHandler's tag. + * + * @param { string } tag + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + tag(tag: string): T; + + /** + * Input source type for gesture response. + * + * @param { Array } types - indicate the allowed input source for gesture to response + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + allowedTypes(types: Array): T; +} + +/** + * Defines the TapGestureHandler options. + * + * @interface TapGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface TapGestureHandlerOptions { + /** + * Indicates the number of consecutive clicks recognized. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + count?: number; + /** + * Indicates the hand index that triggers the click. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; +} + +/** + * Defines the TapGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TapGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { TapGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: TapGestureHandlerOptions); + /** + * Tap gesture recognition success callback. + * + * @param { Callback } event + * @returns { TapGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAction(event: Callback): TapGestureHandler; +} + +/** + * Defines the LongPressGestureHandler options. + * + * @interface LongPressGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface LongPressGestureHandlerOptions { + /** + * Indicates the hand index that triggers the long press. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; + /** + * Indicates whether an event is triggered repeatedly. + * The default value is false. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + repeat?: boolean; + /** + * Indicates minimum press and hold time, in milliseconds. + * The default value is 500ms. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + duration?: number; +} + +/** + * Defines the LongPressGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class LongPressGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { LongPressGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: LongPressGestureHandlerOptions); + /** + * LongPress gesture recognition success callback. + * + * @param { Callback } event + * @returns { LongPressGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAction(event: Callback): LongPressGestureHandler; + /** + * The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { Callback } event + * @returns { LongPressGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionEnd(event: Callback): LongPressGestureHandler; + /** + * The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { Callback } event + * @returns { LongPressGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionCancel(event: Callback): LongPressGestureHandler; +} + +/** + * Defines the PanGestureHandler options. + * + * @interface PanGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PanGestureHandlerOptions { + /** + * Indicates the hand index that triggers the pan. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; + /** + * Indicates the move direction of the pan gesture. + * The default value is PanDirection.All. + * + * @type { ?PanDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + direction?: PanDirection; + /** + * Indicates minimum move distance. + * The default value is 5vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + distance?: number; +} + +/** + * Defines the PanGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class PanGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { PanGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: PanGestureHandlerOptions); + /** + * Pan gesture recognition success callback. + * + * @param { Callback } event + * @returns { PanGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionStart(event: Callback): PanGestureHandler; + /** + * Callback when the Pan gesture is moving. + * + * @param { Callback } event + * @returns { PanGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionUpdate(event: Callback): PanGestureHandler; + /** + * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { Callback } event + * @returns { PanGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionEnd(event: Callback): PanGestureHandler; + /** + * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { Callback } event + * @returns { PanGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionCancel(event: Callback): PanGestureHandler; +} + +/** + * Defines the SwipeGestureHandler options. + * + * @interface SwipeGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface SwipeGestureHandlerOptions { + /** + * Indicates the hand index that triggers the swipe. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; + /** + * Indicates the move direction of the swipe gesture. + * The default value is SwipeDirection.All. + * + * @type { ?SwipeDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + direction?: SwipeDirection; + /** + * Indicates minimum move speed. + * The default value is 100vp/s. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + speed?: number; +} + +/** + * Defines the SwipeGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class SwipeGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { SwipeGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: SwipeGestureHandlerOptions); + /** + * Swipe gesture recognition success callback. + * + * @param { Callback } event + * @returns { SwipeGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAction(event: Callback): SwipeGestureHandler; +} + +/** + * Defines the PinchGestureHandler options. + * + * @interface PinchGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PinchGestureHandlerOptions { + /** + * Indicates the hand index that triggers the pinch. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; + /** + * Indicates minimum pinch move distance. + * The default value is 5vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + distance?: number; +} + +/** + * Defines the PinchGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class PinchGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { PinchGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: PinchGestureHandlerOptions); + /** + * Pinch gesture recognition success callback. + * + * @param { Callback } event + * @returns { PinchGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionStart(event: Callback): PinchGestureHandler; + /** + * Callback when the Pinch gesture is moving. + * + * @param { Callback } event + * @returns { PinchGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionUpdate(event: Callback): PinchGestureHandler; + /** + * The Pinch gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { Callback } event + * @returns { PinchGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionEnd(event: Callback): PinchGestureHandler; + /** + * The Pinch gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { Callback } event + * @returns { PinchGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionCancel(event: Callback): PinchGestureHandler; +} + +/** + * Defines the RotationGestureHandler options. + * + * @interface RotationGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface RotationGestureHandlerOptions { + /** + * Indicates the hand index that triggers the rotation. If the value is less than 1, the default value is used. + * The default value is 1. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fingers?: number; + /** + * Indicates minimum rotate angle. + * The default value is 1deg. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + angle?: number; +} + +/** + * Defines the RotationGesture handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class RotationGestureHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { RotationGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: RotationGestureHandlerOptions); + /** + * Rotation gesture recognition success callback. + * + * @param { Callback } event + * @returns { RotationGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionStart(event: Callback): RotationGestureHandler; + /** + * Callback when the Rotation gesture is moving. + * + * @param { Callback } event + * @returns { RotationGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionUpdate(event: Callback): RotationGestureHandler; + /** + * The Rotation gesture is successfully recognized. When the finger is lifted, the callback is triggered. + * + * @param { Callback } event + * @returns { RotationGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionEnd(event: Callback): RotationGestureHandler; + /** + * The Rotation gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { Callback } event + * @returns { RotationGestureHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onActionCancel(event: Callback): RotationGestureHandler; +} + +/** + * Defines the GestureGroupGestureHandler options. + * + * @interface GestureGroupGestureHandlerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface GestureGroupGestureHandlerOptions { + /** + * Indicates the mode of gesture group. + * + * @type { GestureMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + mode: GestureMode; + /** + * Indicates the gestures included in the gesture group. + * + * @type { GestureHandler[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + gestures: GestureHandler[]; +} + +/** + * Defines the GestureGroup handler. + * + * @extends GestureHandler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class GestureGroupHandler extends GestureHandler { + /** + * Constructor parameters. + * + * @param { GestureGroupGestureHandlerOptions } options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(options?: GestureGroupGestureHandlerOptions); + /** + * The GestureGroup gesture is successfully recognized and a callback is triggered when the touch cancel event is received. + * + * @param { Callback } event + * @returns { GestureGroupHandler } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onCancel(event: Callback): GestureGroupHandler; +} + +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum GesturePriority { + /** + * The normal gesture priority. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NORMAL = 0, + /** + * The high gesture priority. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PRIORITY = 1, +} + +/** + * Creating an Object + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum GestureRecognizerState { + /** + * Ready state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + READY = 0, + /** + * Detecting state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DETECTING = 1, + /** + * Pending state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PENDING = 2, + /** + * Blocked state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BLOCKED = 3, + /** + * Successful state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SUCCESSFUL = 4, + /** + * Failed state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FAILED = 5, +} + +/** + * Defines the scrollable target information. + * + * @extends EventTargetInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ScrollableTargetInfo extends EventTargetInfo { + /** + * Returns whether the scrollable component is at begin. + * + * @returns { boolean } - true is at begin, false is not at begin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isBegin(): boolean; + /** + * Returns whether the scrollable component is at end. + * + * @returns { boolean } - true is at end, false is not at end + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isEnd(): boolean; +} + +/** + * Defines the event target information. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class EventTargetInfo { + /** + * Returns the component's inspector id. + * + * @returns { string } - the inspector id of the component + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ getId(): string; } +/** + * Defines the gesture recognizer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ declare class GestureRecognizer { - + /** + * Returns the gesture's tag. + * + * @returns { string } - the gesture's tag + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ getTag(): string; - + /** + * Returns the gesture's type. + * + * @returns { GestureControl.GestureType } - the gesture's type + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ getType(): GestureControl.GestureType; - + /** + * Returns whether the gesture recognizer is built in recognizer. + * + * @returns { boolean } - true is built in recognizer, false is not built in recognizer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ isBuiltIn(): boolean; - + /** + * set the enabled state of the gesture recognizer. + * + * @param { boolean } isEnabled - Indicates the enabled state. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ setEnabled(isEnabled: boolean): void; - + /** + * Returns whether the gesture recognizer is enabled. + * + * @returns { boolean } - true is enabled, false is not enabled + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ isEnabled(): boolean; - + /** + * Returns the gesture recognizer's state. + * + * @returns { GestureRecognizerState } - the gesture recognizer's state + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ getState(): GestureRecognizerState; - + /** + * Returns the event target information of the component. + * + * @returns { EventTargetInfo } - the event target information of the component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ getEventTargetInfo(): EventTargetInfo; + /** + * Returns whether the gesture recognizer is valid. + * + * @returns { boolean } - true is valid, false is invalid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + isValid(): boolean; +} + +/** + * Defines the gesture recognizer. + * + * @extends GestureRecognizer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class PanRecognizer extends GestureRecognizer { + /** + * Returns the the pan gesture options of the recognizer. + * + * @returns { PanGestureOptions } - Pan gesture options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getPanGestureOptions(): PanGestureOptions; } + diff --git a/tests/arkts-subset/ets/image.d.ts b/tests/arkts-subset/ets/image.d.ts index 212073b7..4f95ee0d 100644 --- a/tests/arkts-subset/ets/image.d.ts +++ b/tests/arkts-subset/ets/image.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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 @@ -13,20 +13,1942 @@ * limitations under the License. */ +/** + * @file + * @kit ArkUI + */ + +/** + * Use the DrawableDescriptor class to get drawable image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Use the DrawableDescriptor class to get drawable image. + * + * @typedef { import ('../api/@ohos.arkui.drawableDescriptor').DrawableDescriptor } DrawableDescriptor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ declare type DrawableDescriptor = import ('../api/@ohos.arkui.drawableDescriptor').DrawableDescriptor; +/** + * Import the DrawingColorFilter type object for image color filter setting. + * + * @typedef DrawingColorFilter + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type DrawingColorFilter = import('../api/@ohos.graphics.drawing').default.ColorFilter; + +/** + * Enumerates all the levels available for the image resolution quality. + * + * @typedef {import('../api/@ohos.multimedia.image').default.ResolutionQuality} ResolutionQuality + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ +declare type ResolutionQuality = import('../api/@ohos.multimedia.image').default.ResolutionQuality; + +/** + * Lattice for dividing an image into grids. + * + * @typedef { import('../api/@ohos.graphics.drawing').default.Lattice } Lattice + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type DrawingLattice = import('../api/@ohos.graphics.drawing').default.Lattice; + +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ImageRenderMode { + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Original, + + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Template, +} + +/** + * Specify image's content. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ declare enum ImageContent { + /** + * Make image empty. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ EMPTY = 0, } -declare interface ImageInterface { - (src: PixelMap | ResourceStr | DrawableDescriptor): ImageAttribute; - (src: PixelMap | ResourceStr | DrawableDescriptor | ImageContent): ImageAttribute; - (src: PixelMap | ResourceStr | DrawableDescriptor, imageAIOptions: ImageAIOptions): ImageAttribute; + +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum DynamicRangeMode { + /** + * Allow image content to use an unrestricted extended range. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + HIGH = 0, + + /** + * Allow image content to use some extended range. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + CONSTRAINT = 1, + + /** + * Restrict the image content dynamic range to the standard range. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + STANDARD = 2, +} + +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ImageInterpolation { + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Low, + + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Medium, + + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + High, +} + +/** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare enum ImageRotateOrientation { + /** + * Rotate according to the image rotation + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + AUTO = 0, + + /** + * Ignore the rotation of the image + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + UP = 1, + + /** + * Based on image rotation, rotate clockwise 90 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + RIGHT = 2, + + /** + * Based on image rotation, rotate clockwise 180 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + DOWN = 3, + + /** + * Based on image rotation, rotate clockwise 270 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + LEFT = 4, } +/** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ImageInterface { + /** + * Set src to obtain images. + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (src: PixelMap | ResourceStr | DrawableDescriptor): ImageAttribute; + + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor | ImageContent } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + (src: PixelMap | ResourceStr | DrawableDescriptor | ImageContent): ImageAttribute; + + /** + * Set src and ai options to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @param { ImageAIOptions } imageAIOptions + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + (src: PixelMap | ResourceStr | DrawableDescriptor, imageAIOptions: ImageAIOptions): ImageAttribute; +} + +/** + * Defines source size of image. + * + * @interface ImageSourceSize + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + +interface ImageSourceSize { + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width: number; + + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height: number; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare class ImageAttribute extends CommonMethod { - objectFit(value: ImageFit): ImageAttribute; + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource | PixelMap } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + alt(value: string | Resource | PixelMap): ImageAttribute; + + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + matchTextDirection(value: boolean): ImageAttribute; + + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fitOriginalSize(value: boolean): ImageAttribute; + + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ fillColor(value: ResourceColor): ImageAttribute; + + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + objectFit(value: ImageFit): ImageAttribute; + + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + objectRepeat(value: ImageRepeat): ImageAttribute; + + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + autoResize(value: boolean): ImageAttribute; + + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + renderMode(value: ImageRenderMode): ImageAttribute; + + /** + * Set dynamic range mode of image. + * + * @param { DynamicRangeMode } value - Indicates the resizable options. + * @returns { ImageAttribute } Returns the instance of the ImageAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + dynamicRangeMode(value: DynamicRangeMode): ImageAttribute; + + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + interpolation(value: ImageInterpolation): ImageAttribute; + + /** + * 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. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * 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. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * 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. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * 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. + * + * @param { ImageSourceSize } value - Image source size. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + sourceSize(value: ImageSourceSize): ImageAttribute; + + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + syncLoad(value: boolean): ImageAttribute; + + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter | DrawingColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + colorFilter(value: ColorFilter | DrawingColorFilter): ImageAttribute; + + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + copyOption(value: CopyOptions): ImageAttribute; + + /** + * Enable image dragging. + * Default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Enable image dragging. + * Default value is true. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + draggable(value: boolean): ImageAttribute; + + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { ImageAttribute } The attribute of the image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): ImageAttribute; + + /** + * SVG anti-aliasing. + * The range of the parameter values is (0.333, 1.333]. + * Default value is 0.0. + * + * @param { number } value - The degree of anti-aliasing. + * @returns { ImageAttribute } The attribute of the image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + edgeAntialiasing(value: number): ImageAttribute; + + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onComplete( + callback: (event?: { + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + width: number; + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + height: number; + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + componentWidth: number; + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + componentHeight: number; + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + loadingStatus: number; + /** + * The width of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The width of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentWidth: number; + /** + * The height of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The height of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentHeight: number; + /** + * The actual draw is offset from the x-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The actual draw is offset from the x-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentOffsetX: number; + /** + * The actual draw is offset from the y-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The actual draw is offset from the y-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentOffsetY: number; + }) => void, + ): ImageAttribute; + + /** + * This callback is triggered when an exception occurs during image loading. + * The field of "message" carries the detailed information of failed image loading. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * This callback is triggered when an exception occurs during image loading. + * The field of "message" carries the detailed information of failed image loading. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * This callback is triggered when an exception occurs during image loading. + * The field of "message" carries the detailed information of failed image loading. + * + * @param { ImageErrorCallback } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onError(callback: ImageErrorCallback): ImageAttribute; + + /** + * 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. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * 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. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * 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. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * 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. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onFinish(event: () => void): ImageAttribute; + + /** + * Enable image analyzer. + * + * @param { boolean} enable + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Enable image analyzer. + * + * @param { boolean} enable + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableAnalyzer(enable: boolean): ImageAttribute; + + /** + * Set image analyzer with config. + * + * @param { ImageAnalyzerConfig } config + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + analyzerConfig(config: ImageAnalyzerConfig): ImageAttribute; + + /** + * Set image resizable options. + * + * @param { ResizableOptions } value - Indicates the resizable options. + * @returns { ImageAttribute } Returns the instance of the ImageAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set image resizable options. + * + * @param { ResizableOptions } value - Indicates the resizable options. + * @returns { ImageAttribute } Returns the instance of the ImageAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + resizable(value: ResizableOptions): ImageAttribute; + + /** + * Whether to support sensitive privacy information + * + * @param { boolean } supported - Whether to support sensitive privacy information. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 12 + */ + privacySensitive(supported: boolean): ImageAttribute; + + /** + * Set the quality enhancement level of image. + * + * @param { ResolutionQuality } imageQuality + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + enhancedImageQuality(imageQuality: ResolutionQuality): ImageAttribute; + + /** + * Set the rotation angle of image. + * + * @param { ImageRotateOrientation } orientation + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + orientation(orientation: ImageRotateOrientation) : ImageAttribute; +} + +/** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Image: ImageInterface; + +/** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ImageInstance: ImageAttribute; + +/** + * @type ImageErrorCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @type ImageErrorCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @typedef { function } ImageErrorCallback + * @param { ImageError } error + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +type ImageErrorCallback = (error: ImageError) => void; + +/** + * @interface ImageError + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @interface ImageError + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @interface ImageError + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ImageError { + /** + * Component width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Component width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Component width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + componentWidth: number; + + /** + * Component height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Component height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Component height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + componentHeight: number; + + /** + * Message. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Message. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + message: string } -declare const Image: ImageInterface \ No newline at end of file +/** + * Image resizable options + * + * @interface ResizableOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Image resizable options + * + * @interface ResizableOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ResizableOptions { + /** + * Image slice widths. + * + * @type { ?EdgeWidths } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Image slice widths. + * + * @type { ?EdgeWidths } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + slice?: EdgeWidths; + + /** + * Image lattice. + * + * @type { ?DrawingLattice } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lattice?: DrawingLattice; +} diff --git a/tests/arkts-subset/ets/image_common.d.ts b/tests/arkts-subset/ets/image_common.d.ts index ec6f8695..ad4c5d95 100644 --- a/tests/arkts-subset/ets/image_common.d.ts +++ b/tests/arkts-subset/ets/image_common.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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 @@ -13,18 +13,122 @@ * limitations under the License. */ +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the image analyze type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ declare enum ImageAnalyzerType { - SUBJECT = 0, - TEXT, - OBJECT_LOOKUP, + /** + * Image analyze type subject. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + SUBJECT = 0, + + /** + * Image analyze type text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + TEXT, + + /** + * Image analyze type object lookup. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + OBJECT_LOOKUP, } +/** + * Image analyzer controller. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ declare class ImageAnalyzerController { - constructor(); - getImageAnalyzerSupportTypes(): ImageAnalyzerType[]; + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + constructor(); + + /** + * Get image analyzer support types. + * + * @returns { ImageAnalyzerType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + getImageAnalyzerSupportTypes(): ImageAnalyzerType[]; +} + +/** + * Image analyzer config. + * + * @interface ImageAnalyzerConfig + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface ImageAnalyzerConfig { + /** + * Image analyze types. + * + * @type { ImageAnalyzerType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + types: ImageAnalyzerType[]; } +/** + * Image ai options. + * + * @interface ImageAIOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ declare interface ImageAIOptions { - types?: ImageAnalyzerType[]; - aiController?: ImageAnalyzerController; + /** + * Image analyze types. + * + * @type { ?ImageAnalyzerType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + types?: ImageAnalyzerType[]; + + /** + * Image analyze types. + * + * @type { ?ImageAnalyzerController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + aiController?: ImageAnalyzerController; } \ No newline at end of file diff --git a/tests/arkts-subset/ets/indicatorcomponent.d.ts b/tests/arkts-subset/ets/indicatorcomponent.d.ts new file mode 100644 index 00000000..7f91999b --- /dev/null +++ b/tests/arkts-subset/ets/indicatorcomponent.d.ts @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides methods for switching components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +declare class IndicatorComponentController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + constructor(); + + /** + * Called when the next child component is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + showNext():void; + + /** + * Called when the previous subcomponent is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + showPrevious():void; + + /** + * Controlling IndicatorComponent to change to the specified subcomponent. + * + * @param { number } index - The index of item to be redirected. + * @param { boolean } [useAnimation] - If true, swipe to index item with animation. If false, swipe to index item without animation. + * The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + changeIndex(index: number, useAnimation?: boolean):void; +} + +/** + * Provides an interface for indicator. + * + * @interface IndicatorComponentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +interface IndicatorComponentInterface { + + /** + * Called when a indicator is set. + * + * @param { IndicatorComponentController } controller - indicator component controller. + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + (controller?: IndicatorComponentController): IndicatorComponentAttribute; +} + +/** + * Defines the IndicatorComponent attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +declare class IndicatorComponentAttribute extends CommonMethod { + /** + * Called when the index value of the displayed subcomponent is set in the container. + * + * @param { number } index + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + initialIndex(index: number): IndicatorComponentAttribute; + + /** + * Sets the total number of indicator. + * + * @param { number } totalCount + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + count(totalCount: number): IndicatorComponentAttribute; + + /** + * Sets the indicator style. + * + * @param { DotIndicator | DigitIndicator } indicatorStyle - the style value + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + style(indicatorStyle: DotIndicator | DigitIndicator): IndicatorComponentAttribute; + + /** + * Called when setting whether to turn on cyclic sliding. + * + * @param { boolean } isLoop + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + loop(isLoop: boolean): IndicatorComponentAttribute; + + /** + * Called when setting whether to slide vertically. + * + * @param { boolean } isVertical + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + vertical(isVertical: boolean): IndicatorComponentAttribute; + + /** + * Called when the index value changes. + * + * @param { Callback } event + * @returns { IndicatorComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + onChange(event: Callback): IndicatorComponentAttribute; +} + +/** + * Defines IndicatorComponent. + * + * @constant + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +declare const IndicatorComponent: IndicatorComponentInterface; + +/** + * Defines IndicatorComponent instance. + * + * @constant + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +declare const IndicatorComponentInstance: IndicatorComponentAttribute; diff --git a/tests/arkts-subset/ets/list.d.ts b/tests/arkts-subset/ets/list.d.ts index 356d77c5..c8b91811 100644 --- a/tests/arkts-subset/ets/list.d.ts +++ b/tests/arkts-subset/ets/list.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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 @@ -13,26 +13,2316 @@ * limitations under the License. */ +/** + * @file + * @kit ArkUI + */ + +/** + * Declare scroll status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare scroll status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare scroll status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare scroll status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ScrollState { + /** + * Not activated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Not activated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Not activated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Not activated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Idle, + + /** + * Scrolling status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Scrolling status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Scrolling status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Scrolling status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Scroll, + + /** + * Drag status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Drag status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Drag status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Drag status. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Fling, +} + +/** + * Declare list item alignment status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare list item alignment status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare list item alignment status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum ListItemAlign { + /** + * Start position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Start position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Start position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Start, + + /** + * Center position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Center position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Center position in the direction of cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Center, + + /** + * End position in the direction of cross axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * End position in the direction of cross axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * End position in the direction of cross axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + End, +} + +/** + * Declare list item group area + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum ListItemGroupArea { + /** + * List item group area is none + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NONE = 0, + + /** + * List item group area is list item + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IN_LIST_ITEM_AREA = 1, + + /** + * List item group area is header + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IN_HEADER_AREA = 2, + + /** + * List item group area is footer + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IN_FOOTER_AREA = 3, +} + +/** + * Declare item group sticky style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Declare item group sticky style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare item group sticky style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum StickyStyle { + /** + * The header and footer of each item group will not be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The header and footer of each item group will not be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The header and footer of each item group will not be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None = 0, + + /** + * The header of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The header of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The header of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Header = 1, + + /** + * The footer of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The footer of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The footer of each item group will be pinned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Footer = 2, +} + +/** + * Declare edge effect of chain animation. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare enum ChainEdgeEffect { + /** + * Default edge effect. Compress the space in the drag direction + * and stretch the space in the opposite drag direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + DEFAULT, + + /** + * Stretch all space. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + STRETCH, +} + +/** + * Declare limited position when scroll end. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Declare limited position when scroll end. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ScrollSnapAlign { + /** + * Default no item scroll snap alignment effect. When scroll end, + * list item will stop without limit. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Default no item scroll snap alignment effect. When scroll end, + * list item will stop without limit. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NONE, + + /** + * The first item in view will be aligned at the start of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The first item in view will be aligned at the start of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + START, + + /** + * The middle item in view will be aligned at the center of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The middle item in view will be aligned at the center of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CENTER, + + /** + * The last item in view will be aligned at the end of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The last item in view will be aligned at the end of list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + END, +} + +/** + * Defines the chain animation options. + * + * @interface ChainAnimationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ +declare interface ChainAnimationOptions { + /** + * Minimum space for chain animation. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + minSpace: Length; + + /** + * Maximum space for chain animation. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + maxSpace: Length; + + /** + * Conductivity of chain animation. + * + * @type { ?number } + * @default 0.7 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + conductivity?: number; + + /** + * Intensity of chain animation. + * + * @type { ?number } + * @default 0.3 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + intensity?: number; + + /** + * Edge effect of chain animation. + * + * @type { ?ChainEdgeEffect } + * @default ChainEdgeEffect.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + edgeEffect?: ChainEdgeEffect; + + /** + * Stiffness of chain spring. + * + * @type { ?number } + * @default 228 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + stiffness?: number; + + /** + * Damping of chain spring. + * + * @type { ?number } + * @default 30 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + damping?: number; +} + +/** + * Defines the close swipe action options. + * + * @interface CloseSwipeActionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the close swipe action options. + * + * @interface CloseSwipeActionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CloseSwipeActionOptions { + /** + * Called after collapse animation completed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called after collapse animation completed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onFinish?: ()=>void +} + +/** + * Defines the visible list content info. + * + * @interface VisibleListContentInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ declare interface VisibleListContentInfo { - index: number - itemIndexInGroup?: number + /** + * Index number of a child in the list. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: number + + /** + * Area of the ListItemGroup. + * + * @type { ?ListItemGroupArea } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + itemGroupArea?: ListItemGroupArea + + /** + * Index number of a ListItem in ListItemGroup. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + itemIndexInGroup?: number } +/** + * Callback of scroll visible content, using in onScrollVisibleContentChange. + * + * @typedef {function} OnScrollVisibleContentChangeCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ declare type OnScrollVisibleContentChangeCallback = (start: VisibleListContentInfo, end: VisibleListContentInfo) => void; -declare type Optional = T | undefined -declare interface ListInterface { - (): ListAttribute +/** + * @extends Scroller + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * @extends Scroller + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ListScroller extends Scroller { + /** + * Gets the size and position of a ListItem in a ListItemGroup. + * + * @param { number } index - Index of the ListItemGroup in List. + * @param { number } indexInGroup - Index of the ListItem in ListItemGroup. + * @returns { RectResult } Returns the size and position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Gets the size and position of a ListItem in a ListItemGroup. + * + * @param { number } index - Index of the ListItemGroup in List. + * @param { number } indexInGroup - Index of the ListItem in ListItemGroup. + * @returns { RectResult } Returns the size and position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getItemRectInGroup(index: number, indexInGroup: number): RectResult; + + /** + * Called when sliding to the specified index in specified ListItemGroup. + * + * @param { number } index - Index of the ListItemGroup in List. + * @param { number } indexInGroup - Index of the ListItem in ListItemGroup. + * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } align - Sets the alignment mode of a specified index. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when sliding to the specified index in specified ListItemGroup. + * + * @param { number } index - Index of the ListItemGroup in List. + * @param { number } indexInGroup - Index of the ListItem in ListItemGroup. + * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } align - Sets the alignment mode of a specified index. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scrollToItemInGroup(index: number, indexInGroup:number, smooth?: boolean, align?: ScrollAlign): void; + + /** + * Collapse all listItem. + * + * @param { CloseSwipeActionOptions } options - Options of close Swipe items. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Collapse all listItem. + * + * @param { CloseSwipeActionOptions } options - Options of close Swipe items. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + closeAllSwipeActions(options?: CloseSwipeActionOptions): void; + + /** + * Get visible list content info by position. + * + * @param { number } x - X coordinate relative to the upper left corner of the list's original area, in vp. + * @param { number } y - Y coordinate relative to the upper left corner of the list's original area, in vp. + * @returns { VisibleListContentInfo } Visible list content info of the position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - The controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + getVisibleListContentInfo(x: number, y: number): VisibleListContentInfo; +} + +/** + * Defines List constructor options. + * + * @interface ListOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +interface ListOptions { + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + initialIndex?: number; + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + space?: number | string; + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scroller?: Scroller; +} + +/** + * The list interface is extended. + * + * @interface ListInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The list interface is extended. + * + * @interface ListInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * The list interface is extended. + * + * @interface ListInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * The list interface is extended. + * + * @interface ListInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface ListInterface { + /** + * Called when interface data is called. + * + * @param { object } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when interface data is called. + * + * @param { object } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when interface data is called. + * + * @param { object } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when interface data is called. + * + * @param { object } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when interface data is called. + * + * @param { ListOptions } [options] - list options + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options?: ListOptions): ListAttribute; +} + +/** + * Defines List divider opotions. + * + * @interface ListDividerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface ListDividerOptions { + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeWidth: Length; + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + startMargin?: Length; + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + endMargin?: Length; } +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends ScrollableCommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare class ListAttribute extends ScrollableCommonMethod { - someOptional(param: Optional): ListAttribute + /** + * Called when need to decide how much lanes the list will show. + * + * @param { number | LengthConstrain } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when need to decide how much lanes the list will show. + * + * @param { number | LengthConstrain } value + * @param { Dimension } gutter + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when need to decide how much lanes the list will show. + * + * @param { number | LengthConstrain } value + * @param { Dimension } gutter + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lanes(value: number | LengthConstrain, gutter?: Dimension): ListAttribute; + + /** + * Called when need to decide how to align lanes in the direction of the cross axis. + * + * @param { ListItemAlign } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when need to decide how to align lanes in the direction of the cross axis. + * + * @param { ListItemAlign } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when need to decide how to align lanes in the direction of the cross axis. + * + * @param { ListItemAlign } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignListItem(value: ListItemAlign): ListAttribute; + + /** + * Called when the arrangement direction of the list component is set. + * + * @param { Axis } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the arrangement direction of the list component is set. + * + * @param { Axis } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the arrangement direction of the list component is set. + * + * @param { Axis } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the arrangement direction of the list component is set. + * + * @param { Axis } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + listDirection(value: Axis): ListAttribute; + + /** + * Called when the display mode of the side slider is set. + * + * @param { BarState } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the display mode of the side slider is set. + * + * @param { BarState } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the display mode of the side slider is set. + * + * @param { BarState } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the display mode of the side slider is set. + * + * @param { BarState } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scrollBar(value: BarState): ListAttribute; + + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value + * @param { EdgeEffectOptions } options + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + edgeEffect(value: EdgeEffect, options?: EdgeEffectOptions): ListAttribute; + + /** + * Called when need to decide contentStartOffset the list will show. + * @param { number } value - the value Of startOffset. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when need to decide contentStartOffset the list will show. + * @param { number } value - the value Of startOffset. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentStartOffset(value: number): ListAttribute; + + /** + * Called when need to decide contentEndOffset the list will show. + * @param { number } value - the value Of endOffset. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when need to decide contentEndOffset the list will show. + * @param { number } value - the value Of endOffset. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + contentEndOffset(value: number): ListAttribute; + + /** + * Called when the ListItem split line style is set. + * + * @param { object | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the ListItem split line style is set. + * + * @param { {strokeWidth: Length;color?: ResourceColor;startMargin?: Length;endMargin?: Length;} | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the ListItem split line style is set. + * + * @param { {strokeWidth: Length;color?: ResourceColor;startMargin?: Length;endMargin?: Length;} | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the ListItem split line style is set. + * + * @param { {strokeWidth: Length;color?: ResourceColor;startMargin?: Length;endMargin?: Length;} | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the ListItem split line style is set. + * + * @param { ListDividerOptions | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + divider( + value: ListDividerOptions | null, + ): ListAttribute; + + /** + * Called when judging whether it is in editable mode. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + editMode(value: boolean): ListAttribute; + + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + multiSelectable(value: boolean): ListAttribute; + + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + cachedCount(value: number): ListAttribute; + + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number } count - cached count. + * @param { boolean } show - whether to show the nodes in the cache. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + cachedCount(count: number, show: boolean): ListAttribute; - onScrollVisibleContentChange(handler: OnScrollVisibleContentChangeCallback): ListAttribute; + /** + * Called when setting whether to enable chain linkage dynamic effect. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting whether to enable chain linkage dynamic effect. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when setting whether to enable chain linkage dynamic effect. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting whether to enable chain linkage dynamic effect. + * + * @param { boolean } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + chainAnimation(value: boolean): ListAttribute; - listDirection(value: Axis): ListAttribute; + /** + * Called to setting chain linkage dynamic effect options. + * + * @param { ChainAnimationOptions } value - options of the chain animation. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 10 + */ + chainAnimationOptions(value: ChainAnimationOptions): ListAttribute; - onScrollIndex(event: (start: number, end: number, center: number) => void): ListAttribute; + /** + * Called when header or footer of item group will be pinned. + * + * @param { StickyStyle } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when header or footer of item group will be pinned. + * + * @param { StickyStyle } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when header or footer of item group will be pinned. + * + * @param { StickyStyle } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + sticky(value: StickyStyle): ListAttribute; + + /** + * Called to set list item scroll end alignment effect. + * + * @param { ScrollSnapAlign } value - options of the list alignment effect. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to set list item scroll end alignment effect. + * + * @param { ScrollSnapAlign } value - options of the list alignment effect. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollSnapAlign(value: ScrollSnapAlign): ListAttribute; + + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: NestedScrollOptions): ListAttribute; + + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { ListAttribute } The attribute of the list + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { ListAttribute } The attribute of the list + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableScrollInteraction(value: boolean): ListAttribute; + + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + friction(value: number | Resource): ListAttribute; + + /** + * Set children main size for List. + * + * @param { ChildrenMainSize } value - children main size for List + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + childrenMainSize(value: ChildrenMainSize): ListAttribute; + + /** + * Set maintain visible content position List. + * + * @param { boolean } enabled - maintain visible content position. + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maintainVisibleContentPosition(enabled: boolean): ListAttribute; + + /** + * Called when the offset and status callback of the slide are set. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the offset and status callback of the slide are set. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the offset and status callback of the slide are set. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the offset and status callback of the slide are set. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead common.ScrollableCommonMethod#onDidScroll + */ + onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void): ListAttribute; + + /** + * Called when the start and end positions of the display change. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the start and end positions of the display change. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the start and end positions of the display change. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the start and end positions of the display change. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onScrollIndex(event: (start: number, end: number, center: number) => void): ListAttribute; + + /** + * Called when the list visible content changes. + * + * @param { OnScrollVisibleContentChangeCallback } handler - Callback of Scroll Visible. + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onScrollVisibleContentChange(handler: OnScrollVisibleContentChangeCallback): ListAttribute; + + /** + * Called when the list begins to arrive. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the list begins to arrive. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the list begins to arrive. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the list begins to arrive. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onReachStart(event: () => void): ListAttribute; + + /** + * Called when the list reaches the end. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the list reaches the end. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the list reaches the end. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the list reaches the end. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onReachEnd(event: () => void): ListAttribute; + + /** + * Called when the slider start. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the slider start. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the slider start. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onScrollStart(event: () => void): ListAttribute; + + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onScrollStop(event: () => void): ListAttribute; + + /** + * Called when a list item is deleted. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + onItemDelete(event: (index: number) => boolean): ListAttribute; + + /** + * Called when a list item is moved. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a list item is moved. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when a list item is moved. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemMove(event: (from: number, to: number) => boolean): ListAttribute; + + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragStart(event: (event: ItemDragInfo, itemIndex: number) => ((() => any) | void)): ListAttribute; + + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragEnter(event: (event: ItemDragInfo) => void): ListAttribute; + + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragMove(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number) => void): ListAttribute; + + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragLeave(event: (event: ItemDragInfo, itemIndex: number) => void): ListAttribute; + + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDrop(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void): ListAttribute; + + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onScrollFrameBegin(event: (offset: number, state: ScrollState) => { offsetRemain: number }): ListAttribute; } -declare const List: ListInterface +/** + * Defines List Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines List Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines List Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines List Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const List: ListInterface; + +/** + * Defines List Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines List Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines List Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines List Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const ListInstance: ListAttribute; diff --git a/tests/arkts-subset/ets/list_item.d.ts b/tests/arkts-subset/ets/list_item.d.ts deleted file mode 100644 index 4699ca2f..00000000 --- a/tests/arkts-subset/ets/list_item.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2024 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 enum Sticky { - None, - Normal, - Opacity, -} - -declare enum EditMode { - None, - Deletable, - Movable, -} - - -declare enum SwipeEdgeEffect { - Spring, - None, -} - -declare enum SwipeActionState { - COLLAPSED, - EXPANDED, - ACTIONING, -} - -declare interface SwipeActionItem { - - builder?: CustomBuilder; - - actionAreaDistance?: Length; - - onAction?: () => void; - - onEnterActionArea?: () => void; - - onExitActionArea?: () => void; - - onStateChange?: (state: SwipeActionState) => void; -} - -declare interface SwipeActionOptions { - - start?: CustomBuilder | SwipeActionItem; - - - end?: CustomBuilder | SwipeActionItem; - - - edgeEffect?: SwipeEdgeEffect; - - - onOffsetChange?: (offset: number) => void; -} - -declare enum ListItemStyle { - - NONE = 0, - - CARD = 1, -} - -declare interface ListItemOptions { - style?: ListItemStyle; -} - -interface ListItemInterface { - (value?: ListItemOptions): ListItemAttribute; - (value?: string): ListItemAttribute; -} - -declare class ListItemAttribute extends CommonMethod { - sticky(value: Sticky): ListItemAttribute; - - editable(value: boolean | EditMode): ListItemAttribute; - - selectable(value: boolean): ListItemAttribute; - - selected(value: boolean): ListItemAttribute; - - swipeAction(value: SwipeActionOptions): ListItemAttribute; - - onSelect(event: (isSelected: boolean) => void): ListItemAttribute; -} - -declare const ListItemInstance: ListItemAttribute; - -declare const ListItem: ListItemInterface; - diff --git a/tests/arkts-subset/ets/matrix2d.d.ts b/tests/arkts-subset/ets/matrix2d.d.ts deleted file mode 100644 index f86bad7d..00000000 --- a/tests/arkts-subset/ets/matrix2d.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2024 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 class Matrix2D { - - scaleX?: number; - - rotateY?: number; - - rotateX?: number; - - scaleY?: number; - - translateX?: number; - - translateY?: number; - - identity(): Matrix2D; - - invert(): Matrix2D; - - multiply(other?: Matrix2D): Matrix2D; - - rotate(rx?: number, ry?: number): Matrix2D; - - rotate(degree: number, rx?: number, ry?: number): Matrix2D; - - translate(tx?: number, ty?: number): Matrix2D; - - scale(sx?: number, sy?: number): Matrix2D; - - constructor(); - - constructor(unit: LengthMetricsUnit); -} diff --git a/tests/arkts-subset/ets/path.d.ts b/tests/arkts-subset/ets/path.d.ts new file mode 100644 index 00000000..40bb792e --- /dev/null +++ b/tests/arkts-subset/ets/path.d.ts @@ -0,0 +1,405 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Define options used to construct a path. + * + * @interface PathOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface PathOptions { + /** + * Width option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Width option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Width option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Width option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: number | string; + + /** + * Height option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Height option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Height option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Height option. + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: number | string; + + /** + * Commands option. + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Commands option. + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Commands option. + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Commands option. + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + commands?: string +} + +/** + * Provides the path drawing interface. + * + * @interface PathInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides the path drawing interface. + * + * @interface PathInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides the path drawing interface. + * + * @interface PathInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides the path drawing interface. + * + * @interface PathInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +interface PathInterface { + /** + * Use new to create Path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Use new to create Path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Use new to create Path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Use new to create Path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Use new to create Path. + * + * @param { PathOptions } [options] - path options + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + new (options?: PathOptions): PathAttribute; + + /** + * Called when drawing path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when drawing path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when drawing path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when drawing path. + * + * @param { object } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when drawing path. + * + * @param { PathOptions } [options] - path options + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options?: PathOptions): PathAttribute; +} + +/** + * Provides methods for attribute path component. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides methods for attribute path component. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides methods for attribute path component. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides methods for attribute path component. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class PathAttribute extends CommonShapeMethod { + /** + * Called when the command string drawn by the path is set. + * + * @param { string } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the command string drawn by the path is set. + * + * @param { string } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the command string drawn by the path is set. + * + * @param { string } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the command string drawn by the path is set. + * + * @param { string } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + commands(value: string): PathAttribute; +} + +/** + * Defines Path Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Path Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Path Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Path Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Path: PathInterface; + +/** + * Defines Path Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Path Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Path Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Path Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const PathInstance: PathAttribute; diff --git a/tests/arkts-subset/ets/rect.d.ts b/tests/arkts-subset/ets/rect.d.ts index 805be678..9c5605d7 100644 --- a/tests/arkts-subset/ets/rect.d.ts +++ b/tests/arkts-subset/ets/rect.d.ts @@ -13,48 +13,642 @@ * limitations under the License. */ +/** + * @file + * @kit ArkUI + */ + +/** + * Define options used to construct a rectangle. + * + * @interface RectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface RectOptions { + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: number | string; + + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: number | string; + + /** + * Corner radius of the rectangle. + * + * @type { ?(number | string | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Corner radius of the rectangle. + * + * @type { ?(number | string | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Corner radius of the rectangle. + * + * @type { ?(number | string | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Corner radius of the rectangle. + * + * @type { ?(number | string | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radius?: number | string | Array; +} + +/** + * Define options used to construct a rectangle with rounded corners. + * + * @interface RoundedRectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare interface RoundedRectOptions { + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rectangle width. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: number | string; + + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rectangle height. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: number | string; + + /** + * Width of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Width of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Width of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Width of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radiusWidth?: number | string; + + /** + * Height of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Height of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Height of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Height of the corner radius. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + radiusHeight?: number | string; +} + +/** + * Provides an interface for drawing rectangles. + * + * @interface RectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for drawing rectangles. + * + * @interface RectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides an interface for drawing rectangles. + * + * @interface RectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for drawing rectangles. + * + * @interface RectInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ interface RectInterface { + /** + * Use new function to create Rect. + * + * @param { object } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Use new function to create Rect. + * + * @param { object } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Use new function to create Rect. + * + * @param { object } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Use new function to create Rect. + * + * @param { object } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Use new function to create Rect. + * + * @param { RectOptions | RoundedRectOptions } [options] - Rect options + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ new ( - value?: - { - width?: number | string; - height?: number | string; - radius?: number | string | Array; - } - | { - width?: number | string; - height?: number | string; - radiusWidth?: number | string; - radiusHeight?: number | string; - }, + options?: RectOptions | RoundedRectOptions, ): RectAttribute; + /** + * Called when a rectangle is created. + * + * @param { {width?: number | string;height?: number | string;radius?: number | string | Array;} | + * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a rectangle is created. + * + * @param { {width?: number | string;height?: number | string;radius?: number | string | Array;} | + * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when a rectangle is created. + * + * @param { {width?: number | string;height?: number | string;radius?: number | string | Array;} | + * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when a rectangle is created. + * + * @param { {width?: number | string;height?: number | string;radius?: number | string | Array;} | + * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when a rectangle is created. + * + * @param { RectOptions | RoundedRectOptions } [options] - Rect options + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ ( - value?: - { - width?: number | string; - height?: number | string; - radius?: number | string | Array; - } - | { - width?: number | string; - height?: number | string; - radiusWidth?: number | string; - radiusHeight?: number | string; - }, + options?: RectOptions | RoundedRectOptions, ): RectAttribute; } +/** + * rect attribute declaration. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * rect attribute declaration. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * rect attribute declaration. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * rect attribute declaration. + * + * @extends CommonShapeMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare class RectAttribute extends CommonShapeMethod { + /** + * Called when the fillet width is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the fillet width is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the fillet width is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the fillet width is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ radiusWidth(value: number | string): RectAttribute; + /** + * Called when the fillet height is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the fillet height is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the fillet height is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the fillet height is set. + * + * @param { number | string } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ radiusHeight(value: number | string): RectAttribute; + /** + * Called when the fillet size is set. + * + * @param { number | string | Array } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the fillet size is set. + * + * @param { number | string | Array } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the fillet size is set. + * + * @param { number | string | Array } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the fillet size is set. + * + * @param { number | string | Array } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ radius(value: number | string | Array): RectAttribute; } +/** + * Defines Rect Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Rect Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Rect Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare const Rect: RectInterface; +/** + * Rect attribute. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ declare const RectInStance: RectAttribute; +/** + * Rect attribute. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare const RectInstance: RectAttribute; diff --git a/tests/arkts-subset/ets/rich_editor.d.ts b/tests/arkts-subset/ets/rich_editor.d.ts new file mode 100644 index 00000000..06e10f98 --- /dev/null +++ b/tests/arkts-subset/ets/rich_editor.d.ts @@ -0,0 +1,3937 @@ +/* + * Copyright (c) 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines delete text direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines delete text direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum RichEditorDeleteDirection { + /** + * Delete backward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Delete backward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + BACKWARD, + + /** + * Delete forward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Delete forward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + FORWARD, +} + +/** + * Defines span type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines span type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum RichEditorSpanType { + /** + * Text,corresponding textSpan type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text,corresponding textSpan type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + TEXT = 0, + + /** + * Image,corresponding imageSpan type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Image,corresponding imageSpan type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + IMAGE = 1, + + /** + * Mixed,corresponding mixed span type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Mixed,corresponding mixed span type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + MIXED = 2, + + /** + * Builder,corresponding builderSpan type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BUILDER = 3, +} + +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * ResponseType for contextMenu + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum RichEditorResponseType { + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Right click. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + RIGHT_CLICK = 0, + + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Long press. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LONG_PRESS = 1, + + /** + * Selected by mouse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Selected by mouse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + SELECT = 2, +} + +/** + * Defines the span position. + * + * @interface RichEditorSpanPosition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the span position. + * + * @interface RichEditorSpanPosition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorSpanPosition { + /** + * Define the index of span. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the index of span. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanIndex: number; + + /** + * The range of span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The range of span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanRange: [number, number]; +} + +/** + * Defines the span text style. + * + * @interface RichEditorTextStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the span text style. + * + * @interface RichEditorTextStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorTextStyle { + /** + * font color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor?: ResourceColor; + + /** + * font size. + * + * @type { ?(Length | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font size. + * + * @type { ?(Length | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontSize?: Length | number; + + /** + * font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontStyle?: FontStyle; + + /** + * font weight. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font weight. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontWeight?: number | FontWeight | string; + + /** + * font family. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font family. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontFamily?: ResourceStr; + + /** + * font decoration. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font decoration. + * + * @type { ?object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Font decoration. + * + * @type { ?DecorationStyleInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + decoration?: DecorationStyleInterface; + + /** + * Text shadow + * + * @type { ?(ShadowOptions | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Text shadow + * + * @type { ?(ShadowOptions | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textShadow?: ShadowOptions | Array; + + /** + * letter spacing. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + letterSpacing?: number | string; + + /** + * line height. + * + * @type { ? (number | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineHeight?: number | string | Resource; + + /** + * Set font feature, advanced text styles and effects as designed by the font author. + * The format is the like the CSS font-feature-settings attribute. + * + * @type { ?string } + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * the values of reference to doc of RichEditor component + * number of can be single or multiple, and separated by comma ','. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFeature?: string; +} + + +/** + * Defines the leading margin placeholder of a paragraph. + * + * @interface LeadingMarginPlaceholder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the leading margin placeholder of a paragraph. + * + * @interface LeadingMarginPlaceholder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LeadingMarginPlaceholder { + /** + * Placeholder pixelMap. + * + * @type { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Placeholder pixelMap. + * + * @type { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pixelMap: PixelMap; + + /** + * Placeholder size. + * + * @type { [Dimension, Dimension] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Placeholder size. + * + * @type { [Dimension, Dimension] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + size: [Dimension, Dimension]; +} + +/** + * Defines the paragraph style. + * + * @interface RichEditorParagraphStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the paragraph style. + * + * @interface RichEditorParagraphStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorParagraphStyle { + /** + * Text alignment. + * + * @type { ?TextAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Text alignment. + * + * @type { ?TextAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textAlign?: TextAlign; + + /** + * Leading margin. + * + * @type { ?(Dimension | LeadingMarginPlaceholder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Leading margin. + * + * @type { ?(Dimension | LeadingMarginPlaceholder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + leadingMargin?: Dimension | LeadingMarginPlaceholder; + + /** + * Set word break type. + * + * @type { ?WordBreak } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + wordBreak?: WordBreak; + + /** + * Set line break strategy type. + * + * @type { ?LineBreakStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineBreakStrategy?: LineBreakStrategy; +} + +/** + * Defines the paste event. + * + * @interface PasteEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface PasteEvent { + /** + * Override system paste event. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Override system paste event. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preventDefault?: Callback; +} + +/** + * Defines the text span. + * + * @interface RichEditorTextSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the text span. + * + * @interface RichEditorTextSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorTextSpan { + /** + * The position of the text span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The position of the text span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanPosition: RichEditorSpanPosition; + + /** + * The content of the text span. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The content of the text span. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string; + + /** + * text style. + * + * @type { ?RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * text style. + * + * @type { ?RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle?: RichEditorTextStyle; +} + +/** + * Defines the richEditor Image Layout Style. + * + * @interface RichEditorLayoutStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the richEditor Image Layout Style. + * + * @interface RichEditorLayoutStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface RichEditorLayoutStyle { + /** + * Outer Margin. + * + * @type { ?(Dimension | Margin) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Outer Margin. + * + * @type { ?(Dimension | Margin) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + margin?: Dimension | Margin; + + /** + * Border radius. + * + * @type { ?(Dimension | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Border radius. + * + * @type { ?(Dimension | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderRadius?: Dimension | BorderRadiuses; +} + +/** + * Defines the span image style. + * + * @interface RichEditorImageSpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the span image style. + * + * @interface RichEditorImageSpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorImageSpanStyle { + /** + * image size. + * + * @type { ?[Dimension, Dimension] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image size. + * + * @type { ?[Dimension, Dimension] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size?: [Dimension, Dimension]; + + /** + * image vertical align. + * + * @type { ?ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image vertical align. + * + * @type { ?ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + verticalAlign?: ImageSpanAlignment; + + /** + * image fit. + * + * @type { ?ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image fit. + * + * @type { ?ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + objectFit?: ImageFit; + + /** + * RichEditor ImageSpan Layout Style. + * + * @type { ?RichEditorLayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * RichEditor ImageSpan Layout Style. + * + * @type { ?RichEditorLayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + layoutStyle?: RichEditorLayoutStyle; +} + +/** + * Defines the symbol span style. + * + * @interface RichEditorSymbolSpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the symbol span style. + * + * @interface RichEditorSymbolSpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorSymbolSpanStyle { + /** + * The font size. + * + * @type { ?(number | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font size. + * + * @type { ?(number | string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontSize?: number | string | Resource; + + /** + * The font color. + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font color. + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontColor?: Array; + + /** + * The font weight. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font weight. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontWeight?: number | FontWeight | string; + + /** + * The symbol span effect strategy. + * + * @type { ?SymbolEffectStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The symbol span effect strategy. + * + * @type { ?SymbolEffectStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + effectStrategy?: SymbolEffectStrategy; + + /** + * The symbol span rendering strategy. + * + * @type { ?SymbolRenderingStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The symbol span rendering strategy. + * + * @type { ?SymbolRenderingStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + renderingStrategy?: SymbolRenderingStrategy; +} + +/** + * Defines the text style result. + * + * @interface RichEditorTextStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the text style result. + * + * @interface RichEditorTextStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorTextStyleResult { + /** + * font color. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font color. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor: ResourceColor; + + /** + * font size. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font size. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontSize: number; + + /** + * font style. + * + * @type { FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font style. + * + * @type { FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontStyle: FontStyle; + + /** + * font weight. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font weight. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontWeight: number; + + /** + * font family. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font family. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontFamily: string; + + /** + * font decoration. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * font decoration. + * + * @type { object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Font decoration. + * + * @type { DecorationStyleResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + decoration: DecorationStyleResult; + + /** + * Text shadow + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textShadow?: Array; + + /** + * letter spacing. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + letterSpacing?: number; + + /** + * line height. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineHeight?: number; + + /** + * Set font feature, advanced text styles and effects as designed by the font author. + * The format is the like the CSS font-feature-settings attribute. + * + * @type { ?string } + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * the values of reference to doc of RichEditor component + * number of can be single or multiple, and separated by comma ','. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFeature?: string; +} + +/** + * Defines the paragraph result. + * + * @interface RichEditorParagraphResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the paragraph result. + * + * @interface RichEditorParagraphResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorParagraphResult { + /** + * The paragraph style. + * + * @type { RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The paragraph style. + * + * @type { RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style: RichEditorParagraphStyle; + + /** + * The range of paragraph based on character indices. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The range of paragraph based on character indices. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + range: [number, number]; +} + +/** + * Defines the symbol span style result. + * + * @interface RichEditorSymbolSpanStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the symbol span style result. + * + * @interface RichEditorSymbolSpanStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorSymbolSpanStyleResult { + /** + * The font size. + * + * @type { number | string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font size. + * + * @type { number | string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontSize: number | string | Resource; + + /** + * The font color. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font color. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontColor: Array; + + /** + * The font weight. + * + * @type { number | FontWeight | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The font weight. + * + * @type { number | FontWeight | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontWeight: number | FontWeight | string; + + /** + * The symbol span effect strategy. + * + * @type { SymbolEffectStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The symbol span effect strategy. + * + * @type { SymbolEffectStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + effectStrategy: SymbolEffectStrategy; + + /** + * The symbol span rendering strategy. + * + * @type { SymbolRenderingStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The symbol span rendering strategy. + * + * @type { SymbolRenderingStrategy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + renderingStrategy: SymbolRenderingStrategy; +} + +/** + * Defines the text span result. + * + * @interface RichEditorTextSpanResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the text span result. + * + * @interface RichEditorTextSpanResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorTextSpanResult { + /** + * The position of the text span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The position of the text span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanPosition: RichEditorSpanPosition; + + /** + * The content of the text span. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The content of the text span. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string; + + /** + * text style. + * + * @type { RichEditorTextStyleResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * text style. + * + * @type { RichEditorTextStyleResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle: RichEditorTextStyleResult; + + /** + * get offset in span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * get offset in span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetInSpan: [number, number]; + + /** + * Symbol span style. + * + * @type { ?RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Symbol span style. + * + * @type { ?RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolSpanStyle?: RichEditorSymbolSpanStyle; + + /** + * The resource string of the symbol span. + * + * @type { ?Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The resource string of the symbol span. + * + * @type { ?Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + valueResource?: Resource; + + /** + * The Style of paragraph. + * + * @type { ?RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + paragraphStyle?: RichEditorParagraphStyle; + + /** + * The preview text. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + previewText?: string; +} + +/** + * Defines the span image style result. + * + * @interface RichEditorImageSpanStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the span image style result. + * + * @interface RichEditorImageSpanStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorImageSpanStyleResult { + /** + * image size. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image size. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size: [number, number]; + + /** + * image vertical align. + * + * @type { ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image vertical align. + * + * @type { ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + verticalAlign: ImageSpanAlignment; + + /** + * image fit. + * + * @type { ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image fit. + * + * @type { ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + objectFit: ImageFit; + + /** + * RichEditor ImageSpan Layout Style. + * + * @type { ?RichEditorLayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + layoutStyle?: RichEditorLayoutStyle; +} + +/** + * Defines the image span. + * + * @interface RichEditorImageSpanResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the image span. + * + * @interface RichEditorImageSpanResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorImageSpanResult { + /** + * The position of the image span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The position of the image span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanPosition: RichEditorSpanPosition; + + /** + * The pixel map of the image span. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The pixel map of the image span. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + valuePixelMap?: PixelMap; + + /** + * The resource string of the image span. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The resource string of the image span. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + valueResourceStr?: ResourceStr; + + /** + * image attribute. + * + * @type { RichEditorImageSpanStyleResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image attribute. + * + * @type { RichEditorImageSpanStyleResult } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + imageStyle: RichEditorImageSpanStyleResult; + + /** + * get offset in span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * get offset in span. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetInSpan: [number, number]; +} + +/** + * Defines the image span. + * + * @interface RichEditorImageSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the image span. + * + * @interface RichEditorImageSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorImageSpan { + /** + * The position of the image span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The position of the image span. + * + * @type { RichEditorSpanPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spanPosition: RichEditorSpanPosition; + + /** + * The content of the image span. + * + * @type { PixelMap | ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The content of the image span. + * + * @type { PixelMap | ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: PixelMap | ResourceStr; + + /** + * image style. + * + * @type { ?RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image style. + * + * @type { ?RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + imageStyle?: RichEditorImageSpanStyle; +} + +/** + * Defines range of RichEditor. + * + * @interface RichEditorRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines range of RichEditor. + * + * @interface RichEditorRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorRange { + /** + * start offset. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * start offset. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + start?: number; + + /** + * end offset. + * + * @type { ?number } + * @default text length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * end offset. + * + * @type { ?number } + * @default text length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + end?: number; +} + +/** + * Defines the richEditor Gestures. + * + * @interface RichEditorGesture + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the richEditor Gestures. + * + * @interface RichEditorGesture + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorGesture { + /** + * Trigger a click event when a click is clicked. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Trigger a click event when a click is clicked. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onClick?: Callback; + + /** + * Trigger a gesture event when long press event is complete. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Trigger a gesture event when long press event is complete. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onLongPress?: Callback; +} + +/** + * Defines the span options of RichEditor. + * + * @interface RichEditorTextSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the span options of RichEditor. + * + * @interface RichEditorTextSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorTextSpanOptions { + /** + * the offset that add a text span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * the offset that add a text span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: number; + + /** + * text style. + * + * @type { ?RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * text style. + * + * @type { ?RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style?: RichEditorTextStyle; + + /** + * Paragraph style. + * + * @type { ?RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Paragraph style. + * + * @type { ?RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + paragraphStyle?: RichEditorParagraphStyle; + + /** + * RichEditor gesture. + * + * @type { ?RichEditorGesture } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * RichEditor gesture. + * + * @type { ?RichEditorGesture } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + gesture?: RichEditorGesture; +} + +/** + * Defines the custom keyboard options of RichEditor. + * + * @interface KeyboardOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface KeyboardOptions { + /** + * Indicates whether to support custom keyboard avoidance. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + supportAvoidance?: boolean; +} + +/** + * Defines the image span options of RichEditor. + * + * @interface RichEditorImageSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the image span options of RichEditor. + * + * @interface RichEditorImageSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorImageSpanOptions { + /** + * the offset that add image span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * the offset that add image span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset?: number; + + /** + * image style. + * + * @type { ?RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image style. + * + * @type { ?RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + imageStyle?: RichEditorImageSpanStyle; + + /** + * RichEditor gesture. + * + * @type { ?RichEditorGesture } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * RichEditor gesture. + * + * @type { ?RichEditorGesture } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + gesture?: RichEditorGesture; +} + +/** + * Defines the builder span options of RichEditor. + * + * @interface RichEditorBuilderSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the builder span options of RichEditor. + * + * @interface RichEditorBuilderSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorBuilderSpanOptions { + /** + * The offset that add custom builder span at. + * + * @type { ?number } Indicates the index where the builder will be inserted + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The offset that add custom builder span at. + * + * @type { ?number } Indicates the index where the builder will be inserted + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offset?: number; +} + +/** + * Defines the placeholder style. + * + * @interface PlaceholderStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface PlaceholderStyle { + /** + * font. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + font?: Font; + + /** + * fontColor. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontColor?: ResourceColor; +} + +/** + * Defines span style option of RichEditor. + * + * @interface RichEditorSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines span style option of RichEditor. + * + * @interface RichEditorSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorSpanStyleOptions extends RichEditorRange { } + +/** + * Defines paragraph style option of RichEditor. + * + * @interface RichEditorParagraphStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines paragraph style option of RichEditor. + * + * @interface RichEditorParagraphStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorParagraphStyleOptions extends RichEditorRange { + /** + * Paragraph style. + * + * @type { RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Paragraph style. + * + * @type { RichEditorParagraphStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style: RichEditorParagraphStyle; +} + +/** + * Defines text span style option of RichEditor. + * + * @interface RichEditorUpdateTextSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines text span style option of RichEditor. + * + * @interface RichEditorUpdateTextSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorUpdateTextSpanStyleOptions extends RichEditorSpanStyleOptions { + /** + * text style. + * + * @type { RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * text style. + * + * @type { RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textStyle: RichEditorTextStyle; +} + +/** + * Defines image span style option of RichEditor. + * + * @interface RichEditorUpdateImageSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines image span style option of RichEditor. + * + * @interface RichEditorUpdateImageSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorUpdateImageSpanStyleOptions extends RichEditorSpanStyleOptions { + /** + * image style. + * + * @type { RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * image style. + * + * @type { RichEditorImageSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + imageStyle: RichEditorImageSpanStyle; +} + +/** + * Defines symbol span style option of RichEditor. + * + * @interface RichEditorUpdateSymbolSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines symbol span style option of RichEditor. + * + * @interface RichEditorUpdateSymbolSpanStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorUpdateSymbolSpanStyleOptions extends RichEditorSpanStyleOptions { + /** + * Update the symbol span style. + * + * @type { RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Update the symbol span style. + * + * @type { RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolStyle: RichEditorSymbolSpanStyle; +} + +/** + * Defines the symbol span options of RichEditor. + * + * @interface RichEditorSymbolSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the symbol span options of RichEditor. + * + * @interface RichEditorSymbolSpanOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorSymbolSpanOptions { + /** + * The offset that add custom symbol span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The offset that add custom symbol span at. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offset?: number; + + /** + * The style that add custom symbol span at. + * + * @type { ?RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The style that add custom symbol span at. + * + * @type { ?RichEditorSymbolSpanStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: RichEditorSymbolSpanStyle; +} + +/** + * Defines the text information for editing. + * + * @interface RichEditorSelection + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the text information for editing. + * + * @interface RichEditorSelection + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorSelection { + /** + * The location info. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The location info. + * + * @type { [number, number] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selection: [number, number]; + + /** + * The selected text content. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The selected text content. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + spans: Array; +} + +/** + * Defines the inserted text value info. + * + * @interface RichEditorInsertValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the inserted text value info. + * + * @interface RichEditorInsertValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorInsertValue { + /** + * The location info where the value will be inserted. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The location info where the value will be inserted. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + insertOffset: number; + + /** + * The inserted value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The inserted value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + insertValue: string; + + /** + * The preview text. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + previewText?: string; +} + +/** + * Provides an interface for deleting value from text. + * + * @interface RichEditorDeleteValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Provides an interface for deleting value from text. + * + * @interface RichEditorDeleteValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorDeleteValue { + /** + * The offset of deleting. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The offset of deleting. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offset: number; + + /** + * The deleted direction. + * + * @type { RichEditorDeleteDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The deleted direction. + * + * @type { RichEditorDeleteDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + direction: RichEditorDeleteDirection; + + /** + * The deleted text length. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The deleted text length. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + length: number; + + /** + * The deleted span object. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The deleted span object. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + richEditorDeleteSpans: Array; +} + +/** + * Provides an interface for changes in the text. + * + * @interface RichEditorChangeValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorChangeValue { + /** + * Range of content that will be replaced. + * + * @type { TextRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + rangeBefore: TextRange; + + /** + * Text spans to replace. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacedSpans: Array; + + /** + * Image spans to replace. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacedImageSpans: Array; + + /** + * Symbol spans to replace. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacedSymbolSpans: Array; +} + +/** + * Defines the options of RichEditor. + * + * @interface RichEditorOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the options of RichEditor. + * + * @interface RichEditorOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface RichEditorOptions { + /** + * RichEditor controller. + * + * @type { RichEditorController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * RichEditor controller. + * + * @type { RichEditorController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + controller: RichEditorController; +} + +/** + * Defines the options of RichEditor with StyledString. + * + * @interface RichEditorStyledStringOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RichEditorStyledStringOptions { + /** + * RichEditor controller. + * + * @type { RichEditorStyledStringController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + controller: RichEditorStyledStringController; +} + +/** + * Defines the selection menu options. + * + * @interface SelectionMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the selection menu options. + * + * @interface SelectionMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SelectionMenuOptions { + /** + * Callback function when the selection menu appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when the selection menu appears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Callback function when the selection menu appears. + * + * @type { ?MenuOnAppearCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onAppear?: MenuOnAppearCallback; + + /** + * Callback function when the selection menu disappears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Callback function when the selection menu disappears. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Callback function when the selection menu disappears. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDisappear?: Callback; + + /** + * Menu type, default value is MenuType.SELECTION_MENU. + * + * @type { ?MenuType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + menuType?: MenuType; +} + +/** + * Provides Base Controller for RichEditor. + * + * @implements TextEditControllerEx + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class RichEditorBaseController implements TextEditControllerEx { + /** + * Get caret offset from controller. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get caret offset from controller. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getCaretOffset(): number; + + /** + * Set caret offset. + * + * @param { number } offset - caret offset. + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set caret offset. + * + * @param { number } offset - caret offset. + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + setCaretOffset(offset: number): boolean; + + /** + * close the select menu when menu is on. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * close the select menu when menu is on. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + closeSelectionMenu(): void; + + /** + * Get the typing text style. + * + * @returns { RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get the typing text style. + * + * @returns { RichEditorTextStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getTypingStyle(): RichEditorTextStyle; + + /** + * Set the typing text style. + * + * @param { RichEditorTextStyle } value - set the typing text style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the typing text style. + * + * @param { RichEditorTextStyle } value - set the typing text style. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setTypingStyle(value: RichEditorTextStyle): void; + + /** + * Text selection is achieved by specifying the start and end positions of the rich editor. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Specify the start and end positions to select a range of content. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @param { SelectionOptions } [options] - Indicates the options of selection. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; + + /** + * Judge whether is in editing state + * + * @returns { boolean } - true is editing state, false is non editing status + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isEditing(): boolean; + + /** + * Stop editing state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + stopEditing(): void; + + /** + * Get LayoutManager. + * + * @returns { LayoutManager } - Return the LayoutManager. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getLayoutManager(): LayoutManager; + + /** + * Get PreviewText. + * + * @returns { PreviewText } - Return the PreviewText. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getPreviewText(): PreviewText; +} + +/** + * Provides Controller for RichEditor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Provides Controller for RichEditor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Provides Controller for RichEditor. + * + * @extends RichEditorBaseController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class RichEditorController extends RichEditorBaseController { + /** + * Add a text span. + * + * @param { string } value - text value. + * @param { RichEditorTextSpanOptions } [options] - span info. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Add a text span. + * + * @param { string } value - text value. + * @param { RichEditorTextSpanOptions } [options] - span info. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + addTextSpan(value: string, options?: RichEditorTextSpanOptions): number; + + /** + * Add a image span. + * + * @param { PixelMap | ResourceStr } value - image value. + * @param { RichEditorImageSpanOptions } [options] - image span info. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Add a image span. + * + * @param { PixelMap | ResourceStr } value - image value. + * @param { RichEditorImageSpanOptions } [options] - image span info. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + addImageSpan(value: PixelMap | ResourceStr, options?: RichEditorImageSpanOptions): number; + + /** + * Add a builder span. + * + * @param { CustomBuilder } value - Indicates the custom builder node + * @param { RichEditorBuilderSpanOptions } [options] - span option. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Add a builder span. + * + * @param { CustomBuilder } value - Indicates the custom builder node + * @param { RichEditorBuilderSpanOptions } [options] - span option. + * @returns { number } span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + addBuilderSpan(value: CustomBuilder, options?: RichEditorBuilderSpanOptions): number; + + /** + * Add a symbol span. + * + * @param { Resource } value - symbol span value + * @param { RichEditorSymbolSpanOptions } [options] - symbol span option. + * @returns { number } symbol span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Add a symbol span. + * + * @param { Resource } value - symbol span value + * @param { RichEditorSymbolSpanOptions } [options] - symbol span option. + * @returns { number } symbol span index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + addSymbolSpan(value: Resource, options?: RichEditorSymbolSpanOptions ): number; + + /** + * Modify span style. + * + * @param { RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Modify span style. + * + * @param { RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions | RichEditorUpdateSymbolSpanStyleOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + updateSpanStyle(value: RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions | RichEditorUpdateSymbolSpanStyleOptions): void; + + /** + * Modify span style. + * + * @param { RichEditorParagraphStyleOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Modify span style. + * + * @param { RichEditorParagraphStyleOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + updateParagraphStyle(value: RichEditorParagraphStyleOptions): void; + + /** + * Delete span. + * + * @param { RichEditorRange } [value] - range for deleting. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Delete span. + * + * @param { RichEditorRange } [value] - range for deleting. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + deleteSpans(value?: RichEditorRange): void; + + /** + * Get span content. + * + * @param { RichEditorRange } [value] - range for getting span info. + * @returns { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get span content. + * + * @param { RichEditorRange } [value] - range for getting span info. + * @returns { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getSpans(value?: RichEditorRange): Array; + + /** + * Get span content. + * + * @param { RichEditorRange } [value] - range for getting span info. + * @returns { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get span content. + * + * @param { RichEditorRange } [value] - range for getting span info. + * @returns { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getParagraphs(value?: RichEditorRange): Array; + + /** + * Called when the content is selected. + * + * @returns { RichEditorSelection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the content is selected. + * + * @returns { RichEditorSelection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getSelection(): RichEditorSelection; + + /** + * Convert StyledString to spans in rich editor. + * return a empty Array if convert failed + * + * @param { StyledString } value - StyledString. + * @returns { Array } + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + //fromStyledString(value: StyledString): Array; + + /** + * Convert spans to StyledString in rich editor. + * return a empty StyledString if convert failed + * + * @param { RichEditorRange } value - range of spans in rich editor + * @returns { StyledString } + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + toStyledString(value: RichEditorRange): StyledString; +} + +/** + * Defines the types of spans in rich editor. + * + * @typedef { RichEditorImageSpanResult | RichEditorTextSpanResult } RichEditorSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type RichEditorSpan = RichEditorImageSpanResult | RichEditorTextSpanResult; + +/** + * Provides Controller for RichEditor with StyledString. + * + * @extends RichEditorBaseController + * @implements StyledStringController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class RichEditorStyledStringController extends RichEditorBaseController implements StyledStringController { + /** + * Set the StyledString of the RichEditor. + * + * @param { StyledString } styledString - StyledString. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setStyledString(styledString: StyledString): void; + + /** + * Get the StyledString of the RichEditor. + * + * @returns { MutableStyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + getStyledString(): MutableStyledString; + + /** + * Get the selection in the StyledString of the RichEditor. + * + * @returns { RichEditorRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getSelection(): RichEditorRange; + + /** + * Register content changed listener + * + * @param { StyledStringChangedListener } listener - content changed listener. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onContentChanged(listener: StyledStringChangedListener): void; +} + +/** + * Provides attribute for RichEditor. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Provides attribute for RichEditor. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class RichEditorAttribute extends CommonMethod { + /** + * Called when on ready. + * + * @param { function } callback - The triggered function when rich editor is ready. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when on ready. + * + * @param { function } callback - The triggered function when rich editor is ready. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when on ready. + * + * @param { Callback } callback - The triggered function when rich editor is ready. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onReady(callback: Callback): RichEditorAttribute; + + /** + * Called when the content is selected. + * + * @param { function } callback - The triggered function when select text. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the content is selected. + * + * @param { function } callback - The triggered function when select text. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the content is selected. + * + * @param { Callback } callback - The triggered function when select text. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onSelect(callback: Callback): RichEditorAttribute; + + /** + * Called when selection range or caret position is changed. + * + * @param { Callback } callback - The triggered function when change selection range or caret position. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onSelectionChange(callback: Callback): RichEditorAttribute; + + /** + * Get text value information when about to input. + * + * @param { function } callback - The triggered function when text content is about to insert. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get text value information when about to input. + * + * @param { function } callback - The triggered function when text content is about to insert. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Get text value information when about to input. + * + * @param { Callback } callback - The triggered function when text content is about to insert. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + aboutToIMEInput(callback: Callback): RichEditorAttribute; + + /** + * Get text value information when completed input. + * + * @param { function } callback - The triggered function when text content has been inserted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get text value information when completed input. + * + * @param { function } callback - The triggered function when text content has been inserted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Get text value information when completed input. + * + * @param { Callback } callback - The triggered function when text content has been inserted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onIMEInputComplete(callback: Callback): RichEditorAttribute; + + /** + * Called when ime input complete. + * + * @param { Callback } callback - The triggered function when text content has been inserted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidIMEInput(callback: Callback): RichEditorAttribute; + + /** + * Get text value information when about to delete. + * + * @param { function } callback - The triggered function when text content is about to delete. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Get text value information when about to delete. + * + * @param { function } callback - The triggered function when text content is about to delete. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Get text value information when about to delete. + * + * @param { Callback } callback - The triggered function when text content is about to delete. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + aboutToDelete(callback: Callback): RichEditorAttribute; + + /** + * Notify that the deletion has been completed + * + * @param { function } callback - The triggered function when text content has been deleted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Notify that the deletion has been completed + * + * @param { function } callback - The triggered function when text content has been deleted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Notify that the deletion has been completed + * + * @param { Callback } callback - The triggered function when text content has been deleted. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDeleteComplete(callback: Callback): RichEditorAttribute; + + /** + * Allow replication. + * + * @param { CopyOptions } value - Indicates the type of copy option. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Allow replication. + * + * @param { CopyOptions } value - Indicates the type of copy option. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + copyOptions(value: CopyOptions): RichEditorAttribute; + + /** + * Bind to the selection menu. + * + * @param { RichEditorSpanType } spanType - Indicates the type of selection menu. + * @param { CustomBuilder } content - Indicates the content of selection menu. + * @param { ResponseType } responseType - Indicates response type of selection menu. + * @param { SelectionMenuOptions } [options] - Indicates the options of selection menu. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Bind to the selection menu. + * + * @param { RichEditorSpanType } spanType - Indicates the type of selection menu. + * @param { CustomBuilder } content - Indicates the content of selection menu. + * @param { ResponseType | RichEditorResponseType } responseType - Indicates response type of selection menu. + * @param { SelectionMenuOptions } [options] - Indicates the options of selection menu. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + bindSelectionMenu(spanType: RichEditorSpanType, content: CustomBuilder, responseType: ResponseType | RichEditorResponseType, + options?: SelectionMenuOptions): RichEditorAttribute; + + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value - Set up a custom keyboard of RichEditor + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of RichEditor + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customKeyboard(value: CustomBuilder, options?: KeyboardOptions): RichEditorAttribute; + + /** + * Defines onPaste callback. + * + * @param { function } callback Executed when a paste operation is performed. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Defines onPaste callback. + * + * @param { PasteEventCallback } callback Executed when a paste operation is performed. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onPaste(callback: PasteEventCallback): RichEditorAttribute; + + /** + * Enable data detector. + * + * @param { boolean } enable - Enable data detector. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Enable data detector. + * + * @param { boolean } enable - Enable data detector. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableDataDetector(enable: boolean): RichEditorAttribute; + + /** + * Enable preview text. + * + * @param { boolean } enable - Enable preview text. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enablePreviewText(enable: boolean): RichEditorAttribute; + + /** + * Data detector with config. + * + * @param { TextDataDetectorConfig } config - The config of text data detector. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Data detector with config. + * + * @param { TextDataDetectorConfig } config - The config of text data detector. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dataDetectorConfig(config: TextDataDetectorConfig): RichEditorAttribute; + + /** + * Set richEditor placeholder. + * + * @param { ResourceStr } value - The value of placeholder. + * @param { PlaceholderStyle } [style] - The style of placeholder. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + placeholder(value: ResourceStr, style?: PlaceholderStyle): RichEditorAttribute; + + /** + * Set caret color of rich editor. + * + * @param { ResourceColor } value - Custom color types. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + caretColor(value: ResourceColor): RichEditorAttribute; + + /** + * Set background color of selected text in rich editor. + * + * @param { ResourceColor } value - Custom color types. + * @returns { RichEditorAttribute } The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedBackgroundColor(value: ResourceColor): RichEditorAttribute; + + /** + * Called when edit status is changed + * + * @param { Callback } callback - when edit status is changed + * @returns { RichEditorAttribute } returns The attribute of the rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onEditingChange(callback: Callback): RichEditorAttribute; + + /** + * Set enter key type of soft keyboard. + * + * @param { EnterKeyType } value - the enter key type of soft keyboard + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enterKeyType(value: EnterKeyType): RichEditorAttribute; + + /** + * Called when submitted. + * + * @param { SubmitCallback } callback - callback of the listened event. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onSubmit(callback: SubmitCallback): RichEditorAttribute; + + /** + * Called before text changed. + * + * @param { Callback } callback - The triggered function before text content is about to change. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillChange(callback: Callback) : RichEditorAttribute; + + /** + * Called after text changed. + * + * @param { OnDidChangeCallback } callback - The triggered function after content changed. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidChange(callback: OnDidChangeCallback) : RichEditorAttribute; + + /** + * Called before the cut event. + * + * @param { Callback } callback - Called before the cut event. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onCut(callback: Callback): RichEditorAttribute; + + /** + * Called before the copy event. + * + * @param { Callback } callback - Called before the copy event. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onCopy(callback: Callback): RichEditorAttribute; + + /** + * Set the custom text menu. + * + * @param { EditMenuOptions } editMenu - Customize text menu options. + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + editMenuOptions(editMenu: EditMenuOptions): RichEditorAttribute; + + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } isEnabled - Whether enable request keyboard when on focus. + * @returns { RichEditorAttribute } Returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enableKeyboardOnFocus(isEnabled: boolean): RichEditorAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): RichEditorAttribute; + + /** + * Define bar state of the RichEditor. + * + * @param { BarState } state - bar state. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + barState(state: BarState): RichEditorAttribute; +} + +/** + * the callback of cut event. + * @interface CutEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CutEvent { + /** + * Prevent system cut event. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preventDefault?: Callback; +} + +/** + * the callback of copy event. + * @interface CopyEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CopyEvent { + /** + * Prevent system cut event. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + preventDefault?: Callback; +} + +/** + * callback of the listened enter key event. + * + * @typedef { function } SubmitCallback + * @param { EnterKeyType } enterKey - the enter key type of soft keyboard. + * @param { SubmitEvent } event - Provides the method of keeping RichEditor editable state when submitted. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type SubmitCallback = (enterKey: EnterKeyType, event: SubmitEvent) => void; + +/** + * Callback function when the selection menu appears. + * + * @typedef { function } MenuOnAppearCallback + * @param { number } start - Start offset of the selected content in rich editor. + * @param { number } end - End offset of the selected content in rich editor. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type MenuOnAppearCallback = (start: number, end: number) => void; + +/** + * Callback function when a paste operation is performed. + * + * @typedef { function } PasteEventCallback + * @param { PasteEvent } [event] - The paste event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type PasteEventCallback = (event?: PasteEvent) => void; + +/** + * Provides an interface for writing texts. + * + * @interface RichEditorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Provides an interface for writing texts. + * + * @interface RichEditorInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface RichEditorInterface { + /** + * Called when create RichEditor. + * + * @param { RichEditorOptions } value + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when create RichEditor. + * + * @param { RichEditorOptions } value + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value: RichEditorOptions): RichEditorAttribute; + + /** + * Called when create RichEditor with StyledString. + * + * @param { RichEditorStyledStringOptions} options + * @returns { RichEditorAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + (options: RichEditorStyledStringOptions): RichEditorAttribute; +} + +/** + * Defines RichEditor Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines RichEditor Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const RichEditorInstance: RichEditorAttribute; + +/** + * Defines RichEditor Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines RichEditor Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const RichEditor: RichEditorInterface; diff --git a/tests/arkts-subset/ets/row.d.ts b/tests/arkts-subset/ets/row.d.ts deleted file mode 100644 index 0be57945..00000000 --- a/tests/arkts-subset/ets/row.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2024 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 interface RowOptions { - space?: string | number; -} -interface RowInterface { - (options?: RowOptions): RowAttribute; -} - -declare class RowAttribute extends CommonMethod { - alignItems(value: VerticalAlign): RowAttribute; - justifyContent(value: FlexAlign): RowAttribute; - pointLight(value: PointLightStyle): RowAttribute; - reverse(isReversed: Optional): RowAttribute; -} -declare const Row: RowInterface; -declare const RowInstance: RowAttribute; diff --git a/tests/arkts-subset/ets/scroll.d.ts b/tests/arkts-subset/ets/scroll.d.ts index 31f16bcf..cc1731a2 100644 --- a/tests/arkts-subset/ets/scroll.d.ts +++ b/tests/arkts-subset/ets/scroll.d.ts @@ -13,43 +13,1610 @@ * limitations under the License. */ -declare interface ScrollAnimationOptions { +/** + * @file + * @kit ArkUI + */ + +/** + * Content scroll direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Content scroll direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Content scroll direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ScrollDirection { + /** + * Vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Vertical, + + /** + * Horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Horizontal, + + /** + * Free scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Free, + + /** + * Non-scrollable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Non-scrollable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Non-scrollable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + None, +} + +/** + * ScrollAlign. + * + * @enum { number } ScrollAlign + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * ScrollAlign. + * + * @enum { number } ScrollAlign + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ScrollAlign { + /** + * Start position alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Start position alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + START, + + /** + * Center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CENTER, + + /** + * End position alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * End position alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + END, + + /** + * Scroll the minimum distance to fully display the specified item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Scroll the minimum distance to fully display the specified item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + AUTO, +} + +/** + * OffsetResult info. + * + * @interface OffsetResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface OffsetResult { + /** + * The X-axis offset. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + xOffset: number; + + /** + * The y-axis offset. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + yOffset: number; +} + +/** + * Define scroll edge options + * + * @interface ScrollEdgeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ScrollEdgeOptions { + /** + * The fasten speed of scrolling to the edge, unit is vp/s. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + velocity?: number; +} +/** + * Define scrollToIndex options + * + * @interface ScrollToIndexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ScrollToIndexOptions { + /** + * The extra offset of scrolling to the index, unit is vp. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + extraOffset?: LengthMetrics; +} + +/** + * Provides custom animation parameters. + * + * @interface ScrollAnimationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ScrollAnimationOptions { + /** + * Set the duration of the animation. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ duration?: number; + /** + * Set the curve of the animation. + * + * @type { ?(Curve | ICurve) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ curve?: Curve | ICurve; + /** + * Set whether the animation can over the boundary. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ canOverScroll?: boolean; } -declare class Scroller { +/** + * OffsetOptions info. + * + * @interface OffsetOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface OffsetOptions { + /** + * The X-axis offset. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + xOffset?: Dimension; - constructor(); + /** + * The y-axis offset. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + yOffset?: Dimension; +} - scrollTo(value: { +/** + * Scroller + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Scroller + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Scroller + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class Scroller { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); - xOffset: number | string; + /** + * Called when the setting slides to the specified position. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the setting slides to the specified position. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the setting slides to the specified position. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the setting slides to the specified position. + * + * @param { ScrollOptions } options - scroll options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + scrollTo(options: ScrollOptions); - yOffset: number | string; + /** + * Called when scrolling to the edge of the container. + * + * @param { Edge } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { Edge } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { Edge } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { Edge } value - Edge type of the container. + * @param { ScrollEdgeOptions } [options] - Options of scrolling to edge. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scrollEdge(value: Edge, options?: ScrollEdgeOptions); - animation?: ScrollAnimationOptions | boolean; - }); + /** + * Fling the scroll view. + * + * @param { number } velocity - initial velocity of fling, in vp/s. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fling(velocity: number): void; - scrollPage(value: { next: boolean }); + /** + * Called when page turning mode is set. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when page turning mode is set. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when page turning mode is set. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when page turning mode is set. + * + * @param { ScrollPageOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + scrollPage(value: ScrollPageOptions); + /** + * Called when page turning mode is set. + * + * @param { object } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ scrollPage(value: { next: boolean; direction?: Axis }); + + /** + * Called when viewing the scroll offset. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when viewing the scroll offset. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when viewing the scroll offset. + * + * @returns { OffsetResult } Returns the current scrolling offset. If the scroller not bound to a component, the return value is void. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + currentOffset() : OffsetResult; + + /** + * Called when sliding to the specified index. + * + * @param { number } value + * @param { boolean } smooth + * @param { ScrollAlign } align + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when sliding to the specified index. + * + * @param { number } value - Index to jump to. + * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } align - Sets the alignment mode of a specified index. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when sliding to the specified index. + * + * @param { number } value - Index to jump to. + * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } align - Sets the alignment mode of a specified index. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Scroll to the specified index. + * + * @param { number } value - Index to jump to. + * @param { boolean } [smooth] - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } [align] - Sets the alignment mode of a specified index. + * @param { ScrollToIndexOptions } [options] - Sets the options of a specified index, such as extra offset. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + scrollToIndex(value: number, smooth?: boolean, align?: ScrollAlign, options?: ScrollToIndexOptions); + + /** + * Called when the setting slides by offset. + * + * @param { Length } dx + * @param { Length } dy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the setting slides by offset. + * + * @param { Length } dx + * @param { Length } dy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the setting slides by offset. + * + * @param { Length } dx + * @param { Length } dy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBy(dx: Length, dy: Length); + + /** + * Indicates whether the component scrolls to the end position. + * + * @returns { boolean } Returns whether the component scrolls to the end position. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Indicates whether the component scrolls to the end position. + * + * @returns { boolean } Returns whether the component scrolls to the end position. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + isAtEnd(): boolean; + + /** + * Get child item size and position. + * + * @param { number } index - Index of the item. + * @returns { RectResult } Returns the size and position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Get child item size and position. + * + * @param { number } index - Index of the item. + * @returns { RectResult } Returns the size and position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getItemRect(index: number): RectResult; + + /** + * Get item index by position. + * + * @param { number } x - X coordinate relative to the upper left corner of the current component's original area, in vp. + * @param { number } y - Y coordinate relative to the upper left corner of the current component's original area, in vp. + * @returns { number } Index of the item. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - The controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + getItemIndex(x: number, y: number): number; +} + +/** + * Define scroll options. + * + * @interface ScrollOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface ScrollOptions { + /** + * The X-axis offset. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The X-axis offset. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + xOffset: number | string; + + /** + * The Y-axis offset. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Y-axis offset. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + yOffset: number | string; + + /** + * Descriptive animation. + * + * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters + * and the boolean type enables default spring animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Descriptive animation. + * + * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters + * and the boolean type enables default spring animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Descriptive animation. + * + * @type { ?( ScrollAnimationOptions | boolean) } The ScrollAnimationOptions type provides custom animation parameters + * and the boolean type enables default spring animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + animation?: ScrollAnimationOptions | boolean; +} + +/** + * Define scroll page options + * @interface ScrollPageOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 14 + */ +declare interface ScrollPageOptions { + /** + * Control whether to scroll to the next page or the previous page. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + next: boolean; + + /** + * Set whether the scrollPage have animate. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + animation?: boolean; +} + +/** + * Define scroll snap options + * + * @interface ScrollSnapOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Define scroll snap options + * + * @interface ScrollSnapOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface ScrollSnapOptions { + /** + * Set scroll snap alignment. + * + * @type { ScrollSnapAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set scroll snap alignment. + * + * @type { ScrollSnapAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + snapAlign: ScrollSnapAlign; + + /** + * Set snap positions. When the type of snapPositions is Dimension, Scroll content is paginated by an integer + * multiple of snapPositions. When the type of snapPositions is Array, Scroll content is paginated based + * on the array of snapPositions. + * + * @type { ?(Dimension | Array) } + * @default 100% + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set snap positions. When the type of snapPositions is Dimension, Scroll content is paginated by an integer + * multiple of snapPositions. When the type of snapPositions is Array, Scroll content is paginated based + * on the array of snapPositions. + * + * @type { ?(Dimension | Array) } + * @default 100% + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + snapPagination?: Dimension | Array; + + /** + * Set whether the beginning of the Scroll content counts an a snap. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set whether the beginning of the Scroll content counts an a snap. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + enableSnapToStart?: boolean; + + /** + * Set whether the end of the Scroll content counts an a snap. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set whether the end of the Scroll content counts an a snap. + * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + enableSnapToEnd?: boolean; } +/** + * Provides interfaces for scrollable containers. + * + * @interface ScrollInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides interfaces for scrollable containers. + * + * @interface ScrollInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides interfaces for scrollable containers. + * + * @interface ScrollInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ interface ScrollInterface { + /** + * Called when a scrollable container is set. + * + * @param { Scroller } scroller + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a scrollable container is set. + * + * @param { Scroller } scroller + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when a scrollable container is set. + * + * @param { Scroller } scroller + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ (scroller?: Scroller): ScrollAttribute; } +/** + * Defines a Scroll onScrollEdge callback. + * + * @typedef { function } OnScrollEdgeCallback + * @param { Edge } side - the edge position scrolled to + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnScrollEdgeCallback = (side: Edge) => void; + +/** + * The data returned by the event handler when onScrollFrameBegin. + * + * @interface OnScrollFrameBeginHandlerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface OnScrollFrameBeginHandlerResult { + /** + * Actual sliding amount, unit vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Actual sliding amount, unit vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Actual sliding amount, unit vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetRemain: number; +} + +/** + * Defines a Scroll onScrollFrameBegin callback. + * + * @typedef { function } OnScrollFrameBeginCallback + * @param { number } offset - The upcoming sliding amount, unit vp + * @param { ScrollState } state - current sliding status + * @returns { OnScrollFrameBeginHandlerResult } data - the scroll data return by handler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnScrollFrameBeginCallback = (offset: number, state: ScrollState) => OnScrollFrameBeginHandlerResult; + +/** + * Defines the scroll attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the scroll attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the scroll attribute functions. + * + * @extends ScrollableCommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ declare class ScrollAttribute extends ScrollableCommonMethod { + /** + * Called when the scroll method is slid. + * + * @param { ScrollDirection } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the scroll method is slid. + * + * @param { ScrollDirection } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the scroll method is slid. + * + * @param { ScrollDirection } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollable(value: ScrollDirection): ScrollAttribute; - //onScrollEdge(event: (side: Edge) => void): ScrollAttribute; + /** + * Called when the setting slides to the specified position. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the setting slides to the specified position. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the setting slides to the specified position. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead scroll/Scroll#onWillScroll + * + */ + onScroll(event: (xOffset: number, yOffset: number) => void): ScrollAttribute; + + /** + * Called when the Scroll will scroll. + * + * @param { ScrollOnWillScrollCallback } handler - callback of Scroll + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillScroll(handler: ScrollOnWillScrollCallback): ScrollAttribute; + + /** + * Called when the Scroll did scroll. + * + * @param { ScrollOnScrollCallback } handler - callback of Scroll, + * xOffset and yOffset are offsets this frame did scroll, scrollState is current scroll state. + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidScroll(handler: ScrollOnScrollCallback): ScrollAttribute; + + /** + * Called when scrolling to the edge of the container. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when scrolling to the edge of the container. + * + * @param { OnScrollEdgeCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollEdge(event: OnScrollEdgeCallback): ScrollAttribute; + + /** + * Called when scrolling start. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when scrolling start. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling start. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when scrolling start. + * + * @param { VoidCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollStart(event: VoidCallback): ScrollAttribute; + + /** + * Called when scrolling has stopped. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead scroll/Scroll#onScrollStop + */ + onScrollEnd(event: () => void): ScrollAttribute; + + /** + * Called when scrolling has stopped. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when scrolling has stopped. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling has stopped. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when scrolling has stopped. + * + * @param { VoidCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollStop(event: VoidCallback): ScrollAttribute; + + /** + * Called when the status of the scroll bar is set. + * + * @param { BarState } barState + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the status of the scroll bar is set. + * + * @param { BarState } barState + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the status of the scroll bar is set. + * + * @param { BarState } barState + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ scrollBar(barState: BarState): ScrollAttribute; + + /** + * Called when the color of the scroll bar is set. + * + * @param { Color | number | string } color + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the color of the scroll bar is set. + * + * @param { Color | number | string } color + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the color of the scroll bar is set. + * + * @param { Color | number | string } color + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarColor(color: Color | number | string): ScrollAttribute; + + /** + * Called when the width of the scroll bar is set. + * + * @param { number | string } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the width of the scroll bar is set. + * + * @param { number | string } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the width of the scroll bar is set. + * + * @param { number | string } value + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarWidth(value: number | string): ScrollAttribute; + + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } edgeEffect + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } edgeEffect + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } edgeEffect + * @param { EdgeEffectOptions } options + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + edgeEffect(edgeEffect: EdgeEffect, options?: EdgeEffectOptions): ScrollAttribute; + + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when scrolling begin each frame. + * + * @param { OnScrollFrameBeginCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollFrameBegin(event: OnScrollFrameBeginCallback): ScrollAttribute; + + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: NestedScrollOptions): ScrollAttribute; + + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { ScrollAttribute } The attribute of the scroll + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { ScrollAttribute } The attribute of the scroll + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableScrollInteraction(value: boolean): ScrollAttribute; + + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + friction(value: number | Resource): ScrollAttribute; + + /** + * Called to setting the scroll snap options. + * + * @param { ScrollSnapOptions } value - options for scroll snap. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to setting the scroll snap options. + * + * @param { ScrollSnapOptions } value - options for scroll snap. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + scrollSnap(value: ScrollSnapOptions): ScrollAttribute; + + /** + * Determines whether the scroll view stops on multiples of the content size when the user scrolls. + * + * @param { boolean } value - A boolean value determines whether paging is enabled for scroll. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Determines whether the scroll view stops on multiples of the content size when the user scrolls. + * + * @param { boolean } value - A boolean value determines whether paging is enabled for scroll. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enablePaging(value: boolean): ScrollAttribute; + + /** + * Called to setting the initial offset + * + * @param { OffsetOptions } value - options for scroll initial offset. + * @returns { ScrollAttribute } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + initialOffset(value: OffsetOptions): ScrollAttribute; } +/** + * callback of Scroll, using in onDidScroll. + * + * @typedef { function } ScrollOnScrollCallback + * @param { number } xOffset - horizontal offset this frame did scroll. + * @param { number } yOffset - vertical offset this frame did scroll. + * @param { ScrollState } scrollState - current scroll state. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ScrollOnScrollCallback = (xOffset: number, yOffset: number, scrollState: ScrollState) => void; + +/** + * Called before scroll to allow developer to control real offset the Scroll can scroll. + * + * @typedef { function } ScrollOnWillScrollCallback + * @param { number } xOffset - horizontal offset this frame will scroll, which may or may not be reached. + * @param { number } yOffset - vertical offset this frame will scroll, which may or may not be reached. + * @param { ScrollState } scrollState - current scroll state. + * @param { ScrollSource } scrollSource - source of current scroll. + * @returns { void | OffsetResult } the remain offset for the Scroll, + * same as (xOffset, yOffset) when no OffsetResult is returned. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ScrollOnWillScrollCallback = + (xOffset: number, yOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => void | OffsetResult; + +/** + * Defines Scroll Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Scroll Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Scroll Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ declare const Scroll: ScrollInterface; +/** + * Defines Scroll Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Scroll Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Scroll Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ declare const ScrollInstance: ScrollAttribute; diff --git a/tests/arkts-subset/ets/search.d.ts b/tests/arkts-subset/ets/search.d.ts new file mode 100644 index 00000000..dfdef130 --- /dev/null +++ b/tests/arkts-subset/ets/search.d.ts @@ -0,0 +1,1635 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class SearchController extends TextContentControllerBase { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretPosition(value: number): void; + + /** + * Exit edit state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Exit edit state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stopEditing(): void; + + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @param { SelectionOptions } [options] - Indicates the options of the text selection. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setTextSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; +} + +/** + * Enum for the style of cancel button + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Enum for the style of cancel button + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum CancelButtonStyle { + /** + * The value of button style constant + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of button style constant + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + CONSTANT, + + /** + * The value of button style invisible + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of button style invisible + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + INVISIBLE, + + /** + * The value of button style input + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of button style input + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + INPUT +} + +/** + * Declare the type of search input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Declare the type of search input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum SearchType { + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NORMAL = 0, + + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NUMBER = 2, + + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PHONE_NUMBER = 3, + + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + EMAIL = 5, + + /** + * Number decimal entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NUMBER_DECIMAL = 12, + + /** + * URL entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + URL = 13, +} + +/** + * Options used to construct the search. + * + * @typedef SearchOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface SearchOptions { + /** + * Text input in the search text box. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text input in the search text box. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + value?: string; + + /** + * Text displayed when there is no input. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text displayed when there is no input. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text displayed when there is no input. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + placeholder?: ResourceStr; + + /** + * Path to the search icon. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Path to the search icon. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + icon?: string; + + /** + * Controller of the component. + * + * @type { ?SearchController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Controller of the component. + * + * @type { ?SearchController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + controller?: SearchController; +} + +/** + * The construct function of search + * + * @interface SearchInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The construct function of search + * + * @interface SearchInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The construct function of search + * + * @interface SearchInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface SearchInterface { + /** + * The options of SearchInterface + * + * @param { object } options + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The options of SearchInterface + * + * @param { object } options + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The options of SearchInterface + * + * @param { object } options + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * The options of SearchInterface. + * + * @param { SearchOptions } [options] - Search options. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + (options?: SearchOptions): SearchAttribute; +} + +/** + * Defines the icon options + * + * @interface IconOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the icon options + * + * @interface IconOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface IconOptions { + /** + * Set the icon size + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the icon size + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size?: Length; + + /** + * Set the icon color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the icon color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + + /** + * Set the icon resource + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the icon resource + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + src?: ResourceStr; +} + +/** + * Defines the SearchButton options + * + * @interface SearchButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the SearchButton options + * + * @interface SearchButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface SearchButtonOptions { + /** + * Set the SearchButton fontSize + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the SearchButton fontSize + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontSize?: Length; + + /** + * Set the SearchButton fontColor + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the SearchButton fontColor + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor?: ResourceColor; + + /** + * Automatically disables the search button before the user enters text + * + * @type { ?Boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + autoDisable?: Boolean; +} + +/** + * Defines the CancelButton options + * + * @interface CancelButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface CancelButtonOptions { + /** + * Set the CancelButton style + * + * @type { ?CancelButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: CancelButtonStyle; + + /** + * Set the CancelButton icon + * + * @type { ?IconOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + icon?: IconOptions; +} + +/** + * Defines the CancelButton symbol options + * + * @interface CancelButtonSymbolOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface CancelButtonSymbolOptions { + /** + * Set the CancelButton style + * + * @type { ?CancelButtonStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: CancelButtonStyle; + + /** + * Set the CancelButton symbol icon + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + icon?: SymbolGlyphModifier; +} + +/** + * Declare the event listener callback of the enter key. + * + * @typedef { function } SearchSubmitCallback + * @param { string } searchContent - The submitted content of search. + * @param { SubmitEvent } [event] - Provides the method of keeping Search editable state when submitted. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type SearchSubmitCallback = (searchContent: string, event?: SubmitEvent) => void; + +/** + * The attribute function of search + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The attribute function of search + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The attribute function of search + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class SearchAttribute extends CommonMethod { + /** + * Set the search button text + * + * @param { string } value - indicates the text of the search button. + * @param { SearchButtonOption } option + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the search button text, fontSize and fontColor + * + * @param { string } value - indicates the text of the search button. + * @param { SearchButtonOptions } option - indicates the fontSize and fontColor of the search button. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the search button text, fontSize and fontColor + * + * @param { string } value - indicates the text of the search button. + * @param { SearchButtonOptions } option - indicates the fontSize and fontColor of the search button. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + searchButton(value: string, option?: SearchButtonOptions): SearchAttribute; + + /** + * Set the text Color + * + * @param { ResourceColor } value - indicates the color of the text. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the text Color + * + * @param { ResourceColor } value - indicates the color of the text. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): SearchAttribute; + + /** + * Set the search icon style + * + * @param { IconOptions } value - indicates the style of the search icon. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the search icon style + * + * @param { IconOptions } value - indicates the style of the search icon. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Set the search icon style + * + * @param { IconOptions | SymbolGlyphModifier } value - indicates the style of the search icon. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + searchIcon(value: IconOptions | SymbolGlyphModifier): SearchAttribute; + + /** + * Set the cancel button style + * + * @param { object } value - indicates the style of the cancel button. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the cancel button style + * + * @param { object } value - indicates the style of the cancel button. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Set the cancel button style + * + * @param { CancelButtonOptions | CancelButtonSymbolOptions } value - indicates the style of the cancel button. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cancelButton(value: CancelButtonOptions | CancelButtonSymbolOptions): SearchAttribute; + + /** + * Specify the indentation of the first line in a text-block. + * + * @param { Dimension } value - The length of text indent. + * @returns { SearchAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textIndent(value: Dimension): SearchAttribute; + + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { Callback } error + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + inputFilter(value: ResourceStr, error?: Callback): SearchAttribute; + + /** + * Called when judging whether the text editing change finished. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onEditChange(callback: Callback): SearchAttribute; + + /** + * Define the text selected background color of the text input. + * + * @param { ResourceColor } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedBackgroundColor(value: ResourceColor): SearchAttribute; + + /** + * Set the cursor style + * + * @param { CaretStyle } value - indicates the style of the cursor. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the cursor style + * + * @param { CaretStyle } value - indicates the style of the cursor. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretStyle(value: CaretStyle): SearchAttribute; + + /** + * Set the place hold text color + * + * @param { ResourceColor } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the place hold text color + * + * @param { ResourceColor } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the place hold text color + * + * @param { ResourceColor } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholderColor(value: ResourceColor): SearchAttribute; + + /** + * Set the font used for place holder text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the font used for place holder text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the font used for place holder text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholderFont(value?: Font): SearchAttribute; + + /** + * Set the font used for input text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set the font used for input text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the font used for input text + * + * @param { Font } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textFont(value?: Font): SearchAttribute; + + /** + * Set enter key type of soft keyboard + * + * @param { EnterKeyType } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enterKeyType(value: EnterKeyType): SearchAttribute; + + /** + * Call the function when clicked the search button + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Call the function when clicked the search button + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Call the function when clicked the search button + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Call the function when clicked the search button. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSubmit(callback: Callback): SearchAttribute; + /** + * Call the function when clicked the search button. + * + * @param { SearchSubmitCallback } callback - callback of the listened event. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSubmit(callback: SearchSubmitCallback): SearchAttribute; + + /** + * Call the function when editing the input text + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Call the function when editing the input text + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Call the function when editing the input text + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Call the function when editing the input text + * + * @param { EditableTextOnChangeCallback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onChange(callback: EditableTextOnChangeCallback): SearchAttribute; + + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the text selection changes. + * + * @param { OnTextSelectionChangeCallback } callback - Callback of the listened event. + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onTextSelectionChange(callback: OnTextSelectionChangeCallback): SearchAttribute; + + /** + * Called when the content scrolls. + * + * @param { function } callback - callback of the listened event. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the content scrolls. + * + * @param { function } callback - callback of the listened event. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the content scrolls. + * + * @param { OnContentScrollCallback } callback - Callback of the listened event. + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onContentScroll(callback: OnContentScrollCallback): SearchAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCopy(callback: Callback): SearchAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCut(callback: Callback): SearchAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * Executed when a paste operation is performed. + * { string } value - The text content to be pasted. + * { PasteEvent } event - The user-defined paste event. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { OnPasteCallback } callback - Executed when a paste operation is performed. + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPaste(callback: OnPasteCallback): SearchAttribute; + + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + copyOption(value: CopyOptions): SearchAttribute; + + /** + * Called when the input of maximum text length is set. + * + * @param { number } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * crossplatform + * @since 11 + */ + /** + * Called when the input of maximum text length is set. + * + * @param { number } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * crossplatform + * @atomicservice + * @since 12 + */ + maxLength(value: number): SearchAttribute; + + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textAlign(value: TextAlign): SearchAttribute; + + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } value + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } value + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableKeyboardOnFocus(value: boolean): SearchAttribute; + + /** + * Controls whether the selection menu pops up. + * + * @param { boolean } value + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Controls whether the selection menu pops up. + * + * @param { boolean } value + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectionMenuHidden(value: boolean): SearchAttribute; + + /** + * Called when the minimum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + minFontSize(value: number | string | Resource): SearchAttribute; + + /** + * Called when the maximum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maxFontSize(value: number | string | Resource): SearchAttribute; + + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Define custom keyboard. + * + * @param { CustomBuilder } value - Set up a custom keyboard of Search + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of Search + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customKeyboard(value: CustomBuilder, options?: KeyboardOptions): SearchAttribute; + + /** + * Called when the text decoration of the text is set. + * + * @param { TextDecorationOptions } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + decoration(value: TextDecorationOptions): SearchAttribute; + + /** + * Called when the distance between text fonts is set. + * + * @param { number | string | Resource } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + letterSpacing(value: number | string | Resource): SearchAttribute; + + /** + * Called when the line height of the font is set. + * + * @param { number | string | Resource } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineHeight(value: number | string | Resource): SearchAttribute; + + /** + * Called when the search type is set. + * + * @param { SearchType } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the search type is set. + * + * @param { SearchType } value + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type(value: SearchType): SearchAttribute; + + /** + * Set font feature. + * + * @param { string } value - The fontFeature. + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * the values of reference to doc of search component + * number of can be single or multiple, and separated by comma ','. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFeature(value: string): SearchAttribute; + + /** + * Get text value information when about to input. + * + * @param { Callback } callback - The triggered function when text content is about to insert. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillInsert(callback: Callback): SearchAttribute; + + /** + * Get text value information when completed input. + * + * @param { Callback } callback - The triggered function when text content has been inserted. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidInsert(callback: Callback): SearchAttribute; + + /** + * Get text value information when about to delete. + * + * @param { Callback } callback - The triggered function when text content is about to delete. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDelete(callback: Callback): SearchAttribute; + + /** + * Get text value information when the deletion has been completed + * + * @param { Callback } callback - The triggered function when text content has been deleted. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidDelete(callback: Callback): SearchAttribute; + + /** + * Set the custom text menu. + * + * @param { EditMenuOptions } editMenu - Customize text menu options. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + editMenuOptions(editMenu: EditMenuOptions): SearchAttribute; + + /** + * Define the preview text mode of the text input. + * + * @param { boolean } enable - Indicates the preview text mode. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enablePreviewText(enable: boolean): SearchAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): SearchAttribute; +} + +/** + * Defines Search Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Search Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Search Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Search: SearchInterface; + +/** + * Defines Search Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Search Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Search Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const SearchInstance: SearchAttribute; diff --git a/tests/arkts-subset/ets/security_component.d.ts b/tests/arkts-subset/ets/security_component.d.ts deleted file mode 100644 index e4938b22..00000000 --- a/tests/arkts-subset/ets/security_component.d.ts +++ /dev/null @@ -1,3 +0,0 @@ - -declare class SecurityComponentMethod { -} \ No newline at end of file diff --git a/tests/arkts-subset/ets/shape.d.ts b/tests/arkts-subset/ets/shape.d.ts deleted file mode 100644 index 8978c964..00000000 --- a/tests/arkts-subset/ets/shape.d.ts +++ /dev/null @@ -1,11 +0,0 @@ - -interface ShapeInterface { - (): ShapeAttribute -} - -declare class ShapeAttribute extends CommonMethod { -} - -declare const Shape: ShapeInterface; - -declare const ShapeInstance: ShapeAttribute; diff --git a/tests/arkts-subset/ets/sidebar.d.ts b/tests/arkts-subset/ets/sidebar.d.ts deleted file mode 100644 index dfb258a4..00000000 --- a/tests/arkts-subset/ets/sidebar.d.ts +++ /dev/null @@ -1,12 +0,0 @@ - -interface SideBarContainerInterface { - (): SideBarContainerAttribute -} - -declare class SideBarContainerAttribute extends CommonMethod { - minSideBarWidth(value: number): SideBarContainerAttribute; - minSideBarWidth(value: Length): SideBarContainerAttribute; -} - -declare const SideBarContainer: SideBarContainerInterface; -declare const SideBarContainerInstance: SideBarContainerAttribute; diff --git a/tests/arkts-subset/ets/slider.d.ts b/tests/arkts-subset/ets/slider.d.ts deleted file mode 100644 index 0be72463..00000000 --- a/tests/arkts-subset/ets/slider.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021-2024 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 class SliderAttribute extends CommonMethod { - blockColor(value: ResourceColor): SliderAttribute; - trackColor(value: ResourceColor | LinearGradient): SliderAttribute; - selectedColor(value: ResourceColor): SliderAttribute; - minLabel(value: string): SliderAttribute; - maxLabel(value: string): SliderAttribute; - showSteps(value: boolean): SliderAttribute; - showTips(value: boolean, content?: ResourceStr): SliderAttribute; -} diff --git a/tests/arkts-subset/ets/span.d.ts b/tests/arkts-subset/ets/span.d.ts index c4169fb0..ece02031 100644 --- a/tests/arkts-subset/ets/span.d.ts +++ b/tests/arkts-subset/ets/span.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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 @@ -13,30 +13,676 @@ * limitations under the License. */ +/** + * @file + * @kit ArkUI + */ + +/** + * Define the background style of span. + * + * @interface TextBackgroundStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Define the background style of span. + * + * @interface TextBackgroundStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ declare interface TextBackgroundStyle { - color?: ResourceColor; - radius?: Dimension | BorderRadiuses; - } + /** + * Background color of span. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Background color of span. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * Background radius of span. + * + * @type { ?(Dimension | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Background radius of span. + * + * @type { ?(Dimension | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + radius?: Dimension | BorderRadiuses; +} +/** + * Define the BaseSpan class, contains the common methods of span. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Define the BaseSpan class, contains the common methods of span. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ declare class BaseSpan extends CommonMethod { - textBackgroundStyle(style: TextBackgroundStyle): T; + /** + * Span background style. + * + * @param { TextBackgroundStyle } style - The background style of span. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Span background style. + * + * @param { TextBackgroundStyle } style - The background style of span. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textBackgroundStyle(style: TextBackgroundStyle): T; + + /** + * Base line offset of the Span. + * + * @param { LengthMetrics } value - The base line offset of the Span. + * @returns { T } The attribute of the Span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ baselineOffset(value: LengthMetrics): T; } +/** + * Provide text decoration. + * + * @interface SpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provide text decoration. + * + * @interface SpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provide text decoration. + * + * @interface SpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provide text decoration. + * + * @interface SpanInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ interface SpanInterface { - (value: string | Resource): SpanAttribute; + /** + * Called when text is entered in span. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when text is entered in span. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when text is entered in span. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when text is entered in span. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (value: string | Resource): SpanAttribute; } +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends BaseSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare class SpanAttribute extends BaseSpan { - fontSize(value: number | string | Resource): SpanAttribute; - fontWeight(value: number | FontWeight | string): SpanAttribute; - fontColor(value: ResourceColor): SpanAttribute; - // font(value: Font): SpanAttribute; - // fontStyle(value: FontStyle): SpanAttribute; - // fontFamily(value: string | Resource): SpanAttribute; - // decoration(value: DecorationStyleInterface): SpanAttribute; - // letterSpacing(value: number | string): SpanAttribute; - // textCase(value: TextCase): SpanAttribute; - // lineHeight(value: Length): SpanAttribute; - // textShadow(value: ShadowOptions | Array): SpanAttribute; -} \ No newline at end of file + /** + * Called when the font is set. + * + * @param { Font } value - the span font size and weight and family and style. + * @returns { SpanAttribute } The attribute of the span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the font is set. + * + * @param { Font } value - the span font size and weight and family and style. + * @returns { SpanAttribute } The attribute of the span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + font(value: Font): SpanAttribute; + + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): SpanAttribute; + + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font size is set. + * + * @param { number | string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontSize(value: number | string | Resource): SpanAttribute; + + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): SpanAttribute; + + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): SpanAttribute; + + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the font list of text is set. + * + * @param { string | Resource } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontFamily(value: string | Resource): SpanAttribute; + + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { object } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the text decoration of the text is set. + * + * @param { DecorationStyleInterface } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + decoration(value: DecorationStyleInterface): SpanAttribute; + + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the distance between text fonts is set. + * + * @param { number | string } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + letterSpacing(value: number | string): SpanAttribute; + + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the type of letter in the text font is set. + * + * @param { TextCase } value + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + textCase(value: TextCase): SpanAttribute; + + /** + * Called when the line height of the span is set. + * + * @param { Length } value - The line height of the span. + * @returns { SpanAttribute } The attribute of the span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called when the line height of the span is set. + * + * @param { Length } value - The line height of the span. + * @returns { SpanAttribute } The attribute of the span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + lineHeight(value: Length): SpanAttribute; + + /** + * Called when the text shadow is set. + * + * @param { ShadowOptions | Array } value - The shadow options. + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the text shadow is set. + * + * @param { ShadowOptions | Array } value - The shadow options. + * @returns { SpanAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textShadow(value: ShadowOptions | Array): SpanAttribute; +} + +/** + * Defines Span Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Span Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Span Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Span Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const Span: SpanInterface; + +/** + * Defines Span Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Span Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Span Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Span Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare const SpanInstance: SpanAttribute; diff --git a/tests/arkts-subset/ets/stack.d.ts b/tests/arkts-subset/ets/stack.d.ts deleted file mode 100644 index 896952dd..00000000 --- a/tests/arkts-subset/ets/stack.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2024 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 interface StackOptions { - alignContent?: Alignment; -} - -interface StackInterface { - (options?: StackOptions): StackAttribute; -} - -declare class StackAttribute extends CommonMethod { - alignContent(value: Alignment): StackAttribute; - pointLight(value: PointLightStyle): StackAttribute; -} - -declare const Stack: StackInterface; -declare const StackInstance: StackAttribute; diff --git a/tests/arkts-subset/ets/styled_string.d.ts b/tests/arkts-subset/ets/styled_string.d.ts index 13cb832b..e9c8e0f2 100644 --- a/tests/arkts-subset/ets/styled_string.d.ts +++ b/tests/arkts-subset/ets/styled_string.d.ts @@ -13,90 +13,1660 @@ * limitations under the License. */ -declare enum StyledStringKey { +/** + * @file + * @kit ArkUI + */ - FONT = 0, - DECORATION = 1, - BASELINE_OFFSET = 2, - LETTER_SPACING = 3, - TEXT_SHADOW = 4, - LINE_HEIGHT = 5, - URL = 7, - GESTURE = 100, - PARAGRAPH_STYLE = 200, - IMAGE = 300, - CUSTOM_SPAN = 400, - USER_DATA = 500, +/** + * StyledString + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class StyledString { + /** + * constructor. + * + * @param { string | ImageAttachment | CustomSpan } value - indicates the current object value of the StyledString. + * @param { Array } [styles] - indicates the SpanStyle objects. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: string | ImageAttachment | CustomSpan, styles?: Array); + + /** + * Get the length of the StyledString's characters. + * + * @type { number } - the length of the StyledString's characters. + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly length: number; + + /** + * Get the literal content of the StyledString. + * + * @returns { string } - the literal content of the StyledString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getString(): string; + + /** + * Get the attribute objects of the subStyledString. + * + * @param { number } start - the start position of the subStyledString. + * @param { number } length - the length of the subStyledString's characters. + * @param { StyledStringKey } [styledKey] - the specified type. + * @returns { Array } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getStyles(start: number, length: number, styledKey?: StyledStringKey): Array; + + /** + * Judge if two attribute strings are equal. + * + * @param { StyledString } other - another StyledString. + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + equals(other: StyledString): boolean; + + /** + * Get the substring of the StyledString. + * + * @param { number } start - the start position of the subStyledString. + * @param { number } [length] - the length of the subStyledString's characters. + * @returns { StyledString } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + subStyledString(start: number, length?: number): StyledString; + + /** + * Returns StyledString from the provided HTML string. + * + * @param { string } html - the html text will be converted to a StyledString. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static fromHtml(html: string): Promise; + + /** + * Returns HTML string from the provided StyledString. + * + * @param { StyledString } styledString - the StyledString will be converted to a HTML string. + * @returns { string } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + static toHtml(styledString: StyledString): string; + + /** + * Returns ArrayBuffer from the serialized styled string. + * + * @param { StyledString } styledString - StyledString parameter. + * @returns { ArrayBuffer } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + static marshalling(styledString: StyledString): ArrayBuffer; + + /** + * Returns StyledString from the deserialized ArrayBuffer. + * + * @param { ArrayBuffer } buffer - The buffer will be deserialized to a StyledString. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + static unmarshalling(buffer: ArrayBuffer): Promise; +} + +/** + * StyleOptions + * + * @interface StyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface StyleOptions { + /** + * The start position of the StyleOptions. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start?: number; + + /** + * The length of the modifiedStyledString's characters. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + length?: number; + + /** + * The attribute key of the StyleOptions. + * + * @type { StyledStringKey } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + styledKey: StyledStringKey; + + /** + * The attribute value of the StyleOptions. + * + * @type { StyledStringValue } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + styledValue: StyledStringValue; +} + +/** + * SpanStyle + * + * @interface SpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SpanStyle { + /** + * The start position of the SpanStyle. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start: number; + + /** + * The length of the modifiedStyledString's characters. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + length: number; + + /** + * The attribute key of the SpanStyle. + * + * @type { StyledStringKey } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + styledKey: StyledStringKey; + + /** + * The attribute value of the SpanStyle. + * + * @type { StyledStringValue } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + styledValue: StyledStringValue; } -declare class TextStyle { +/** + * Defines TextStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +//TODO: Already exists as interface +declare class TextStyle_styled_string { + /** + * constructor. + * + * @param { TextStyleInterface } [value] - font property object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ constructor(value?: TextStyleInterface); + /** + * Get the fontColor of the StyledString. + * + * @type { ?ResourceColor } - the set fontColor of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ readonly fontColor?: ResourceColor; + /** + * Get the fontFamily of the StyledString. + * + * @type { ?string } - the fontFamily of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ readonly fontFamily?: string; + /** + * Get the fontSize of the StyledString. + * If not undefined, the unit is vp. + * + * @type { ?number } - the fontSize of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ readonly fontSize?: number; + /** + * Get the fontWeight of the StyledString. + * + * @type { ?number } - the fontWeight of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ readonly fontWeight?: number; + /** + * Get the fontStyle of the StyledString. + * + * @type { ?FontStyle } - the fontStyle of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ readonly fontStyle?: FontStyle; } +/** + * TextStyleInterface + * + * @interface TextStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ declare interface TextStyleInterface { - + /** + * The fontColor value of the font property object. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ fontColor?: ResourceColor; + /** + * The fontFamily value of the font property object. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ fontFamily?: ResourceStr; + /** + * The fontSize value of the font property object. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ fontSize?: LengthMetrics; + /** + * The fontWeight value of the font property object. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ fontWeight?: number | FontWeight | string; + /** + * The fontStyle value of the font property object. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ fontStyle?: FontStyle; } +/** + * Defines DecorationStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class DecorationStyle { + + /** + * constructor. + * + * @param { DecorationStyleInterface } value - text decoration value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: DecorationStyleInterface); + + /** + * Get the text decoration type of the StyledString. + * + * @type { TextDecorationType } - the decoration type of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly type: TextDecorationType; + + /** + * Get the decorationColor of the StyledString. + * + * @type { ?ResourceColor } - the decorationColor of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly color?: ResourceColor; + + /** + * Get the decorationStyle of the StyledString. + * + * @type { ?TextDecorationStyle } - the decorationStyle of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly style?: TextDecorationStyle; +} + +/** + * DecorationStyleInterface + * + * @interface DecorationStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DecorationStyleInterface { + /** + * The type value of the decoration property object. + * + * @type { TextDecorationType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: TextDecorationType; + + /** + * The color value of the decoration property object. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * The style value of the decoration property object. + * + * @type { ?TextDecorationStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: TextDecorationStyle; +} + +/** + * Defines BaselineOffsetStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class BaselineOffsetStyle { + + /** + * constructor. + * + * @param { LengthMetrics } value - baseline offset value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: LengthMetrics); + + /** + * Get the baselineOffset value of the StyledString. + * The unit is vp. + * + * @type { number } - the baselineOffset value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly baselineOffset: number; +} + +/** + * Defines LetterSpacingStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class LetterSpacingStyle { + + /** + * constructor. + * + * @param { LengthMetrics } value - letter space value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: LengthMetrics); + + /** + * Get the letterSpacing value of the StyledString. + * The unit is vp. + * + * @type { number } - the letterSpacing value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly letterSpacing: number; +} + +/** + * Defines TextShadowStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TextShadowStyle { + + /** + * constructor. + * + * @param { ShadowOptions | Array } value - text shadow value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: ShadowOptions | Array); + + /** + * Get the textShadow value of the StyledString. + * + * @type { Array } - the textShadow value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly textShadow: Array; +} + +/** + * Defines Sets the property string background color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare class BackgroundColorStyle { + + /** + * constructor. + * + * @param { TextBackgroundStyle } textBackgroundStyle - textBackgroundStyle value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + constructor(textBackgroundStyle: TextBackgroundStyle); + + /** + * Get the textBackgroundStyle value of the StyledString. + * + * @type { TextBackgroundStyle } - the textBackgroundStyle value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + readonly textBackgroundStyle: TextBackgroundStyle; +} + +/** + * Defines GestureStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class GestureStyle { + + /** + * constructor. + * + * @param { GestureStyleInterface } [value] - gesture event object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value?: GestureStyleInterface); +} + +/** + * Defines the Gesture Events. + * + * @interface GestureStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface GestureStyleInterface { + /** + * Trigger a click event when a click is clicked. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onClick?: Callback; + + /** + * Trigger a gesture event when long press event is complete. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onLongPress?: Callback; +} + +/** + * Defines ParagraphStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ParagraphStyle { + + /** + * constructor. + * + * @param { ParagraphStyleInterface } [value] - paragraph property object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value?: ParagraphStyleInterface); + + /** + * Get the text alignment of the StyledString. + * + * @type { ?TextAlign } - the text alignment of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly textAlign?: TextAlign; + + /** + * Get the first line indentation of the StyledString. + * The unit is vp. + * + * @type { ?number } - the first line indentation of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly textIndent?: number; + + /** + * Get the maximum number of lines of the StyledString. + * + * @type { ?number } - the maximum number of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly maxLines?: number; + + /** + * Get the overflow mode of the StyledString. + * + * @type { ?TextOverflow } - the overflow mode of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly overflow?: TextOverflow; + + /** + * Get the wordBreak mode of the StyledString. + * + * @type { ?WordBreak } - the wordBreak mode of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly wordBreak?: WordBreak; + + /** + * Get the leading margin of the StyledString. + * + * @type { ?(number | LeadingMarginPlaceholder) } - the leading margin of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly leadingMargin?: number | LeadingMarginPlaceholder; +} + +/** + * ParagraphStyleInterface + * + * @interface ParagraphStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ParagraphStyleInterface { + /** + * Alignment of text. + * + * @type { ?TextAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textAlign?: TextAlign; + + /** + * Set the first line indentation. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textIndent?: LengthMetrics; + + /** + * The maximum number of lines of content. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maxLines?: number; + + /** + * The overflow mode of the content. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + overflow?: TextOverflow; + + /** + * Set word break type. + * + * @type { ?WordBreak } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + wordBreak?: WordBreak; + + /** + * Leading margin. + * + * @type { ?(LengthMetrics | LeadingMarginPlaceholder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + leadingMargin?: LengthMetrics | LeadingMarginPlaceholder; +} + +/** + * Defines LineHeightStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class LineHeightStyle { + + /** + * constructor. + * + * @param { LengthMetrics } lineHeight - line height value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(lineHeight: LengthMetrics); + + /** + * Get the lineHeight value of the StyledString. + * The unit is vp. + * + * @type { number } - the lineHeight value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly lineHeight: number; +} + +/** + * Defines the URLStyle hyperlink that allows setting a URL string. When clicking on the text to + * which the span is attached, the URLStyle will try to open the URL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ declare class UrlStyle { + /** + * Constructor. + * + * @param { string } url - URL value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ constructor(url: string); + /** + * Get the URL value of the StyledString. + * + * @type { string } - the URL value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ readonly url: string; } +/** + * Defines the Span Type. + * + * @typedef { TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | TextShadowStyle | + * GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | CustomSpan | + * UserDataSpan } StyledStringValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ -declare type StyledStringValue = TextStyle | UrlStyle; +/** + * Defines the Span Type. + * + * @typedef { TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | TextShadowStyle | + * GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | UrlStyle | CustomSpan | + * UserDataSpan | BackgroundColorStyle } StyledStringValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type StyledStringValue = TextStyle_styled_string | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | +TextShadowStyle | GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | UrlStyle | CustomSpan | +UserDataSpan | BackgroundColorStyle; -declare class StyledString { +/** + * MutableStyledString + * + * @extends StyledString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class MutableStyledString extends StyledString { + /** + * Replace the string of the specified range. + * + * @param { number } start - the start position of the replacedString. + * @param { number } length - the length of the replacedString's characters. + * @param { string } other - must be unicode string. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replaceString(start: number, length: number, other: string): void; - // constructor(value: string | ImageAttachment | CustomSpan, styles?: Array); + /** + * Insert the string at the specified location. + * + * @param { number } start - the start position of the insertedString. + * @param { string } other - must be unicode string. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + insertString(start: number, other: string): void; - readonly length: number; + /** + * Remove the string of the specified range. + * + * @param { number } start - the start position of the removedString. + * @param { number } length - the length of the removedString's characters. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeString(start: number, length: number): void; - getString(): string; + /** + * Replace the specified range string attribute. + * + * @param { SpanStyle } spanStyle - the SpanStyle Object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replaceStyle(spanStyle: SpanStyle): void; - // getStyles(start: number, length: number, styledKey?: StyledStringKey): Array; + /** + * Add attributes to the specified range string. + * + * @param { SpanStyle } spanStyle - the SpanStyle Object. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setStyle(spanStyle: SpanStyle): void; - equals(other: StyledString): boolean; + /** + * Delete the specified type attributes for the specified range string. + * + * @param { number } start - the start position of the removedAttributeStyledString. + * @param { number } length - the length of the removedAttributeStyledString's characters. + * @param { StyledStringKey } styledKey - the specified attribute type's key. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeStyle(start: number, length: number, styledKey: StyledStringKey): void; - subStyledString(start: number, length?: number): StyledString; + /** + * Delete all attributes for the specified range styledString. + * + * @param { number } start - the start position of the attributeRemovedStyledString's characters. + * @param { number } length - the length of the attributeRemovedStyledString's characters. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeStyles(start: number, length: number): void; - // static fromHtml(html: string): Promise; + /** + * Delete all attributes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + clearStyles(): void; - static marshalling(styledString: StyledString): ArrayBuffer; + /** + * Replace the StyledString of the specified range. + * + * @param { number } start - the start position of the replacedStyledString. + * @param { number } length - the length of the replacedStyledString's characters. + * @param { StyledString } other - new StyledString. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replaceStyledString(start: number, length: number, other: StyledString): void; + + /** + * Insert new StyledString at the specified location. + * + * @param { number } start - the start position of the insertedStyledString. + * @param { StyledString } other - new StyledString. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + insertStyledString(start: number, other: StyledString): void; - // static unmarshalling(buffer: ArrayBuffer): Promise; + /** + * Append new StyledString at the end. + * + * @param { StyledString } other - new StyledString. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + appendStyledString(other: StyledString): void; } -declare interface StyleOptions { - start?: number; +/** + * the attribute type of the StyledString + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum StyledStringKey { + /** + * The key of TextStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FONT = 0, - length?: number; + /** + * The key of DecorationStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DECORATION = 1, - styledKey: StyledStringKey; + /** + * The key of BaselineOffsetStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BASELINE_OFFSET = 2, + + /** + * The key of LetterSpacingStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LETTER_SPACING = 3, + + /** + * The key of TextShadowStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TEXT_SHADOW = 4, - styledValue: StyledStringValue; + /** + * The key of LineHeightStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LINE_HEIGHT = 5, + + /** + * The key of BackgroundColorStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + BACKGROUND_COLOR = 6, + + /** + * The key of UrlStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + URL = 7, + + /** + * The key of GestureStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + GESTURE = 100, + + /** + * The key of ParagraphStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PARAGRAPH_STYLE = 200, + + /** + * The key of ImageAttachment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + IMAGE = 300, + + /** + * The key of CustomSpan. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + CUSTOM_SPAN = 400, + + /** + * The key of UserDataSpan. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + USER_DATA = 500, +} + +/** + * Defines ImageAttachment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class ImageAttachment { + + /** + * constructor. + * + * @param { ImageAttachmentInterface } value - image attachment object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(value: ImageAttachmentInterface); + + /** + * Get the image content of the StyledString. + * + * @type { PixelMap } - the image content of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly value: PixelMap; + + /** + * Get the imageSize of the StyledString. + * + * @type { ?SizeOptions } - the imageSize of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly size?: SizeOptions; + + /** + * Get the ImageSpanAlignment of the StyledString. + * + * @type { ?ImageSpanAlignment } - the ImageSpanAlignment of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly verticalAlign?: ImageSpanAlignment; + + /** + * Get the imageFit of the StyledString. + * + * @type { ?ImageFit } - the imageFit of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly objectFit?: ImageFit; + + /** + * Get the imageAttachmentLayoutStyle of the StyledString. + * + * @type { ?ImageAttachmentLayoutStyle } - the imageAttachmentLayoutStyle of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly layoutStyle?: ImageAttachmentLayoutStyle; } -declare abstract class UserDataSpan { } \ No newline at end of file +/** + * Defines the ImageAttachmentInterface. + * + * @interface ImageAttachmentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ImageAttachmentInterface { + /** + * The content of the ImageAttachment. + * + * @type { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value: PixelMap; + + /** + * Image size. + * + * @type { ?SizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + size?: SizeOptions; + + /** + * Image vertical align. + * + * @type { ?ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + verticalAlign?: ImageSpanAlignment; + + /** + * Image fit. + * + * @type { ?ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + objectFit?: ImageFit; + + /** + * The Image Layout Style. + * + * @type { ?ImageAttachmentLayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + layoutStyle?: ImageAttachmentLayoutStyle; +} + +/** + * Defines the ImageAttachment Layout Style. + * + * @interface ImageAttachmentLayoutStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface ImageAttachmentLayoutStyle { + /** + * Outer Margin. + * + * @type { ?(LengthMetrics | Margin) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + margin?: LengthMetrics | Margin; + + /** + * Inner margin. + * + * @type { ?(LengthMetrics | Padding) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + padding?: LengthMetrics | Padding; + + /** + * Border radius. + * + * @type { ?(LengthMetrics | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + borderRadius?: LengthMetrics | BorderRadiuses; +} + +/** + * Defines the CustomSpanMetrics interface. + * + * @interface CustomSpanMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CustomSpanMetrics { + /** + * CustomSpan Width. + * The unit is vp. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + width: number; + + /** + * CustomSpan Height. + * The unit is vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + height?: number; +} + +/** + * Defines the CustomSpanDrawInfo interface. + * + * @interface CustomSpanDrawInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CustomSpanDrawInfo { + /** + * CustomSpan's offset relative to the parent component. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + x: number; + + /** + * The top position of the line where customSpan is located. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineTop: number; + + /** + * The bottom position of the line where customSpan is located. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineBottom: number; + + /** + * The baseline offset of the line where customSpan is located. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + baseline: number; +} + +/** + * Defines the CustomSpanMeasureInfo interface. + * + * @interface CustomSpanMeasureInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface CustomSpanMeasureInfo { + /** + * Current component's fontSize value. + * The unit is fp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontSize: number; +} + +/** + * Defines CustomSpan. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare abstract class CustomSpan { + /** + * Measure the size of custom span. + * + * @param { CustomSpanMeasureInfo } measureInfo + * @returns { CustomSpanMetrics } - CustomSpan Size + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + abstract onMeasure(measureInfo: CustomSpanMeasureInfo) : CustomSpanMetrics; + + /** + * Draw the custom span. + * + * @param { DrawContext } context + * @param { CustomSpanDrawInfo } drawInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + abstract onDraw(context: DrawContext, drawInfo: CustomSpanDrawInfo): void; + + /** + * Invalidate all components that use the object, which will cause a re-render of all components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + invalidate(): void; +} + +/** + * Defines UserDataSpan. Used to store and obtain user data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare abstract class UserDataSpan {} \ No newline at end of file diff --git a/tests/arkts-subset/ets/swiper.d.ts b/tests/arkts-subset/ets/swiper.d.ts index 3085ba2d..21165719 100644 --- a/tests/arkts-subset/ets/swiper.d.ts +++ b/tests/arkts-subset/ets/swiper.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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 @@ -13,100 +13,2239 @@ * limitations under the License. */ -declare class SwiperController { +/** + * @file + * @kit ArkUI + */ +/** + * Provides methods for switching components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides methods for switching components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides methods for switching components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class SwiperController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ constructor(); + /** + * Called when the next child component is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the next child component is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the next child component is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ showNext(); + /** + * Called when the previous subcomponent is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the previous subcomponent is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the previous subcomponent is displayed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ showPrevious(); + /** + * Controlling Swiper to change to the specified subcomponent. + * + * @param { number } index - the index of item to be redirected. + * @param { boolean } useAnimation - If true, swipe to index item with animation. If false, swipe to index item without animation. + * The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ changeIndex(index: number, useAnimation?: boolean); - finishAnimation(callback?: () => void); + /** + * Called when need to stop the swiper animation. + * + * @param { function } callback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when need to stop the swiper animation. + * + * @param { function } callback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when need to stop the swiper animation. + * + * @param { function } callback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when need to stop the swiper animation. + * + * @param { ?VoidCallback } callback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + finishAnimation(callback?: VoidCallback); } - +/** + * Defines the indicator class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the indicator class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare class Indicator { - + /** + * Set the indicator to the left. + * + * @param { Length } value - the indicator to the left. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator to the left. + * + * @param { Length } value - the indicator to the left. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ left(value: Length): T; + /** + * Set the indicator to the top. + * + * @param { Length } value - the indicator to the top. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator to the top. + * + * @param { Length } value - the indicator to the top. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ top(value: Length): T; + /** + * Set the indicator to the right. + * + * @param { Length } value - the indicator to the right. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator to the right. + * + * @param { Length } value - the indicator to the right. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ right(value: Length): T; + /** + * Set the indicator to the bottom. + * + * @param { Length } value - the indicator to the bottom. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator to the bottom. + * + * @param { Length } value - the indicator to the bottom. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ bottom(value: Length): T; - + + /** + * Set the indicator to the left in LTR + * Set the indicator to the right in RTL + * + * @param { LengthMetrics } value - the indicator to the right in LTR, indicator to the left in RTL + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ start(value: LengthMetrics): T; - end(value: LengthMetrics): T; + /** + * Set the indicator to the left in RTL + * Set the indicator to the right in LTR + * + * @param { LengthMetrics } value - the indicator to the left in RTL, Set the indicator to the right in LTR + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + end(value: LengthMetrics): T; + /** + * DotIndicator class object. + * + * @returns { DotIndicator } + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * DotIndicator class object. + * + * @returns { DotIndicator } + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ static dot(): DotIndicator; -// static digit(): DigitIndicator; + /** + * DigitIndicator class object. + * + * @returns { DigitIndicator } + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * DigitIndicator class object. + * + * @returns { DigitIndicator } + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + static digit(): DigitIndicator; } +/** + * Define DotIndicator, the indicator type is dot. + * + * @extends Indicator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Define DotIndicator, the indicator type is dot. + * + * @extends Indicator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare class DotIndicator extends Indicator { - + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ constructor(); + /** + * Set the indicator item width. + * + * @param { Length } value - the indicator item width. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator item width. + * + * @param { Length } value - the indicator item width. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ itemWidth(value: Length): DotIndicator; + /** + * Set the indicator item height. + * + * @param { Length } value - the indicator item height. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator item height. + * + * @param { Length } value - the indicator item height. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ itemHeight(value: Length): DotIndicator; + /** + * Set the indicator item width when selected. + * + * @param { Length } value - the indicator item width when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator item width when selected. + * + * @param { Length } value - the indicator item width when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedItemWidth(value: Length): DotIndicator; -// -// selectedItemWidth(value: Length): DotIndicator; -// -// selectedItemHeight(value: Length): DotIndicator; -// -// mask(value: boolean): DotIndicator; -// -// color(value: ResourceColor): DotIndicator; -// -// selectedColor(value: ResourceColor): DotIndicator; -// -// maxDisplayCount(maxDisplayCount: number): DotIndicator; + /** + * Set the indicator item height when selected. + * + * @param { Length } value - the indicator item height when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator item height when selected. + * + * @param { Length } value - the indicator item height when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedItemHeight(value: Length): DotIndicator; + + /** + * Setting indicator style mask. + * + * @param { boolean } value - the indicator item mask. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Setting indicator style mask. + * + * @param { boolean } value - the indicator item mask. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + mask(value: boolean): DotIndicator; + + /** + * Set the indicator color. + * + * @param { ResourceColor } value - the indicator item color. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the indicator color. + * + * @param { ResourceColor } value - the indicator item color. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color(value: ResourceColor): DotIndicator; + + /** + * Set the navigation point color. + * + * @param { ResourceColor } value - the indicator item when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the navigation point color. + * + * @param { ResourceColor } value - the indicator item when selected. + * @returns { DotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedColor(value: ResourceColor): DotIndicator; + + /** + * Set the Indicator maxDisplayCount when selected. + * + * @param { number } maxDisplayCount - the indicator item maxDisplayCount when selected. + * @returns { DotIndicator } return the DotIndicator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maxDisplayCount(maxDisplayCount: number): DotIndicator; } -// declare class DigitIndicator extends Indicator { -// -// constructor(); -// -// fontColor(value: ResourceColor): DigitIndicator; -// -// selectedFontColor(value: ResourceColor): DigitIndicator; -// -// digitFont(value: Font): DigitIndicator; -// -// selectedDigitFont(value: Font): DigitIndicator; -// } +/** + * Set Swiper column count adaptation. + * + * @typedef { object } SwiperAutoFill + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ +/** + * Set Swiper column count adaptation. + * + * @typedef { object } SwiperAutoFill + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 11 + */ +/** + * Set Swiper column count adaptation. + * + * @typedef SwiperAutoFill + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 14 + */ +declare interface SwiperAutoFill { + /** + * Set minSize size. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + * @form + */ + /** + * Set minSize size. + * + * @type { VP } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + * @form + */ + minSize: VP; +} -declare class SwiperController { +/** + * Define DigitIndicator, the indicator type is digit. + * + * @extends Indicator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Define DigitIndicator, the indicator type is digit. + * + * @extends Indicator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class DigitIndicator extends Indicator { + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ constructor(); - showNext(); - showPrevious(); - changeIndex(index: number, useAnimation?: boolean); - finishAnimation(callback?: () => void); + + /** + * Set font color of the digital indicator. + * + * @param { ResourceColor } value - the indicator font color. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set font color of the digital indicator. + * + * @param { ResourceColor } value - the indicator font color. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): DigitIndicator; + + /** + * Set font color of the digital indicator when selected. + * + * @param { ResourceColor } value - the indicator font color when selected. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set font color of the digital indicator when selected. + * + * @param { ResourceColor } value - the indicator font color when selected. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedFontColor(value: ResourceColor): DigitIndicator; + + /** + * Set the digital indicator font (just support font size and weight). + * + * @param { Font } value - the indicator font size and weight. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the digital indicator font (just support font size and weight). + * + * @param { Font } value - the indicator font size and weight. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + digitFont(value: Font): DigitIndicator; + + /** + * Set the digital indicator font (just support font size and weight). + * + * @param { Font } value - the indicator font size and weight when selected. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the digital indicator font (just support font size and weight). + * + * @param { Font } value - the indicator font size and weight when selected. + * @returns { DigitIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + selectedDigitFont(value: Font): DigitIndicator; } +/** + * Arrow object. + * + * @interface ArrowStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Arrow object. + * + * @interface ArrowStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface ArrowStyle { + /** + * Is show the arrow background or not. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Is show the arrow background or not. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showBackground?: boolean; + + /** + * When the indicator show, set the arrow position is side of the indicator or in the middle of content area. + * The arrow is displayed on side of the indicator, if the value is false. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * When the indicator show, set the arrow position is side of the indicator or in the middle of content area. + * The arrow is displayed on side of the indicator, if the value is false. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + isSidebarMiddle?: boolean; + + /** + * The arrow background size. + * The size of the arrow is three-quarters of the background size, when the background is displayed. + * + * @type { ?Length } + * @default When isSidebarMiddle is false, the default value is 24vp, Otherwise,the default value is 32vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The arrow background size. + * The size of the arrow is three-quarters of the background size, when the background is displayed. + * + * @type { ?Length } + * @default When isSidebarMiddle is false, the default value is 24vp, Otherwise,the default value is 32vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundSize?: Length; + + /** + * The arrow background background color. + * + * @type { ?ResourceColor } + * @default When isSidebarMiddle is false, the default value is #00000000, Otherwise,the default value is #19182431 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The arrow background background color. + * + * @type { ?ResourceColor } + * @default When isSidebarMiddle is false, the default value is #00000000, Otherwise, the default value is #19182431 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundColor?: ResourceColor; + + /** + * The arrow size. + * The arrow size can be set, when the background is not displayed. + * The size of the arrow is three-quarters of the background size, when the background is displayed. + * + * @type { ?Length } + * @default When isSidebarMiddle is false, the default value is 18vp, Otherwise, the default value is 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The arrow size. + * The arrow size can be set, when the background is not displayed. + * The size of the arrow is three-quarters of the background size, when the background is displayed. + * + * @type { ?Length } + * @default When isSidebarMiddle is false, the default value is 18vp, Otherwise, the default value is 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowSize?: Length; + + /** + * The arrow color. + * + * @type { ?ResourceColor } + * @default #182431 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The arrow color. + * + * @type { ?ResourceColor } + * @default #182431 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrowColor?: ResourceColor; +} + +/** + * Declare the size of the swiper on the spindle. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare the size of the swiper on the spindle. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Declare the size of the swiper on the spindle. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare enum SwiperDisplayMode { + /** + * Carousel map extension. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 7 + * @deprecated since 10 + * @useinstead SwiperDisplayMode#STRETCH + */ + Stretch, + + /** + * The rotation chart is self linear. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 7 + * @deprecated since 10 + * @useinstead SwiperDisplayMode#AUTO_LINEAR + */ + AutoLinear, + + /** + * Carousel map extension. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Carousel map extension. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + STRETCH, + + /** + * The rotation chart is self linear. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The rotation chart is self linear. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead Scroller#scrollTo + */ + AUTO_LINEAR, +} + +/** + * Provides an interface for sliding containers. + * + * @interface SwiperInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides an interface for sliding containers. + * + * @interface SwiperInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides an interface for sliding containers. + * + * @interface SwiperInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ interface SwiperInterface { + /** + * Called when a sliding container is set. + * + * @param { SwiperController } controller + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when a sliding container is set. + * + * @param { SwiperController } controller + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when a sliding container is set. + * + * @param { SwiperController } controller + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ (controller?: SwiperController): SwiperAttribute; } -declare class SwiperAttribute extends CommonMethod { +/** + * Setting indicator style navigation. + * + * @interface IndicatorStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ +declare interface IndicatorStyle { + /** + * Set the indicator to the left. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + left?: Length; - index(value: number): SwiperAttribute; + /** + * Set the indicator to the top. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + top?: Length; + + /** + * Set the indicator to the right. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + right?: Length; + + /** + * Set the indicator to the bottom. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + bottom?: Length; + + /** + * Set the indicator size. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + size?: Length; + + /** + * Setting indicator style mask. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + mask?: boolean; + + /** + * Set the indicator color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + color?: ResourceColor; + + /** + * Set the navigation point color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + selectedColor?: ResourceColor; +} - indicator(value: DotIndicator): SwiperAttribute; -// indicator(value: DotIndicator | DigitIndicator | boolean): SwiperAttribute; +/** + * Provides an interface for swiper animation. + * + * @interface SwiperAnimationEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides an interface for swiper animation. + * + * @interface SwiperAnimationEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SwiperAnimationEvent { + /** + * Offset of the current page to the start position of the swiper main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Offset of the current page to the start position of the swiper main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + currentOffset: number; + + /** + * Offset of the target page to the start position of the swiper main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Offset of the target page to the start position of the swiper main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + targetOffset: number; + + /** + * Start speed of the page-turning animation. The unit is vp/s. + * + * @type { number } + * @default 0.0 vp/s + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Start speed of the page-turning animation. The unit is vp/s. + * + * @type { number } + * @default 0.0 vp/s + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + velocity: number; +} + +/** + * Swiper nested scroll nested mode + + * @enum { number } SwiperNestedScrollMode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare enum SwiperNestedScrollMode { + /** + * Only Self response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SELF_ONLY = 0, + + /** + * Self priority response scrolling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + SELF_FIRST = 1, +} + +/** + * Defines a swiper callback when onAnimationStart. + * + * @typedef { function } OnSwiperAnimationStartCallback + * @param { number } index - The index value of the swiper page that when animation start. + * @param { number } targetIndex - The target index value of the swiper page that when animation start. + * @param { SwiperAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare type OnSwiperAnimationStartCallback = (index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => void; + +/** + * Defines a swiper callback when onAnimationEnd. + * + * @typedef { function } OnSwiperAnimationEndCallback + * @param { number } index - The index value of the swiper page that when animation end. + * @param { SwiperAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +declare type OnSwiperAnimationEndCallback = (index: number, extraInfo: SwiperAnimationEvent) => void; + +/** + * Defines a swiper callback when onGestureSwipe. + * + * @typedef { function } OnSwiperGestureSwipeCallback + * @param { number } index - The index value of the swiper page before gesture swipe. + * @param { SwiperAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnSwiperGestureSwipeCallback = (index: number, extraInfo: SwiperAnimationEvent) => void; +/** + * Defines the swiper attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the swiper attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the swiper attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class SwiperAttribute extends CommonMethod { + /** + * Called when the index value of the displayed subcomponent is set in the container. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the index value of the displayed subcomponent is set in the container. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the index value of the displayed subcomponent is set in the container. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + index(value: number): SwiperAttribute; + + /** + * Called when setting whether the subcomponent plays automatically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting whether the subcomponent plays automatically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting whether the subcomponent plays automatically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ autoPlay(value: boolean): SwiperAttribute; + + /** + * Called when the time interval for automatic playback is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the time interval for automatic playback is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the time interval for automatic playback is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + interval(value: number): SwiperAttribute; + + /** + * Called when you set whether the navigation point indicator is enabled. + * + * @param { boolean } value - show indicator of the swiper indicator. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set indicator is enabled, or set type style. + * + * @param { DotIndicator | DigitIndicator | boolean } value - the style value or show indicator of the swiper indicator. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set indicator is enabled, or set type style. + * + * @param { DotIndicator | DigitIndicator | boolean } value - the style value or show indicator of the swiper indicator. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + indicator(value: DotIndicator | DigitIndicator | boolean): SwiperAttribute; + + /** + * Use indicator component controller. + * + * @param { IndicatorComponentController } controller - indicator component controller. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ + indicator(controller: IndicatorComponentController): SwiperAttribute; + + /** + * Set arrow is enabled, or set the arrow style. + * + * @param { ArrowStyle | boolean } value - arrow is displayed or set the arrow style. + * @param { boolean } isHoverShow - arrow is display when mouse hover in indicator hotspot. + * @returns { SwiperAttribute } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Set arrow is enabled, or set the arrow style. + * + * @param { ArrowStyle | boolean } value - arrow is displayed or set the arrow style. + * @param { boolean } isHoverShow - arrow is display when mouse hover in indicator hotspot. + * @returns { SwiperAttribute } return the component attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + displayArrow(value: ArrowStyle | boolean, isHoverShow?: boolean): SwiperAttribute; + + /** + * Called when setting whether to turn on cyclic sliding. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting whether to turn on cyclic sliding. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting whether to turn on cyclic sliding. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ loop(value: boolean): SwiperAttribute; + + /** + * Called when the animation duration of the switch is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the animation duration of the switch is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the animation duration of the switch is set. + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + duration(value: number): SwiperAttribute; + + /** + * Called when setting whether to slide vertically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting whether to slide vertically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting whether to slide vertically. + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ vertical(value: boolean): SwiperAttribute; - interval(value: number): SwiperAttribute; + + /** + * Sets the space between child components. + * + * @param { number | string } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the space between child components. + * + * @param { number | string } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the space between child components. + * + * @param { number | string } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + itemSpace(value: number | string): SwiperAttribute; + + /** + * Called when setting the size of the swiper container on the spindle. + * + * @param { SwiperDisplayMode } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when setting the size of the swiper container on the spindle. + * + * @param { SwiperDisplayMode } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when setting the size of the swiper container on the spindle. + * + * @param { SwiperDisplayMode } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + displayMode(value: SwiperDisplayMode): SwiperAttribute; + + /** + * Sets the number of child components to be preloaded(cached). + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the number of child components to be preloaded(cached). + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the number of child components to be preloaded(cached). + * + * @param { number } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + cachedCount(value: number): SwiperAttribute; + + /** + * Sets the number of elements to display per page. + * + * @param { number | string } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the number of elements to display per page. + * + * @param { number | string | SwiperAutoFill } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the number of elements to display per page. + * + * If swipeByGroup is set to true: + * 1、All sub-items are grouped from index 0. + * 2、The number of sub-items in each group is the value of displayCount. + * 3、If the number of sub-items in the last group is less than displayCount, placeholder items are added to supplement the number of last group. + * 4、Placeholder items do not display any content and are only used as placeholders. + * 5、When turning pages, turn pages by group. + * + * @param { number | string | SwiperAutoFill } value + * @param { boolean } [swipeByGroup] - if swipe by group. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + displayCount(value: number | string | SwiperAutoFill, swipeByGroup?: boolean): SwiperAttribute; + + /** + * Invoked when setting the sliding effect + * + * @param { EdgeEffect } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Invoked when setting the sliding effect + * + * @param { EdgeEffect } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Invoked when setting the sliding effect + * + * @param { EdgeEffect } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + effectMode(value: EdgeEffect): SwiperAttribute; + + /** + * Sets whether to disable the swipe feature + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets whether to disable the swipe feature + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets whether to disable the swipe feature + * + * @param { boolean } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + disableSwipe(value: boolean): SwiperAttribute; + + /** + * Sets the animation curve + * + * @param { Curve | string } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the animation curve + * Curve is an enumeration type for common curves + * ICurve is a curve object + * + * @param { Curve | string | ICurve } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the animation curve + * Curve is an enumeration type for common curves + * ICurve is a curve object + * + * @param { Curve | string | ICurve } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + curve(value: Curve | string | ICurve): SwiperAttribute; + + /** + * Called when the index value changes. + * + * @param { function } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the index value changes. + * + * @param { function } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the index value changes. + * + * @param { function } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the index value changes. + * + * @param { Callback } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onChange(event: Callback): SwiperAttribute; + + /** + * Setting indicator style navigation. + * + * @param { IndicatorStyle } value + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + */ + indicatorStyle(value?: IndicatorStyle): SwiperAttribute; + + /** + * The previous margin which can be used to expose a small portion of the previous item. + * + * @param { Length } value - The length of previous margin. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The previous margin which can be used to expose a small portion of the previous item. + * + * @param { Length } value - The length of previous margin. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * The previous margin which can be used to expose a small portion of the previous item. + * When the previous item is empty, do not display blank space. + * + * @param { Length } value - The length of previous margin. + * @param { boolean } [ignoreBlank] - Whether to hide(ignore) the previous margin on the first page in non-loop scenarios. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + prevMargin(value: Length, ignoreBlank?: boolean): SwiperAttribute; + + /** + * The next margin which can be used to expose a small portion of the latter item. + * + * @param { Length } value - The length of next margin. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * The next margin which can be used to expose a small portion of the latter item. + * + * @param { Length } value - The length of next margin. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * The next margin which can be used to expose a small portion of the latter item. + * When the next item is empty, do not display blank space. + * + * @param { Length } value - The length of next margin. + * @param { boolean } [ignoreBlank] - Whether to hide(ignore) the next margin on the last page in non-loop scenarios. + * @returns { SwiperAttribute } The attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + nextMargin(value: Length, ignoreBlank?: boolean): SwiperAttribute; + + /** + * Called when the swiper animation start. + * + * @param { function } event - the index value of the swiper page that when animation start. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the swiper animation start. + * + * @param { function } event + * "index": the index value of the swiper page that when animation start. + * "targetIndex": the target index value of the swiper page that when animation start. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the swiper animation start. + * + * @param { function } event + * "index": the index value of the swiper page that when animation start. + * "targetIndex": the target index value of the swiper page that when animation start. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the swiper animation start. + * + * @param { OnSwiperAnimationStartCallback } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onAnimationStart(event: OnSwiperAnimationStartCallback): SwiperAttribute; + + /** + * Called when the swiper animation end. + * + * @param { function } event - the index value of the swiper page that when animation end. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the swiper animation end. + * + * @param { function } event + * "index": the index value of the swiper page that when animation end. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the swiper animation end. + * + * @param { function } event + * "index": the index value of the swiper page that when animation end. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Called when the swiper animation end. + * + * @param { OnSwiperAnimationEndCallback } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onAnimationEnd(event: OnSwiperAnimationEndCallback): SwiperAttribute; + + /** + * Called when the swiper swipe with the gesture. + * + * @param { function } event + * "index": the index value of the swiper page before gesture swipe. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the swiper swipe with the gesture. + * + * @param { function } event + * "index": the index value of the swiper page before gesture swipe. + * "extraInfo": the extra callback info. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the swiper swipe with the gesture. + * + * @param { OnSwiperGestureSwipeCallback } event + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onGestureSwipe(event: OnSwiperGestureSwipeCallback): SwiperAttribute; + + /** + * Called to setting the nested scroll mode. + * + * @param { SwiperNestedScrollMode } value - mode for nested scrolling. + * @returns { SwiperAttribute } the attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: SwiperNestedScrollMode): SwiperAttribute; + + /** + * Custom swiper content transition animation. + * + * @param { SwiperContentAnimatedTransition } transition - custom content transition animation. + * @returns { SwiperAttribute } the attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customContentTransition(transition: SwiperContentAnimatedTransition): SwiperAttribute; + + /** + * Called when the swiper content did scroll. + * + * @param { ContentDidScrollCallback } handler - callback of scroll, + * selectedIndex is the index value of the swiper content selected before animation start. + * index is the index value of the swiper content. + * position is the moving ratio of the swiper content from the start position of the swiper main axis. + * mainAxisLength is the swiper main axis length for calculating position. + * @returns { SwiperAttribute } the attribute of the swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onContentDidScroll(handler: ContentDidScrollCallback): SwiperAttribute; + + /** + * Setting whether the indicator is interactive. + * + * @param { boolean } value - Whether the indicator is interactive. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + indicatorInteractive(value: boolean): SwiperAttribute; +} + +/** + * Defines the swiper content animated transition options. + * + * @interface SwiperContentAnimatedTransition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SwiperContentAnimatedTransition { + /** + * Defines the timeout of custom content transition animation after the page is moved out of the swiper. The unit is ms. + * If SwiperContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. + * + * @type { ?number } + * @default 0 ms + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + timeout?: number; + + /** + * Called when custom content transition animation start. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition: Callback; } +/** + * The proxy of SwiperContentAnimatedTransition. + * + * @interface SwiperContentTransitionProxy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface SwiperContentTransitionProxy { + /** + * the index value of the swiper content selected before animation start. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectedIndex: number; + + /** + * The index value of the swiper content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: number; + + /** + * the moving ratio of the swiper content from the start position of the swiper main axis. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + position: number; + + /** + * the swiper main axis length for calculating position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + mainAxisLength: number; + + /** + * Notifies Swiper page the custom content transition animation is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + finishTransition(): void; +} + +/** + * The callback of onContentDidScroll. + * + * @typedef { Function } ContentDidScrollCallback + * @param { number } selectedIndex - the index value of the swiper content selected before animation start. + * @param { number } index - the index value of the swiper content. + * @param { number } position - the moving ratio of the swiper content from the start position of the swiper main axis. + * @param { number } mainAxisLength - the swiper main axis length for calculating position. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ContentDidScrollCallback = (selectedIndex: number, index: number, position: number, mainAxisLength: number) => void; + +/** + * Defines Swiper Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Swiper Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Swiper Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare const Swiper: SwiperInterface; +/** + * Defines Swiper Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Swiper Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Swiper Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare const SwiperInstance: SwiperAttribute; diff --git a/tests/arkts-subset/ets/symbolglyph.d.ts b/tests/arkts-subset/ets/symbolglyph.d.ts index b536e429..a3aa24c8 100644 --- a/tests/arkts-subset/ets/symbolglyph.d.ts +++ b/tests/arkts-subset/ets/symbolglyph.d.ts @@ -1,12 +1,770 @@ +/* + * Copyright (c) 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. + */ -interface SymbolGlyphInterface { +/** + * @file + * @kit ArkUI + */ +/** + * Provides an interface for SymbolGlyph. + * + * @interface SymbolGlyphInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Provides an interface for SymbolGlyph. + * + * @interface SymbolGlyphInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +interface SymbolGlyphInterface { + /** + * Called when resource is entered in SymbolGlyph. + * + * @param { Resource } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when resource is entered in SymbolGlyph. + * + * @param { Resource } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ (value?: Resource): SymbolGlyphAttribute; } -declare class SymbolGlyphAttribute extends CommonMethod { +/** + * The symbol rendering strategy. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * The symbol rendering strategy. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum SymbolRenderingStrategy { + /** + * The single rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The single rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SINGLE = 0, + + /** + * The multiple color rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The multiple color rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + MULTIPLE_COLOR = 1, + + /** + * The multiple opacity rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The multiple opacity rendering strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + MULTIPLE_OPACITY = 2, +} + +/** + * The symbol effect strategy. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * The symbol effect strategy. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum SymbolEffectStrategy { + /** + * There is no effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * There is no effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + NONE = 0, + + /** + * The scale effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The scale effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + SCALE = 1, + + /** + * The hierarchical effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The hierarchical effect strategy. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + HIERARCHICAL = 2, +} + +/** + * The direction type of symbol effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum EffectDirection { + /** + * The scale down animation of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + DOWN = 0, + /** + * The scale up animation of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + UP = 1, +} + +/** + * Declare scope type of the symbol effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum EffectScope { + /** + * The layered animation of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + LAYER = 0, + /** + * The whole animation of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + WHOLE = 1, +} + +/** + * Declare fill style of symbol + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare enum EffectFillStyle { + /** + * The cumulative fill style of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + CUMULATIVE = 0, + + /** + * The iterative fill style of symbol + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + ITERATIVE = 1, +} + +/** + * Defines SymbolEffect class. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class SymbolEffect { +} + +/** + * Defines ScaleSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class ScaleSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectScope } [scope] - The scope type of symbol effect. + * @param { EffectDirection } [direction] - The direction of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(scope?: EffectScope, direction?: EffectDirection); + + /** + * The scope type of symbol effect + * + * @type { ?EffectScope } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + scope?: EffectScope; + + /** + * The direction of symbol effect + * + * @type { ?EffectDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + direction?: EffectDirection; +} + +/** + * Defines HierarchicalSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class HierarchicalSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectFillStyle } [fillStyle] - The fill style of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(fillStyle?: EffectFillStyle); + + /** + * The fill style of symbol effect + * + * @type { ?EffectFillStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fillStyle?: EffectFillStyle; +} + +/** + * Defines AppearSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class AppearSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectScope } [scope] - The scope type of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(scope?: EffectScope); + + /** + * The scope type of symbol effect + * + * @type { ?EffectScope } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + scope?: EffectScope; +} + +/** + * Defines DisappearSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class DisappearSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectScope } [scope] - The scope type of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(scope?: EffectScope); + + /** + * The scope type of symbol effect + * + * @type { ?EffectScope } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + scope?: EffectScope; +} + +/** + * Defines BounceSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class BounceSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectScope } [scope] - The scope type of symbol effect. + * @param { EffectDirection } [direction] - The direction of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(scope?: EffectScope, direction?: EffectDirection); + + /** + * The scope type of symbol effect + * + * @type { ?EffectScope } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + scope?: EffectScope; + + /** + * The direction of symbol effect + * + * @type { ?EffectDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + direction?: EffectDirection; +} + +/** + * Defines ReplaceSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class ReplaceSymbolEffect extends SymbolEffect { + /** + * constructor. + * + * @param { EffectScope } [scope] - The scope type of symbol effect. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + constructor(scope?: EffectScope); + + /** + * The scope type of symbol effect + * + * @type { ?EffectScope } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + scope?: EffectScope; +} +/** + * Defines PulseSymbolEffect class. + * + * @extends SymbolEffect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class PulseSymbolEffect extends SymbolEffect { +} + +/** + * Provides attribute for SymbolGlyph. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Provides attribute for SymbolGlyph. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare class SymbolGlyphAttribute extends CommonMethod { + /** + * Called when the SymbolGlyph size is set. + * + * @param { number | string | Resource } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the SymbolGlyph size is set. + * + * @param { number | string | Resource } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ fontSize(value: number | string | Resource): SymbolGlyphAttribute; + + /** + * Called when the SymbolGlyph color is set. + * + * @param { Array } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the SymbolGlyph color is set. + * + * @param { Array } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontColor(value: Array): SymbolGlyphAttribute; + + /** + * Called when the font symbolGlyph weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the font symbolGlyph weight is set. + * + * @param { number | FontWeight | string } value + * @returns { SymbolGlyphAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + fontWeight(value: number | FontWeight | string): SymbolGlyphAttribute; + + /** + * Called when the symbolGlyph effect is set. + * + * @param { SymbolEffectStrategy } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the symbolGlyph effect is set. + * + * @param { SymbolEffectStrategy } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + effectStrategy(value: SymbolEffectStrategy): SymbolGlyphAttribute; + + /** + * Called when the symbolGlyph rendering strategy is set. + * + * @param { SymbolRenderingStrategy } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called when the symbolGlyph rendering strategy is set. + * + * @param { SymbolRenderingStrategy } value + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + renderingStrategy(value: SymbolRenderingStrategy): SymbolGlyphAttribute; + + /** + * Define effect options for SymbolGlyph. + * + * @param { SymbolEffect } [symbolEffect] - The symbol effect type + * @param { boolean } [isActive] - The active state of the effect + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + symbolEffect(symbolEffect: SymbolEffect, isActive?: boolean): SymbolGlyphAttribute; + + /** + * Define effect options for SymbolGlyph. + * + * @param { SymbolEffect } [symbolEffect] - The symbol effect type + * @param { number } [triggerValue] - The trigger of the effect + * @returns { SymbolGlyphAttribute } The attribute of the SymbolGlyph. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + symbolEffect(symbolEffect: SymbolEffect, triggerValue?: number): SymbolGlyphAttribute; } +/** + * Defines SymbolGlyph Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines SymbolGlyph Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ declare const SymbolGlyph: SymbolGlyphInterface; + +/** + * Defines SymbolGlyph Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines SymbolGlyph Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare const SymbolGlyphInstance: SymbolGlyphAttribute; diff --git a/tests/arkts-subset/ets/tab_content.d.ts b/tests/arkts-subset/ets/tab_content.d.ts deleted file mode 100644 index 5582259c..00000000 --- a/tests/arkts-subset/ets/tab_content.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2024 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 enum SelectedMode { - - INDICATOR, - BOARD -} - -interface BoardStyle { - - borderRadius?: Length; -} - -interface IndicatorStyle { - - color?: ResourceColor; -} - -declare class TabBarSymbol { - - normal: SymbolGlyphModifier; - - selected?: SymbolGlyphModifier; -} - -declare enum LayoutMode { - AUTO = 0, - VERTICAL = 1, - HORIZONTAL = 2 -} - -declare interface TabBarIconStyle { - - selectedColor?: ResourceColor; - unselectedColor?: ResourceColor; -} - -declare class SubTabBarStyle { - - constructor(content: ResourceStr); - - constructor(content: ResourceStr | ComponentContent); - - static of(content: ResourceStr): SubTabBarStyle; - - static of(content: ResourceStr | ComponentContent): SubTabBarStyle; - - indicator(value: IndicatorStyle): SubTabBarStyle; - - selectedMode(value: SelectedMode): SubTabBarStyle; - - board(value: BoardStyle): SubTabBarStyle; - - labelStyle(value: LabelStyle): SubTabBarStyle; - - padding(value: Padding | Dimension): SubTabBarStyle; - - padding(padding: LocalizedPadding): SubTabBarStyle; - - id(value: string): SubTabBarStyle; -} - -declare class BottomTabBarStyle { - - constructor(icon: ResourceStr | TabBarSymbol, text: ResourceStr); - - static of(icon: ResourceStr | TabBarSymbol, text: ResourceStr): BottomTabBarStyle; - - labelStyle(value: LabelStyle): BottomTabBarStyle; - - padding(value: Padding | Dimension | LocalizedPadding): BottomTabBarStyle; - - layoutMode(value: LayoutMode): BottomTabBarStyle; - - verticalAlign(value: VerticalAlign): BottomTabBarStyle; - - symmetricExtensible(value: boolean): BottomTabBarStyle; - - id(value: string): BottomTabBarStyle; - - iconStyle(style: TabBarIconStyle): BottomTabBarStyle; -} - -declare interface TabContentInterface { - (): TabContentAttribute -} - -declare class TabContentAttribute extends CommonMethod { - - tabBar(value: string | Resource | CustomBuilder | { icon?: string | Resource; text?: string | Resource }): TabContentAttribute; - - tabBar(value: SubTabBarStyle | BottomTabBarStyle): TabContentAttribute; -} - -declare const TabContent: TabContentInterface diff --git a/tests/arkts-subset/ets/test.d.ts b/tests/arkts-subset/ets/test.d.ts deleted file mode 100644 index 8fc712ae..00000000 --- a/tests/arkts-subset/ets/test.d.ts +++ /dev/null @@ -1,294 +0,0 @@ -declare enum EnumDTS { - ELEM_0 = 0, - ELEM_1 = 1, - ELEM_2 = 2, -} - -declare interface BooleanInterfaceDTS { - valBool: boolean -} - -declare interface NumberInterfaceDTS { - valNumber: number -} - -declare interface StringInterfaceDTS { - valString: string -} - -declare interface UnionInterfaceDTS { - - unionProp: number | boolean -} - -declare interface UnionOptionalInterfaceDTS { - - unionProp: string | undefined -} - -declare interface TupleInterfaceDTS { - - tuple: [number, boolean] -} - -declare interface OptionInterfaceDTS { - - tuple: [boolean?, number?] -} - -declare interface ArrayRefNumberInterfaceDTS { - - tuple: Array -} - -declare interface ArrayRefTuplesInterfaceDTS { - - tuple: Array<[boolean, number]> -} - -declare class ClassDTS { - - valBoolean: boolean -} - -// Non materialized class -declare class ClassWithConstructorDTS { - - constructor(valNumber: number, valString: string) -} - -// Non materialized class -declare class ClassWithConstructorAndFieldsDTS { - - valNumber: number - valBoolean: boolean - - constructor(valNumber: number, valBoolean: boolean) -} - -// Materialized class -declare class ClassWithConstructorAndMethodsDTS { - - constructor(valNumber: number, valString: string) - - method(valNumber: number, valString: string): void -} - -// Materialized class -declare class ClassWithConstructorAndStaticMethodsDTS { - - constructor(valNumber: number, valString: string) - - static of(valNumber: number, valString: string): ClassWithConstructorAndStaticMethodsDTS -} - -// Materialized class -declare class ClassWithConstructorAndFieldsAndMethodsDTS { - - valNumber: number - valBoolean: boolean - - constructor(valNumber: number, valBoolean: boolean) - - method(valNumber: number, valString: string): void -} - - -// Materialized class -declare class ClassWithConstructorAndWithoutParamsDTS { - - constructor() - - static of(): ClassWithConstructorAndWithoutParamsDTS - - method(): void -} - -// Materialized class -declare class ClassWithConstructorAndNonOptionalParamsDTS { - - constructor(valNumber: number, valString: string) - - static of(valNumber: number, valString: string): ClassWithConstructorAndNonOptionalParamsDTS - - method(valBoolean: boolean, valString: string): void -} - -// Materialized class -declare class ClassWithConstructorAndSomeOptionalParamsDTS { - - constructor(valNumber: number, valString?: string) - - static of(valNumber: number, valString?: string): ClassWithConstructorAndSomeOptionalParamsDTS - - method(valBoolean: boolean, valString?: string): void -} - -// Materialized class -declare class ClassWithConstructorAndAllOptionalParamsDTS { - - constructor(valNumber?: number, valString?: string) - - static of(valNumber?: number, valString?: string): ClassWithConstructorAndAllOptionalParamsDTS - - method(valBoolean?: boolean, valString?: string): void -} - -declare interface TestInterface { - (): TestAttribute -} -declare const Test: TestInterface - -// basic types: -// - boolean -// - number -// - string, -// - enum -// - function -// -// type | undefined // undefined -// type1 | type2 // union -// type[] // array -// [type1, type2] // tuple -// [type1?, type2?] // tuple optional -// [type1 | type2, (type3 | type 4)?] // tuple union -// Array // ArrayRef type -// Array<[type1, type2]> // ArrayRef tuple -declare class TestAttribute extends CommonMethod { - - // basic types - testBoolean(value: boolean): TestAttribute; - - testNumber(value: number): TestAttribute; - - testString(value: string): TestAttribute; - - testEnum(value: EnumDTS): TestAttribute - - testFunction(value: (a: number) => boolean): TestAttribute; - - testBasicMix(v1: number, v2: string, v3: number): TestAttribute - - // undefined - - testBooleanUndefined(value: boolean | undefined): TestAttribute; - - testNumberUndefined(value: number | undefined): TestAttribute; - - testStringUndefined(value: string | undefined): TestAttribute; - - testEnumUndefined(value: EnumDTS | undefined): TestAttribute; - - testFunctionUndefined(value: (a: number) => boolean | undefined): TestAttribute; - - // union - - testUnionNumberEnum(val: number | EnumDTS): TestAttribute - - testUnionBooleanString(val: boolean | string): TestAttribute - - testUnionStringNumber(val: string | number): TestAttribute - - testUnionBooleanStringNumberUndefined(val: boolean | string | number | undefined): TestAttribute - - testUnionWithGenericArray(value: number | Array): TestAttribute; - - testUnionWithArrayType(value: number | string[]): TestAttribute; - - // array - - testBooleanArray(value: boolean[]): TestAttribute; - - testNumberArray(value: number[]): TestAttribute; - - testStringArray(value: string[]): TestAttribute; - - testEnumArray(value: EnumDTS[]): TestAttribute - - // TBD: array of functions - // testFunctionArray(value: ((a: number) => boolean)[]): TestAttribute; - - testArrayMix(v1: number[], v2: string[], v3: EnumDTS[]): TestAttribute; - - // TBD: array of functions - //testArrayMix(v1: number[], v2: string[], v3: EnumDTS[], v4: ((a: number) => string)[]): TestAttribute; - - // tuple - - testTupleBooleanNumber(value: [boolean, number]): TestAttribute; - - testTupleNumberStringEnum(value: [number, string, EnumDTS]): TestAttribute; - - // tuple optional - - testTupleOptional(value: [number, string, boolean, EnumDTS]): TestAttribute; - - // tuple union - - testTupleUnion(value: [(number | string), (boolean | EnumDTS), (string | EnumDTS | boolean)]): TestAttribute; - - // Array - - testArrayRefBoolean(value: Array): TestAttribute - - testArrayRefNumber(value: Array): TestAttribute - - // testArrayTuple(value: Array<[number, boolean]>): TestAttribute - - // interface - - testBooleanInterface(value: BooleanInterfaceDTS): TestAttribute - - testNumberInterface(value: NumberInterfaceDTS): TestAttribute - - testStringInterface(value: StringInterfaceDTS): TestAttribute - - testUnionInterface(value: UnionInterfaceDTS): TestAttribute - - testUnionOptional(value: UnionOptionalInterfaceDTS): TestAttribute - - testTupleInterface(value: TupleInterfaceDTS): TestAttribute - - testOptionInterface(value: OptionInterfaceDTS): TestAttribute - - testArrayRefNumberInterface(value: ArrayRefNumberInterfaceDTS): TestAttribute - - // testArrayRefTupleInterface(value: ArrayRefTuplesInterfaceDTS) - - - // Boolean Interface - - testBooleanInterfaceOption(value?: BooleanInterfaceDTS): TestAttribute - // leads to es2panda segmentation fault - // testBooleanInterfaceTuple(value: [BooleanInterfaceDTS]): TestAttribute - - testBooleanInterfaceArray(value: BooleanInterfaceDTS[]): TestAttribute - - testBooleanInterfaceArrayRef(value: Array): TestAttribute - - testInterfaceMixed(v1: UnionInterfaceDTS, v2: number, v3: TupleInterfaceDTS): TestAttribute - - // Class - - testClass(value: ClassDTS): TestAttribute - - testClassWithConstructor(value: ClassWithConstructorDTS): TestAttribute - - testClassWithConstructorAndFields(value: ClassWithConstructorAndFieldsDTS): TestAttribute - - // Materialized class - - testClassWithConstructorAndMethods(value: ClassWithConstructorAndMethodsDTS): TestAttribute - - testClassWithConstructorAndStaticMethods(value: ClassWithConstructorAndStaticMethodsDTS): TestAttribute - - testClassWithConstructorAndFieldsAndMethods(value: ClassWithConstructorAndFieldsAndMethodsDTS): TestAttribute - - testClassWithConstructorAndNonOptionalParams(value: ClassWithConstructorAndNonOptionalParamsDTS): TestAttribute - - testClassWithConstructorAndSomeOptionalParams(value: ClassWithConstructorAndSomeOptionalParamsDTS): TestAttribute - - testClassWithConstructorAndAllOptionalParams(value: ClassWithConstructorAndAllOptionalParamsDTS): TestAttribute - - testClassWithConstructorAndWithoutParams(value: ClassWithConstructorAndWithoutParamsDTS): TestAttribute -} \ No newline at end of file diff --git a/tests/arkts-subset/ets/text.d.ts b/tests/arkts-subset/ets/text.d.ts deleted file mode 100644 index ab82a884..00000000 --- a/tests/arkts-subset/ets/text.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 interface TextOptions { - - controller: TextController; -} - -declare interface TextOverflowOptions { - overflow: TextOverflow; -} - -interface TextInterface { - - (content?: string | Resource, value?: TextOptions): TextAttribute; -} - -declare class TextAttribute extends CommonMethod { - - font(value: Font): TextAttribute; - - fontColor(value: ResourceColor): TextAttribute; - - maxLines(value: number): TextAttribute; - - fontSize(value: number | string | Resource): TextAttribute; - - fontWeight(value: number | FontWeight | string): TextAttribute; - - textOverflow(options: TextOverflowOptions): TextAttribute; - - textAlign(value: TextAlign): TextAttribute; - - lineHeight(value: number | string | Resource): TextAttribute; - -} - -declare const TextInstance: TextAttribute; - -declare const Text: TextInterface; - -declare class TextController { - - closeSelectionMenu(): void; - - setStyledString(value: StyledString): void; - - // getLayoutManager(): LayoutManager; -} diff --git a/tests/arkts-subset/ets/text_common.d.ts b/tests/arkts-subset/ets/text_common.d.ts new file mode 100644 index 00000000..7dd353ed --- /dev/null +++ b/tests/arkts-subset/ets/text_common.d.ts @@ -0,0 +1,1098 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the text data detector type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Defines the text data detector type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum TextDataDetectorType { + /** + * Detector type phone number. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Detector type phone number. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PHONE_NUMBER = 0, + + /** + * Detector type URL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Detector type URL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + URL = 1, + + /** + * Detector type email. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Detector type email. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + EMAIL = 2, + + /** + * Detector type address. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Detector type address. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ADDRESS = 3, + + /** + * Detector type datetime. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + DATE_TIME = 4, +} + +/** + * Text data detector config. + * + * @interface TextDataDetectorConfig + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Text data detector config. + * + * @interface TextDataDetectorConfig + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface TextDataDetectorConfig { + /** + * Text data detector types. + * + * @type { TextDataDetectorType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Text data detector types. + * + * @type { TextDataDetectorType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + types: TextDataDetectorType[] + + /** + * Text data detect result callback. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Text data detect result callback. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + onDetectResultUpdate?: (result: string) => void + + /** + * The color of AI entity. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + color?: ResourceColor, + + /** + * The decoration of AI entity. + * + * @type { ?DecorationStyleInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + decoration?: DecorationStyleInterface +} + +/** + * Defines range of text type component. + * + * @interface TextRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextRange { + /** + * Start offset. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start?: number; + + /** + * End offset. + * + * @type { ?number } + * @default text length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + end?: number; +} + +/** + * Defines the inserted text value info. + * + * @interface InsertValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface InsertValue { + /** + * The location info where the value will be inserted. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + insertOffset: number; + + /** + * The inserted value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + insertValue: string; +} + +/** + * Defines delete text direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum TextDeleteDirection { + /** + * Delete backward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BACKWARD = 0, + + /** + * Delete forward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + FORWARD = 1, +} + +/** + * Defines menu type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare enum MenuType { + /** + * Selection menu. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + SELECTION_MENU = 0, + + /** + * Preview menu, only for image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + PREVIEW_MENU = 1, +} + +/** + * Provides an interface for deleting value from text. + * + * @interface DeleteValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DeleteValue { + /** + * The location info where the value will be deleted. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + deleteOffset: number; + + /** + * The deleted direction. + * + * @type { TextDeleteDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + direction: TextDeleteDirection; + + /** + * The deleted value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + deleteValue: string; +} + +/** + * Callback after content changed. + * + * @typedef { function } OnDidChangeCallback + * @param { TextRange } rangeBefore - Range of content that had been replaced. + * @param { TextRange } rangeAfter - Range of content that newly added. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type OnDidChangeCallback = (rangeBefore: TextRange, rangeAfter: TextRange) => void; + +/** + * Callback when input sometimes has info of previewText. + * + * @typedef { function } EditableTextOnChangeCallback + * @param { string } value - Value of body text, without previewText value. + * @param { PreviewText } [previewText] - info of previewText, contains previewText value and start index. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type EditableTextOnChangeCallback = (value: string, previewText?: PreviewText) => void; + +/** + * Define the text selection controller. + * + * @interface TextBaseController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextBaseController { + /** + * Set selection to select a range of content. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @param { SelectionOptions } [options] - Indicates the options of selection. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; + + /** + * Close the select menu when menu is on. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + closeSelectionMenu(): void; + + /** + * Get LayoutManager. + * + * @returns { LayoutManager } - Return the LayoutManager. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getLayoutManager(): LayoutManager; +} + +/** + * Define the text extended editing controller. + * + * @interface TextEditControllerEx + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextEditControllerEx { + /** + * Judge whether is in editing state + * + * @returns { boolean } - true means that the component is in editing state, false means is non in editing status + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isEditing(): boolean; + + /** + * Stop editing state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + stopEditing(): void; + + /** + * Set caret offset. + * + * @param { number } offset - caret offset. + * @returns { boolean } - Return true if the caret offset was successfully set, false otherwise. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setCaretOffset(offset: number): boolean; + + /** + * Get caret offset from controller. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getCaretOffset(): number; + + /** + * Get PreviewText. + * + * @returns { PreviewText } - Return the PreviewText. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getPreviewText?(): PreviewText; +} + +/** + * Define the StyledString controller. + * + * @interface StyledStringController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface StyledStringController { + /** + * Set the StyledString of the component. + * + * @param { StyledString } styledString - StyledString. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setStyledString(styledString: StyledString): void; + + /** + * Get the StyledString of the component. + * + * @returns { MutableStyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getStyledString(): MutableStyledString; +} + +/** + * Define the StyledString changed listener. + * + * @interface StyledStringChangedListener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface StyledStringChangedListener { + /** + * Called before text changed. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillChange?: Callback; + + /** + * Called after text changed. + * + * @type { ?OnDidChangeCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidChange?: OnDidChangeCallback; +} + +/** + * Define the StyledString changed value. + * + * @interface StyledStringChangeValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface StyledStringChangeValue { + /** + * Range of the content to be replaced. + * + * @type { TextRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + range: TextRange; + + /** + * StyledString to replace. + * + * @type { StyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacementString: StyledString; + + /** + * Preview StyledString + * + * @type { ?StyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + previewText?: StyledString; +} + +/** + * Define the LayoutManager for querying layout information. + * + * @interface LayoutManager + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LayoutManager { + /** + * Get the line count. + * + * @returns { number } The line count value returned to the caller. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getLineCount(): number; + + /** + * Get the glyph position at coordinate. + * + * @param { number } x - the positionX of typography. + * @param { number } y - the positionY of typography. + * @returns { PositionWithAffinity } TextBlob object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getGlyphPositionAtCoordinate(x: number, y: number): PositionWithAffinity; + + /** + * Get LineMetrics. + * + * @param { number } lineNumber - the number of line. + * @returns { LineMetrics } The line Metrics. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getLineMetrics(lineNumber: number): LineMetrics; + + /** + * Get the rects for range. + * @param { TextRange } range - The range to set. + * @param { RectWidthStyle } widthStyle - Width style to set. + * @param { RectHeightStyle } heightStyle - Height style to set. + * @returns { Array } The rects for range. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + getRectsForRange(range: TextRange, widthStyle: RectWidthStyle, heightStyle: RectHeightStyle): Array; +} + +/** + * Position and affinity. + * + * @typedef PositionWithAffinity + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface PositionWithAffinity { + /** + * Position of text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + position: number; + + /** + * Affinity of text. + * + * @type { Affinity } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + affinity: Affinity; +} + +/** + * Define the Affinity type. + * + * @typedef { import('../api/@ohos.graphics.text').default.Affinity } Affinity + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type Affinity = import('../api/@ohos.graphics.text').default.Affinity; + +/** + * Define the LineMetrics type. + * + * @typedef { import('../api/@ohos.graphics.text').default.LineMetrics } LineMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type LineMetrics = import('../api/@ohos.graphics.text').default.LineMetrics; + +/** + * Define the RectWidthStyle type. + * + * @typedef { import('../api/@ohos.graphics.text').default.RectWidthStyle } RectWidthStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type RectWidthStyle = import('../api/@ohos.graphics.text').default.RectWidthStyle; + +/** + * Define the RectHeightStyle type. + * + * @typedef { import('../api/@ohos.graphics.text').default.RectHeightStyle } RectHeightStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type RectHeightStyle = import('../api/@ohos.graphics.text').default.RectHeightStyle; + +/** + * Define the TextBox type. + * + * @typedef { import('../api/@ohos.graphics.text').default.TextBox } TextBox + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type TextBox = import('../api/@ohos.graphics.text').default.TextBox; + +/** + * Defines the cursor style + * + * @interface CaretStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the cursor style + * + * @interface CaretStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface CaretStyle { + /** + * Set the cursor width + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the cursor width + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + width?: Length, + + /** + * Set the cursor color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set the cursor color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + color?: ResourceColor, +} + +/** + * Defines the TextMenuItemId. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare class TextMenuItemId { + /** + * Init a TextMenuItemId with id. + * + * @param { ResourceStr } id - The id of the TextMenuItemId. + * @returns { TextMenuItemId } - Returns the TextMenuItemId object. + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + static of(id: ResourceStr): TextMenuItemId; + + /** + * Judge if two TextMenuItemId are equal. + * + * @param { TextMenuItemId } id - id TextMenuItemId. + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + equals(id: TextMenuItemId): boolean; + + /** + * Indicates the TextMenuItemId to copy and delete the currently selected text. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly CUT: TextMenuItemId; + + /** + * Indicates the TextMenuItemId to copy the currently selected text to the clipboard. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly COPY: TextMenuItemId; + + /** + * Indicates the TextMenuItemId to copy the current contents of the clipboard into the text view. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly PASTE: TextMenuItemId; + + /** + * Indicates the TextMenuItemId to select all text in a text view. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly SELECT_ALL: TextMenuItemId; + + /** + * Indicates the TextMenuItemId for collaboration service menu items. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly COLLABORATION_SERVICE: TextMenuItemId; + + /** + * Indicates the TextMenuItemId to recognize the text in the picture and input it into the text view. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + static readonly CAMERA_INPUT: TextMenuItemId; + + /** + * Indicates the TextMenuItemId to help with text creation by invoking large models. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + static readonly AI_WRITER: TextMenuItemId; +} + +/** + * The previewText. + * @interface PreviewText + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface PreviewText { + /** + * Start offset of the previewText + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + offset: number; + + /** + * Value of the previewText. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + value: string; +} + +/** + * TextMenuItem + * + * @interface TextMenuItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface TextMenuItem { + /** + * Customize what the menu displays. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + content: ResourceStr; + /** + * Customize the icon before the menu displays content. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + icon?: ResourceStr; + /** + * Distinguish clicked menu content by Id. + * + * @type { TextMenuItemId } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id: TextMenuItemId; +} + +/** + * EditMenuOptions + * + * @interface EditMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface EditMenuOptions { + /** + * Passes the default menu, invokes before every display to generate a menu for triggering click events. + * + * @param { Array } menuItems - current default menu array. + * @returns { Array } - Return the menu after operations. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onCreateMenu(menuItems: Array): Array; + /** + * Invoke upon clicking an item, capable of intercepting the default system menu execution behavior. + * + * @param { TextMenuItem } menuItem - current default menu. + * @param { TextRange } range - current selected range. + * @returns { boolean } - Return True, the event is consumed, false otherwise. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onMenuItemClick(menuItem: TextMenuItem, range: TextRange): boolean; +} + +/** + * Defines the font decoration result. + * + * @interface DecorationStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +interface DecorationStyleResult { + /** + * Font decoration type. + * + * @type { TextDecorationType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + type: TextDecorationType; + + /** + * Font decoration color. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color: ResourceColor; + + /** + * The style value of the decoration property object. + * + * @type { ?TextDecorationStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + style?: TextDecorationStyle; +} + +/** + * Defines the options of font. + * + * @interface FontSettingOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface FontSettingOptions { + /** + * Define weather VariableFontWeight is supported. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + enableVariableFontWeight?: boolean; + } \ No newline at end of file diff --git a/tests/arkts-subset/ets/text_input.d.ts b/tests/arkts-subset/ets/text_input.d.ts index 7a081584..b064a30b 100644 --- a/tests/arkts-subset/ets/text_input.d.ts +++ b/tests/arkts-subset/ets/text_input.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 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 @@ -13,56 +13,2652 @@ * limitations under the License. */ +/** + * @file + * @kit ArkUI + */ + +/** + * Declare the type of input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare the type of input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the type of input box + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ declare enum InputType { + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Basic input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Normal, - Normal, - Number, -} + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pure digital input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Number, -declare enum EnterKeyType { - Go = 2, - Search = 3, - Send = 4, - Next = 5, - Done = 6, - PREVIOUS = 7, - NEW_LINE = 8, - } + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Phone number entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + PhoneNumber, -declare enum ContentType { + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * E-mail address input mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Email, + + /** + * Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Password, + /** + * Number Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Number Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NUMBER_PASSWORD = 8, + + /** + * Screen Lock Password entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + SCREEN_LOCK_PASSWORD = 9, + + /** + * UserName entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * UserName entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + USER_NAME = 10, + + /** + * NewPassword entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * NewPassword entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + NEW_PASSWORD = 11, + + /** + * Number decimal entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NUMBER_DECIMAL = 12, + + /** + * URL entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + URL = 13, +} + +/** + * Declare the type of input content + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare enum ContentType { + /** + * User name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ USER_NAME = 0, + + /** + * Password content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ PASSWORD = 1, + + /** + * New password content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + NEW_PASSWORD = 2, + + /** + * Full street address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + FULL_STREET_ADDRESS = 3, + + /** + * House number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + HOUSE_NUMBER = 4, + + /** + * District address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + DISTRICT_ADDRESS = 5, + + /** + * City address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + CITY_ADDRESS = 6, + + /** + * Province address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PROVINCE_ADDRESS = 7, + + /** + * Country address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + COUNTRY_ADDRESS = 8, + + /** + * Person full name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PERSON_FULL_NAME = 9, + + /** + * Person last name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PERSON_LAST_NAME = 10, + + /** + * Person first name content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PERSON_FIRST_NAME = 11, + + /** + * Phone number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PHONE_NUMBER = 12, + + /** + * Phone country code content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + PHONE_COUNTRY_CODE = 13, + + /** + * Full phone number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + FULL_PHONE_NUMBER = 14, + + /** + * Email address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + EMAIL_ADDRESS = 15, + + /** + * Bank card number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + BANK_CARD_NUMBER = 16, + + /** + * ID card number content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + ID_CARD_NUMBER = 17, + + /** + * Nickname content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + NICKNAME = 23, + + /** + * Detail info without street content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + DETAIL_INFO_WITHOUT_STREET = 24, + + /** + * Format address content type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + FORMAT_ADDRESS = 25 } +/** + * Declare the type of soft keyboard. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Declare the type of soft keyboard. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare the type of soft keyboard. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum EnterKeyType { + /** + * Go. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Go. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Go. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Go = 2, + + /** + * Search. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Search. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Search. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Search = 3, + + /** + * Send. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Send. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Send. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Send = 4, + + /** + * Next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Next. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Next = 5, + + /** + * Done. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Done. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Done. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Done = 6, + + /** + * Showed as 'previous' pattern. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Showed as 'previous' pattern. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PREVIOUS = 7, + + /** + * Showed as 'new line' pattern. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Showed as 'new line' pattern. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NEW_LINE = 8, +} + +/** + * Defines the underline color width property. + * + * @interface UnderlineColor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface UnderlineColor { + /** + * Typing underline color width property. + * + * @type { ?(ResourceColor | undefined) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + typing?: ResourceColor | undefined; + /** + * Normal underline color width property. + * + * @type { ?(ResourceColor | undefined) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + normal?: ResourceColor | undefined; + /** + * Error underline color width property. + * + * @type { ?(ResourceColor | undefined) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + error?: ResourceColor | undefined; + /** + * Disable underline color width property. + * + * @type { ?(ResourceColor | undefined) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + disable?: ResourceColor | undefined; +} + +/** + * Provides the method of keeping TextInput editable state when submitted. + * + * @interface SubmitEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface SubmitEvent { + /** + * Keeps TextInput editable state when submitted + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + keepEditableState(): void; + + /** + * Sets the current value of TextInput. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + text: string; +} + +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @since 8 + */ +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides the method of switching the cursor position. + * + * @extends TextContentControllerBase + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class TextInputController extends TextContentControllerBase { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @param { number } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretPosition(value: number): void; + + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Text selection is achieved by specifying the start and end positions of the text. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @param { SelectionOptions } [options] - Indicates the options of the text selection. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setTextSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; + + /** + * Exit edit state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Exit edit state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + stopEditing(): void; +} + +/** + * Defines the options of TextInput. + * + * @interface TextInputOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of TextInput. + * + * @interface TextInputOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the options of TextInput. + * + * @interface TextInputOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ declare interface TextInputOptions { + /** + * The place holder text string. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The place holder text string. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The place holder text string. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholder?: ResourceStr; - placeholder?: ResourceStr; + /** + * Sets the current value of TextInput. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the current value of TextInput. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the current value of TextInput. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + text?: ResourceStr; - text?: ResourceStr; + /** + * Called when the position of the insertion cursor is set. + * + * @type { ?TextInputController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @type { ?TextInputController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the position of the insertion cursor is set. + * + * @type { ?TextInputController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + controller?: TextInputController; +} - //controller?: TextInputController; +/** + * Text input style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Text input style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Text input style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum TextInputStyle { + /** + * Text input default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Text input default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text input default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Default, + + /** + * Text input inline style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Text input inline style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text input inline style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Inline } +/** + * Provides a single-line text input component interface. + * + * @interface TextInputInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides a single-line text input component interface. + * + * @interface TextInputInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provides a single-line text input component interface. + * + * @interface TextInputInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ interface TextInputInterface { + /** + * Called when writing a single line of text. + * + * @param { TextInputOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when writing a single line of text. + * + * @param { TextInputOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when writing a single line of text. + * + * @param { TextInputOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (value?: TextInputOptions): TextInputAttribute; +} - (value?: TextInputOptions): TextInputAttribute; +/** + * PasswordIcon object. + * + * @interface PasswordIcon + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * PasswordIcon object. + * + * @interface PasswordIcon + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface PasswordIcon { + /** + * Define the on icon source of PasswordIcon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the on icon source of PasswordIcon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onIconSrc?: string | Resource; + + /** + * Define the off icon source of PasswordIcon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the off icon source of PasswordIcon. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offIconSrc?: string | Resource; } +/** + * Defines a TextInput callback when onSubmit. + * + * @typedef { function } OnSubmitCallback + * @param { EnterKeyType } enterKey - Input method Enter key type. + * @param { SubmitEvent } event - The event submitted. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnSubmitCallback = (enterKey: EnterKeyType, event: SubmitEvent) => void; + +/** + * Defines a TextInput callback when onTextSelectionChange. + * + * @typedef { function } OnTextSelectionChangeCallback + * @param { number } selectionStart - The starting position of the selected text, the starting position of the text is 0. + * @param { number } selectionEnd - The end location of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnTextSelectionChangeCallback = (selectionStart: number, selectionEnd: number) => void; + +/** + * Defines a TextInput callback when onContentScroll. + * + * @typedef { function } OnContentScrollCallback + * @param { number } totalOffsetX - The text is offset in px on the horizontal axis of the content area. + * @param { number } totalOffsetY - The text is offset in px on the vertical axis of the content area. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnContentScrollCallback = (totalOffsetX: number, totalOffsetY: number) => void; + + +/** + * Defines a TextInput callback when onPaste. + * + * @typedef { function } OnPasteCallback + * @param { string } content - The text content of the paste. + * @param { PasteEvent } event - User-defined paste event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnPasteCallback = (content: string, event: PasteEvent) => void; + +/** + * Defines the TextInput attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the TextInput attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the TextInput attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ declare class TextInputAttribute extends CommonMethod { + /** + * Called when the input type is set. + * + * @param { InputType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the input type is set. + * + * @param { InputType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the input type is set. + * + * @param { InputType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type(value: InputType): TextInputAttribute; + + /** + * Called when the content type is set. + * + * @param { ContentType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + contentType(value: ContentType): TextInputAttribute; + + /** + * Called when the color of the placeholder is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the color of the placeholder is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the color of the placeholder is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholderColor(value: ResourceColor): TextInputAttribute; + + /** + * Called when the overflow mode of the font is set. + * + * @param { TextOverflow } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textOverflow(value: TextOverflow): TextInputAttribute; + + /** + * Specify the indentation of the first line in a text-block. + * + * @param { Dimension } value - The length of text indent. + * @returns { TextInputAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + textIndent(value: Dimension): TextInputAttribute; + + /** + * Called when the font property of the placeholder is set. + * + * @param { Font } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font property of the placeholder is set. + * + * @param { Font } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font property of the placeholder is set. + * + * @param { Font } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + placeholderFont(value?: Font): TextInputAttribute; + + /** + * Called when the type of soft keyboard input button is set. + * + * @param { EnterKeyType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the type of soft keyboard input button is set. + * + * @param { EnterKeyType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the type of soft keyboard input button is set. + * + * @param { EnterKeyType } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enterKeyType(value: EnterKeyType): TextInputAttribute; + + /** + * Called when the color of the insertion cursor is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the color of the insertion cursor is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the color of the insertion cursor is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretColor(value: ResourceColor): TextInputAttribute; + + /** + * Called when judging whether the text editing change finished. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 8 + * @useinstead onEditChange + */ + onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute; + + /** + * Called when judging whether the text editing change finished. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when judging whether the text editing change finished. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether the text editing change finished. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when judging whether the text editing change finished. + * + * @param { Callback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onEditChange(callback: Callback): TextInputAttribute; + + /** + * Called when submitted. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when submitted. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when submitted. + * + * @param { function } callback - callback of the listened event. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when submitted. + * + * @param { OnSubmitCallback } callback - Callback of the listened event. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSubmit(callback: OnSubmitCallback): TextInputAttribute; + + /** + * Called when the input of the input box changes. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the input of the input box changes. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the input of the input box changes. + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the input of the input box changes. + * + * @param { EditableTextOnChangeCallback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onChange(callback: EditableTextOnChangeCallback): TextInputAttribute; + + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the text selection changes. + * + * @param { function } callback - callback of the listened event. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the text selection changes. + * + * @param { OnTextSelectionChangeCallback } callback - Callback of the listened event. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onTextSelectionChange(callback: OnTextSelectionChangeCallback): TextInputAttribute; + + /** + * Called when the content scrolls. + * + * @param { function } callback - callback of the listened event. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the content scrolls. + * + * @param { function } callback - callback of the listened event. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the content scrolls. + * + * @param { OnContentScrollCallback } callback - Callback of the listened event. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onContentScroll(callback: OnContentScrollCallback): TextInputAttribute; + + /** + * Called when the input of maximum text length is set. + * + * @param { number } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the input of maximum text length is set. + * + * @param { number } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the input of maximum text length is set. + * + * @param { number } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxLength(value: number): TextInputAttribute; + + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font color is set. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontColor(value: ResourceColor): TextInputAttribute; + + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font size is set. + * + * @param { Length } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontSize(value: Length): TextInputAttribute; + + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font style of a font is set. + * + * @param { FontStyle } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontStyle(value: FontStyle): TextInputAttribute; + + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font weight is set. + * + * @param { number | FontWeight | string } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontWeight(value: number | FontWeight | string): TextInputAttribute; + + /** + * Called when the font list of text is set. + * + * @param { ResourceStr } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the font list of text is set. + * + * @param { ResourceStr } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the font list of text is set. + * + * @param { ResourceStr } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fontFamily(value: ResourceStr): TextInputAttribute; + + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { function } error + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { function } error + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { function } error + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { Callback } [error] + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + inputFilter(value: ResourceStr, error?: Callback): TextInputAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCopy(callback: Callback): TextInputAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCut(callback: Callback): TextInputAttribute; + + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when using the Clipboard menu + * + * @param { function } callback + * Executed when a paste operation is performed. + * { string } value - The text content to be pasted. + * { PasteEvent } event - The user-defined paste event. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Called when using the Clipboard menu. + * + * @param { OnPasteCallback } callback - Executed when a paste operation is performed. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPaste(callback: OnPasteCallback): TextInputAttribute; + + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the copy option is set. + * + * @param { CopyOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + copyOption(value: CopyOptions): TextInputAttribute; - type(value: InputType): TextInputAttribute; + /** + * Called when the password show/hide icon is set. + * + * @param { boolean } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the password show/hide icon is set. + * + * @param { boolean } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the password show/hide icon is set. + * + * @param { boolean } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showPasswordIcon(value: boolean): TextInputAttribute; - contentType(value: ContentType): TextInputAttribute; + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the text align is set. + * + * @param { TextAlign } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + textAlign(value: TextAlign): TextInputAttribute; - onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute; + /** + * Text input style + * + * @param { TextInputStyle | TextContentStyle } value - Text input style + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Text input style + * + * @param { TextInputStyle | TextContentStyle } value - Text input style + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text input style + * + * @param { TextInputStyle | TextContentStyle } value - Text input style + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style(value: TextInputStyle | TextContentStyle): TextInputAttribute; - placeholderFont(value?: Font): TextInputAttribute; + /** + * Define the caret style of the text input + * + * @param { CaretStyle } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the caret style of the text input + * + * @param { CaretStyle } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretStyle(value: CaretStyle): TextInputAttribute; - enterKeyType(value: EnterKeyType): TextInputAttribute; + /** + * Define the text selected background color of the text input. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the text selected background color of the text input. + * + * @param { ResourceColor } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectedBackgroundColor(value: ResourceColor): TextInputAttribute; + /** + * Define the caret position of the text input. + * + * @param { number } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the caret position of the text input. + * + * @param { number } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + caretPosition(value: number): TextInputAttribute; + + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } value + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets whether request keyboard or not when on focus. + * + * @param { boolean } value + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableKeyboardOnFocus(value: boolean): TextInputAttribute; + + /** + * Define the password icon of the text input. + * + * @param { PasswordIcon } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the password icon of the text input. + * + * @param { PasswordIcon } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + passwordIcon(value: PasswordIcon): TextInputAttribute; + + /** + * Define the show error of the text input. + * + * @param { string | undefined } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the show error of the text input. + * + * @param { string | undefined } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Define the show error of the text input. + * + * @param { ResourceStr | undefined } [value] + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showError(value?: ResourceStr | undefined): TextInputAttribute; + + /** + * Define the show unit of the text input. + * + * @param { CustomBuilder } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the show unit of the text input. + * + * @param { CustomBuilder } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showUnit(value: CustomBuilder): TextInputAttribute; + + /** + * Define the show underline of the text input. + * + * @param { boolean } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define the show underline of the text input. + * + * @param { boolean } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showUnderline(value: boolean): TextInputAttribute; + + /** + * Define the underline color of the text input. + * + * @param { ResourceColor | UnderlineColor | undefined } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + underlineColor(value: ResourceColor | UnderlineColor | undefined): TextInputAttribute; + + /** + * Controls whether the selection menu pops up. + * + * @param { boolean } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Controls whether the selection menu pops up. + * + * @param { boolean } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selectionMenuHidden(value: boolean): TextInputAttribute; + + /** + * Define bar state of the text input. + * + * @param { BarState } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define bar state of the text input. + * + * @param { BarState } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + barState(value: BarState): TextInputAttribute; + + /** + * Define max lines of the text input. + * + * @param { number } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define max lines of the text input. + * + * @param { number } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxLines(value: number): TextInputAttribute; + + /** + * Set the text inline style word break type. + * + * @param { WordBreak } value - The word break type. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + wordBreak(value: WordBreak): TextInputAttribute; + + /** + * Set the text line break strategy type. + * + * @param { LineBreakStrategy } strategy - The text line break strategy type. + * @returns { TextInputAttribute } The attribute of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineBreakStrategy(strategy: LineBreakStrategy): TextInputAttribute; + + /** + * Define custom keyboard of the text input. + * + * @param { CustomBuilder } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Define custom keyboard of the text input. + * + * @param { CustomBuilder } value + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + + /** + * Define custom keyboard of the text input. + * + * @param { CustomBuilder } value - Set up a custom keyboard of TextInput + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of TextInput + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customKeyboard(value: CustomBuilder, options?: KeyboardOptions): TextInputAttribute; + + /** + * Show the counter when the number of characters entered exceeds the threshold through InputCounterOptions. + * + * @param { boolean } value - Set showcounter of the text input. + * @param { InputCounterOptions } options - Set the percentage of counter. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + showCounter(value: boolean, options?: InputCounterOptions): TextInputAttribute; + + /** + * Set the cancel button style + * + * @param { object } value - indicates the style of the cancel button. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set the cancel button style + * + * @param { object } value - indicates the style of the cancel button. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Set the cancel button style. + * + * @param { CancelButtonOptions } options - Indicates the style of the cancel button. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + cancelButton(options: CancelButtonOptions): TextInputAttribute; + + /** + * Set the cancel button style + * + * @param { CancelButtonSymbolOptions } symbolOptions - indicates the style of the cancel button. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + cancelButton(symbolOptions: CancelButtonSymbolOptions): TextInputAttribute; + + /** + * Sets selection when on focus. + * + * @param { boolean } value - Sets selection or not. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets selection when on focus. + * + * @param { boolean } value - Sets selection or not. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + selectAll(value: boolean): TextInputAttribute; + + /** + * Called when the minimum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + minFontSize(value: number | string | Resource): TextInputAttribute; + + /** + * Called when the maximum font size of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + maxFontSize(value: number | string | Resource): TextInputAttribute; + + /** + * Called when the height adaptive policy is set. + * + * @param { TextHeightAdaptivePolicy } value - The height adaptive policy. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + heightAdaptivePolicy(value: TextHeightAdaptivePolicy): TextInputAttribute; + + /** + * Sets whether enable auto fill or not. + * + * @param { boolean } value - Indicates the flag whether autofill is enabled. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Sets whether enable auto fill or not. + * + * @param { boolean } value - Indicates the flag whether autofill is enabled. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableAutoFill(value: boolean): TextInputAttribute; + + /** + * Called when the text decoration of the text is set. + * + * @param { TextDecorationOptions } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + decoration(value: TextDecorationOptions): TextInputAttribute; + + /** + * Called when the distance between text fonts is set. + * + * @param { number | string | Resource } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + letterSpacing(value: number | string | Resource): TextInputAttribute; + + /** + * Called when the line height of the font is set. + * + * @param { number | string | Resource } value + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lineHeight(value: number | string | Resource): TextInputAttribute; + + /** + * Define the password rules of the text input. + * + * @param { string } value - Indicates the password rules. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Define the password rules of the text input. + * + * @param { string } value - Indicates the password rules. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + passwordRules(value: string): TextInputAttribute; + + /** + * Set font feature. + * + * @param { string } value - The fontFeature. + * normal | , + * where = [ | on | off ], like: "ss01" 0 + * the values of reference to doc of TextInput component + * number of can be single or multiple, and separated by comma ','. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + fontFeature(value: string): TextInputAttribute; + + /** + * Define the password visible mode of the text input. + * + * @param { boolean } visible - Indicates the password visible mode. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + showPassword(visible: boolean): TextInputAttribute; + + /** + * Called when changing the password visible mode of the text input. + * + * @param { Callback } callback - callback of the password visible mode change event. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onSecurityStateChange(callback: Callback): TextInputAttribute; + + /** + * Get text value information when about to input. + * + * @param { Callback } callback - The triggered function when text content is about to insert. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillInsert(callback: Callback): TextInputAttribute; + + /** + * Get text value information when completed input. + * + * @param { Callback } callback - The triggered function when text content has been inserted. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidInsert(callback: Callback): TextInputAttribute; + + /** + * Get text value information when about to delete. + * + * @param { Callback } callback - The triggered function when text content is about to delete. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDelete(callback: Callback): TextInputAttribute; + + /** + * Get text value information when the deletion has been completed + * + * @param { Callback } callback - The triggered function when text content has been deleted. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onDidDelete(callback: Callback): TextInputAttribute; + + /** + * Set the custom text menu. + * + * @param { EditMenuOptions } editMenu - Customize text menu options. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + editMenuOptions(editMenu: EditMenuOptions): TextInputAttribute; + + /** + * Define the preview text mode of the text input. + * + * @param { boolean } enable - Indicates the preview text mode. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + enablePreviewText(enable: boolean): TextInputAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): TextInputAttribute; } +/** + * Defines TextInput Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TextInput Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextInput Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ declare const TextInput: TextInputInterface; +/** + * Defines TextInput Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines TextInput Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines TextInput Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ declare const TextInputInstance: TextInputAttribute; diff --git a/tests/arkts-subset/ets/text_picker.d.ts b/tests/arkts-subset/ets/text_picker.d.ts index 4c0ea437..61e82f4b 100644 --- a/tests/arkts-subset/ets/text_picker.d.ts +++ b/tests/arkts-subset/ets/text_picker.d.ts @@ -298,6 +298,7 @@ interface TextPickerInterface { * @interface DividerOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ declare interface DividerOptions { @@ -307,6 +308,7 @@ declare interface DividerOptions { * @type { ?Dimension } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ strokeWidth?: Dimension; @@ -317,6 +319,7 @@ declare interface DividerOptions { * @type { ?ResourceColor } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ color?: ResourceColor; @@ -327,6 +330,7 @@ declare interface DividerOptions { * @type { ?Dimension } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ startMargin?: Dimension; @@ -337,11 +341,25 @@ declare interface DividerOptions { * @type { ?Dimension } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ endMargin?: Dimension; } +/** + * Callback of the listened scroll stop event. + * + * @typedef {function} TextPickerScrollStopCallback + * @param { string | string[] } value - Value of the selected item. + * @param { number | number[] } index - Index of the selected item. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type TextPickerScrollStopCallback = (value: string | string[], index: number | number[]) => void; + /** * Style the text selector. * @@ -435,7 +453,7 @@ declare class TextPickerAttribute extends CommonMethod { * @atomicservice * @since 11 */ - // disappearTextStyle(value: PickerTextStyle): TextPickerAttribute; + disappearTextStyle(value: PickerTextStyle): TextPickerAttribute; /** * Sets the text style of normal items @@ -456,7 +474,7 @@ declare class TextPickerAttribute extends CommonMethod { * @atomicservice * @since 11 */ - // textStyle(value: PickerTextStyle): TextPickerAttribute; + textStyle(value: PickerTextStyle): TextPickerAttribute; /** * Sets the text style of selected items @@ -477,7 +495,7 @@ declare class TextPickerAttribute extends CommonMethod { * @atomicservice * @since 11 */ - // selectedTextStyle(value: PickerTextStyle): TextPickerAttribute; + selectedTextStyle(value: PickerTextStyle): TextPickerAttribute; /** * Called when the pop-up value is returned. @@ -532,6 +550,19 @@ declare class TextPickerAttribute extends CommonMethod { */ onChange(callback: (value: string | string[], index: number | number[]) => void): TextPickerAttribute; + /** + * This event is triggered when a TextPicker item is selected and scrolling has stopped. + * Only valid when only text is displayed. When picture or picture plus text is displayed, the value is "". + * + * @param { TextPickerScrollStopCallback } callback - the callback of onScrollStop. + * @returns { TextPickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollStop(callback: TextPickerScrollStopCallback): TextPickerAttribute; + /** * Set the selected indices. * The array size is the total number of columns. @@ -562,6 +593,7 @@ declare class TextPickerAttribute extends CommonMethod { * @returns { TextPickerAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ divider(value: DividerOptions | null): TextPickerAttribute; @@ -573,6 +605,7 @@ declare class TextPickerAttribute extends CommonMethod { * @returns { TextPickerAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ gradientHeight(value: Dimension): TextPickerAttribute; @@ -746,7 +779,7 @@ declare interface TextPickerDialogOptions extends TextPickerOptions { * @atomicservice * @since 11 */ - // disappearTextStyle?: PickerTextStyle; + disappearTextStyle?: PickerTextStyle; /** * Text style of normal items @@ -765,7 +798,7 @@ declare interface TextPickerDialogOptions extends TextPickerOptions { * @atomicservice * @since 11 */ - // textStyle?: PickerTextStyle; + textStyle?: PickerTextStyle; /** * Style of accept button. @@ -773,9 +806,10 @@ declare interface TextPickerDialogOptions extends TextPickerOptions { * @type { ?PickerDialogButtonStyle } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ - //acceptButtonStyle?: PickerDialogButtonStyle; + acceptButtonStyle?: PickerDialogButtonStyle; /** * Style of cancel button. @@ -783,9 +817,10 @@ declare interface TextPickerDialogOptions extends TextPickerOptions { * @type { ?PickerDialogButtonStyle } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ - //cancelButtonStyle?: PickerDialogButtonStyle; + cancelButtonStyle?: PickerDialogButtonStyle; /** * Text style of selected items @@ -804,7 +839,7 @@ declare interface TextPickerDialogOptions extends TextPickerOptions { * @atomicservice * @since 11 */ - // selectedTextStyle?: PickerTextStyle; + selectedTextStyle?: PickerTextStyle; /** * Called when the OK button in the dialog is clicked. * @@ -883,6 +918,17 @@ declare interface TextPickerDialogOptions extends TextPickerOptions { */ onChange?: (value: TextPickerResult) => void; + /** + * This event is triggered when a TextPicker text is selected and scrolling has stopped in dialog. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onScrollStop?: Callback; + /** * Mask Region of dialog. The size cannot exceed the main window. * @@ -919,7 +965,7 @@ declare interface TextPickerDialogOptions extends TextPickerOptions { * @atomicservice * @since 11 */ - //alignment?: DialogAlignment; + alignment?: DialogAlignment; /** * Defines the dialog offset. @@ -1010,6 +1056,7 @@ declare interface TextPickerDialogOptions extends TextPickerOptions { * @type { ?function } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ onWillAppear?: () => void; @@ -1020,6 +1067,7 @@ declare interface TextPickerDialogOptions extends TextPickerOptions { * @type { ?function } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ onWillDisappear?: () => void; @@ -1030,9 +1078,34 @@ declare interface TextPickerDialogOptions extends TextPickerOptions { * @type { ?(ShadowOptions | ShadowStyle) } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform + * @atomicservice * @since 12 */ - //shadow?: ShadowOptions | ShadowStyle; + shadow?: ShadowOptions | ShadowStyle; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; + + /** + * Defines the dialog's display area in hover mode. + * + * @type { ?HoverModeAreaType } + * @default HoverModeAreaType.BOTTOM_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hoverModeArea?: HoverModeAreaType; } /** @@ -1081,7 +1154,7 @@ declare class TextPickerDialog { * @atomicservice * @since 11 */ - static show(options?: TextPickerDialogOptions): undefined; + static show(options?: TextPickerDialogOptions); } /** @@ -1130,9 +1203,3 @@ declare const TextPicker: TextPickerInterface; */ declare const TextPickerInstance: TextPickerAttribute; -declare module "textPickerDialogParam" { - module "textPickerDialogParam" { - // @ts-ignore - export { TextPickerDialogOptions }; - } -} diff --git a/tests/arkts-subset/ets/toggle.d.ts b/tests/arkts-subset/ets/toggle.d.ts deleted file mode 100644 index d3a94ea5..00000000 --- a/tests/arkts-subset/ets/toggle.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 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 enum ToggleType { - Checkbox, - Switch, - Button, - } - - declare interface ToggleOptions { - type: ToggleType; - isOn?: boolean - } - - interface ToggleInterface { - (options: ToggleOptions): ToggleAttribute; - } - - declare class ToggleAttribute extends CommonMethod { - // onChange(callback: (isOn: boolean) => void): ToggleAttribute; - // contentModifier(modifier: ContentModifier): ToggleAttribute; - // selectedColor(value: ResourceColor): ToggleAttribute; - // switchPointColor(color: ResourceColor): ToggleAttribute; - // switchStyle(value: SwitchStyle): ToggleAttribute; - } - -declare const Toggle: ToggleInterface; -declare const ToggleInstance: ToggleAttribute; diff --git a/tests/arkts-subset/ets/ui_extension_component.d.ts b/tests/arkts-subset/ets/ui_extension_component.d.ts deleted file mode 100644 index dd23e3e4..00000000 --- a/tests/arkts-subset/ets/ui_extension_component.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 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 enum DpiFollowStrategy { - FOLLOW_HOST_DPI = 0, - FOLLOW_UI_EXTENSION_ABILITY_DPI = 1, -} - -declare interface UIExtensionOptions { - isTransferringCaller?: boolean; - placeholder?: ComponentContent; - dpiFollowStrategy?: DpiFollowStrategy; -} - -// declare interface TerminationInfo { -// code: number; -// want?: import('../api/@ohos.app.ability.Want').default; -// } - -declare interface UIExtensionProxy { - send(data: Record): void; - sendSync(data: Record): Record; - on(type: 'asyncReceiverRegister', callback: (proxy: UIExtensionProxy) => void): void; - on(type: 'syncReceiverRegister', callback: (proxy: UIExtensionProxy) => void): void; - off(type: 'asyncReceiverRegister', callback?: (proxy: UIExtensionProxy) => void): void; - off(type: 'syncReceiverRegister', callback?: (proxy: UIExtensionProxy) => void): void; -} - -// interface UIExtensionComponentInterface { -// ( -// want: import('../api/@ohos.app.ability.Want').default, -// options?: UIExtensionOptions -// ): UIExtensionComponentAttribute; -// } -// -// declare class UIExtensionComponentAttribute extends CommonMethod { -// onRemoteReady( -// callback: import('../api/@ohos.base').Callback -// ): UIExtensionComponentAttribute; -// onReceive( -// callback: import('../api/@ohos.base').Callback<{ [key: string]: Object }> -// ): UIExtensionComponentAttribute; -// onResult( -// callback: import('../api/@ohos.base').Callback<{ -// code: number; -// want?: import('../api/@ohos.app.ability.Want').default; -// }> -// ): UIExtensionComponentAttribute; -// onRelease( -// callback: import('../api/@ohos.base').Callback -// ): UIExtensionComponentAttribute; -// onError( -// callback: import('../api/@ohos.base').ErrorCallback -// ): UIExtensionComponentAttribute; -// onTerminated(callback: Callback): UIExtensionComponentAttribute; -// } -// -// declare const UIExtensionComponent: UIExtensionComponentInterface; -// -// declare const UIExtensionComponentInstance: UIExtensionComponentAttribute; diff --git a/tests/arkts-subset/ets/units.d.ts b/tests/arkts-subset/ets/units.d.ts index 0a93b1e8..02be5d05 100644 --- a/tests/arkts-subset/ets/units.d.ts +++ b/tests/arkts-subset/ets/units.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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 @@ -13,90 +13,3480 @@ * limitations under the License. */ +/** + * @file + * @kit ArkUI + */ -declare type Resource = import('../resource/resource').Resource; - -declare type LengthMetricsUnit = import('../api/arkui/Graphics').LengthMetricsUnit; - -declare type LengthMetrics = import('../api/arkui/Graphics').LengthMetrics; +/** + * Defines the data type of the interface restriction. + * + * @typedef { import('../api/global/resource').Resource } Resource + * @interface Resource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the data type of the interface restriction. + * + * @typedef { import('../api/global/resource').Resource } Resource + * @interface Resource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the data type of the interface restriction. + * + * @typedef { import('../api/global/resource').Resource } Resource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the data type of the interface restriction. + * + * @typedef { import('../api/global/resource').Resource } Resource + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type Resource = import('../api/global/resource').Resource; +/** + * Defines the length property with string, number and resource unit. + * + * @typedef { string | number | Resource } Length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the length property with string, number and resource unit. + * + * @typedef { string | number | Resource } Length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the length property with string, number and resource unit. + * + * @typedef { string | number | Resource } Length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the length property with string, number and resource unit. + * + * @typedef { string | number | Resource } Length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare type Length = string | number | Resource; -declare type ResourceColor = Color | number | string | Resource; - +/** + * Defines the length property with number in units of px. + * + * @typedef { `${number}px` } PX + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the length property with number in units of px. + * + * @typedef { `${number}px` } PX + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ declare type PX = `${number}px`; +/** + * Defines the length property with number or number in units of vp. + * + * @typedef { `${number}vp` | number } VP + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the length property with number or number in units of vp. + * + * @typedef { `${number}vp` | number } VP + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ declare type VP = `${number}vp` | number; +/** + * Defines the length property with number in units of fp. + * + * @typedef { `${number}fp` } FP + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the length property with number in units of fp. + * + * @typedef { `${number}fp` } FP + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ declare type FP = `${number}fp`; +/** + * Defines the length property with number in units of lpx. + * + * @typedef { `${number}lpx` } LPX + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the length property with number in units of lpx. + * + * @typedef { `${number}lpx` } LPX + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ declare type LPX = `${number}lpx`; +/** + * Defines the length property with number in units of Percentage. + * + * @typedef { `${number}%` } Percentage + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the length property with number in units of Percentage. + * + * @typedef { `${number}%` } Percentage + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ declare type Percentage = `${number}%`; +/** + * Defines the angle property with number in units of deg. + * + * @typedef { `${number}deg` } Degree + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the angle property with number in units of deg. + * + * @typedef { `${number}deg` } Degree + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare type Degree = `${number}deg`; + +/** + * Defines the dimension property with number with units(vp|px|fp|lpx|%), and resource. + * + * @typedef { PX | VP | FP | LPX | Percentage | Resource } Dimension + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the dimension property with number with units(vp|px|fp|lpx|%), and resource. + * + * @typedef { PX | VP | FP | LPX | Percentage | Resource } Dimension + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ declare type Dimension = PX | VP | FP | LPX | Percentage | Resource; +/** + * Defines the string which can use resource. + * + * @typedef { string | Resource } ResourceStr + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the string which can use resource. + * + * @typedef { string | Resource } ResourceStr + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the string which can use resource. + * + * @typedef { string | Resource } ResourceStr + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the string which can use resource. + * + * @typedef { string | Resource } ResourceStr + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ declare type ResourceStr = string | Resource; -declare type Offset = { - dx: Length; +/** + * Defines the padding property. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the padding property. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the padding property. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the padding property. + * + * @typedef { object } Padding + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type Padding = { + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + top?: Length; + + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + right?: Length; + + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottom?: Length; - dy: Length; + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + left?: Length; }; -declare type AltOffset = { - dx1: Length; - dy2: Length; +/** + * Defines the localized padding property. + * + * @interface LocalizedPadding + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface LocalizedPadding { + /** + * top property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top?: LengthMetrics; + + /** + * end property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + end?: LengthMetrics; + + /** + * bottom property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom?: LengthMetrics; + + /** + * start property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + start?: LengthMetrics; }; -declare interface Position { +/** + * Defines the margin property. + * + * @typedef { Padding } Margin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the margin property. + * + * @typedef { Padding } Margin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the margin property. + * + * @typedef { Padding } Margin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the margin property. + * + * @typedef { Padding } Margin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type Margin = Padding; - x?: Length; +/** + * Defines the border width property. + * + * @typedef { EdgeWidths } EdgeWidth + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the border width property. + * + * @typedef { EdgeWidths } EdgeWidth + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type EdgeWidth = EdgeWidths; - y?: Length; -} +/** + * Defines the border width property. + * + * @typedef { object } EdgeWidths + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the border width property. + * + * @typedef { object } EdgeWidths + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the border width property. + * + * @typedef { object } EdgeWidths + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type EdgeWidths = { + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + top?: Length; -declare interface LocalizedPadding { + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + right?: Length; + + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottom?: Length; + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + left?: Length; +}; + +/** + * Defines the localized border width property. + * + * @interface LocalizedEdgeWidths + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface LocalizedEdgeWidths { + /** + * top property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ top?: LengthMetrics; + /** + * end property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ end?: LengthMetrics; + /** + * bottom property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ bottom?: LengthMetrics; + /** + * start property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ start?: LengthMetrics; }; +/** + * Defines the outline width property. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the outline width property. + * + * @typedef { object } EdgeOutlineWidths + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type EdgeOutlineWidths = { + /** + * top outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * top outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top?: Dimension; + + /** + * right outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * right outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + right?: Dimension; + + /** + * bottom outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * bottom outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom?: Dimension; + + /** + * left outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * left outline width property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + left?: Dimension; +}; + +/** + * Defines the border radius property. + * + * @typedef { object } BorderRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the border radius property. + * + * @typedef { object } BorderRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the border radius property. + * + * @typedef { object } BorderRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type BorderRadiuses = { + /** + * top-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + topLeft?: Length; + + /** + * top-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + topRight?: Length; + + /** + * bottom-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom-left property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottomLeft?: Length; + + /** + * bottom-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom-right property. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottomRight?: Length; +}; + +/** + * Defines the localized border radius property. + * + * @interface LocalizedBorderRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface LocalizedBorderRadiuses { + /** + * top-start property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + topStart?: LengthMetrics; + + /** + * top-end property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + topEnd?: LengthMetrics; + + /** + * bottom-start property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottomStart?: LengthMetrics; + + /** + * bottom-end property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottomEnd?: LengthMetrics; +}; + +/** + * Defines the outline radius property. + * + * @typedef { object } OutlineRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the outline radius property. + * + * @typedef { object } OutlineRadiuses + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type OutlineRadiuses = { + /** + * top-left property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * top-left property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + topLeft?: Dimension; + + /** + * top-right property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * top-right property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + topRight?: Dimension; + + /** + * bottom-left property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * bottom-left property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottomLeft?: Dimension; + + /** + * bottom-right property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * bottom-right property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottomRight?: Dimension; +}; + +/** + * Defines the border color property. + * + * @typedef { object } EdgeColors + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the border color property. + * + * @typedef { object } EdgeColors + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the border color property. + * + * @typedef { object } EdgeColors + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type EdgeColors = { + /** + * top property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + top?: ResourceColor; + + /** + * right property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * right property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * right property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + right?: ResourceColor; + + /** + * bottom property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottom?: ResourceColor; + + /** + * left property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * left property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * left property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + left?: ResourceColor; +}; + +/** + * Defines the localized border color property. + * + * @interface LocalizedEdgeColors + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface LocalizedEdgeColors { + /** + * top property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top?: ResourceColor; + + /** + * end property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + end?: ResourceColor; + + /** + * bottom property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom?: ResourceColor; + + /** + * start property. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + start?: ResourceColor; +}; + +/** + * Defines the localized margin property. + * + * @typedef { LocalizedPadding } LocalizedMargin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 +*/ +declare type LocalizedMargin = LocalizedPadding; + +/** + * Defines the border style property. + * + * @typedef { object } EdgeStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the border style property. + * + * @typedef { object } EdgeStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the border style property. + * + * @typedef { object } EdgeStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type EdgeStyles = { + /** + * top property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * top property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * top property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + top?: BorderStyle; + + /** + * right property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * right property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * right property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + right?: BorderStyle; + + /** + * bottom property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * bottom property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * bottom property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + bottom?: BorderStyle; + + /** + * left property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * left property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * left property. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + left?: BorderStyle; +}; + +/** + * Defines the outline style property. + * + * @typedef { object } EdgeOutlineStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the outline style property. + * + * @typedef { object } EdgeOutlineStyles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type EdgeOutlineStyles = { + /** + * top property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * top property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top?: OutlineStyle; + + /** + * right property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * right property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + right?: OutlineStyle; + + /** + * bottom property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * bottom property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom?: OutlineStyle; + + /** + * left property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + * @form + */ + /** + * left property. + * + * @type { ?OutlineStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + left?: OutlineStyle; +}; + +/** + * Defines the offset property. + * + * @typedef { object } Offset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the offset property. + * + * @typedef { object } Offset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the offset property. + * + * @typedef { object } Offset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare type Offset = { + /** + * dx property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * dx property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * dx property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + dx: Length; + + /** + * dy property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * dy property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * dy property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + dy: Length; +}; + +/** + * Defines the color which can use resource. + * + * @typedef { Color | number | string | Resource } ResourceColor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the color which can use resource. + * + * @typedef { Color | number | string | Resource } ResourceColor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the color which can use resource. + * + * @typedef { Color | number | string | Resource } ResourceColor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the color which can use resource. + * + * @typedef { Color | number | string | Resource } ResourceColor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type ResourceColor = Color | number | string | Resource; + +/** + * Defines the length constrain property. + * + * @typedef { object } LengthConstrain + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the length constrain property. + * + * @typedef { object } LengthConstrain + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the length constrain property. + * + * @typedef { object } LengthConstrain + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare type LengthConstrain = { + /** + * minimum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * minimum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * minimum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + minLength: Length; + + /** + * maximum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * maximum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * maximum length. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + maxLength: Length; +}; + +/** + * Defines VoidCallback. + * + * @typedef { function } VoidCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type VoidCallback = () => void; + +/** + * Defines length metrics unit. + * + * @typedef { import('../api/arkui/Graphics').LengthMetricsUnit } LengthMetricsUnit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare type LengthMetricsUnit = import('../api/arkui/Graphics').LengthMetricsUnit; + +/** + * Defines LengthMetrics. + * + * @typedef { import('../api/arkui/Graphics').LengthMetrics } LengthMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type LengthMetrics = import('../api/arkui/Graphics').LengthMetrics; + +/** + * Defines ColorMetrics. + * + * @typedef { import('../api/arkui/Graphics').ColorMetrics } ColorMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type ColorMetrics = import('../api/arkui/Graphics').ColorMetrics; + +/** + * Defines the font used for text. + * + * @interface Font + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the font used for text. + * + * @interface Font + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the font used for text. + * + * @interface Font + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ declare interface Font { + /** + * font size. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * font size. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * font size. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ size?: Length; + + /** + * font weight. + * + * @type { ?(FontWeight | number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * font weight. + * + * @type { ?(FontWeight | number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * font weight. + * + * @type { ?(FontWeight | number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ weight?: FontWeight | number | string; + + /** + * font family. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * font family. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * font family. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ family?: string | Resource; + + /** + * font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * font style. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ style?: FontStyle; } -/////////////// recently added /////////////// +/** + * Defines the area property. + * + * @interface Area + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines the area property. + * + * @interface Area + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the area property. + * + * @interface Area + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the area property. + * + * @interface Area + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface Area { + /** + * Defines the width property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the width property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the width property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the width property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width: Length; + + /** + * Defines the height property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the height property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the height property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the height property. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height: Length; -declare type Margin = Padding; + /** + * Defines the local position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the local position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the local position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the local position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + position: Position; -declare type LocalizedMargin = LocalizedPadding; + /** + * Defines the global position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines the global position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the global position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the global position. + * + * @type { Position } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + globalPosition: Position; +} -declare type VoidCallback = () => void; +/** + * Defines the position. + * + * @interface Position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the position. + * + * @interface Position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the position. + * + * @interface Position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the position. + * + * @interface Position + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface Position { + /** + * Coordinate x of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Coordinate x of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Coordinate x of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Coordinate x of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + x?: Length; -declare interface SizeOptions { - width?: Length; - height?: Length; + /** + * Coordinate y of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Coordinate y of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Coordinate y of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Coordinate y of the Position. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + y?: Length; } +/** + * Defines the LocalizedPosition. + * + * @interface LocalizedPosition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface LocalizedPosition { + /** + * Coordinate start of the Position. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start?: LengthMetrics; + + /** + * Coordinate top of the Position. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + top?: LengthMetrics; +} + +/** + * Defines the Edges. + * + * @interface Edges + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ declare interface Edges { + /** + * top property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ top?: Dimension; + + /** + * left property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ left?: Dimension; + + /** + * bottom property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ bottom?: Dimension; + + /** + * right property. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ right?: Dimension; } +/** + * Defines the LocalizedEdges. + * + * @interface LocalizedEdges + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ declare interface LocalizedEdges { + /** + * top property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ top?: LengthMetrics; + + /** + * start property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ start?: LengthMetrics; + + /** + * bottom property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ bottom?: LengthMetrics; + + /** + * end property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ end?: LengthMetrics; -} \ No newline at end of file +} + +/** + * Defines the Bias. + * + * @interface Bias + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the Bias. + * + * @interface Bias + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface Bias { + /** + * Horizontal ratio of the Bias, it must be >= 0. + * + * @type { ?number } + * @default 0.5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Horizontal ratio of the Bias, it must be >= 0. + * + * @type { ?number } + * @default 0.5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + horizontal?: number; + + /** + * Vertical ratio of the Bias, it must be >= 0. + * + * @type { ?number } + * @default 0.5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Vertical ratio of the Bias, it must be >= 0. + * + * @type { ?number } + * @default 0.5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + vertical?: number; +} + +/** + * Defines the constrain size options. + * + * @interface ConstraintSizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the constrain size options. + * + * @interface ConstraintSizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the constrain size options. + * + * @interface ConstraintSizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the constrain size options. + * + * @interface ConstraintSizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface ConstraintSizeOptions { + /** + * Defines the min width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the min width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the min width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the min width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + minWidth?: Length; + + /** + * Defines the max width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the max width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the max width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the max width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + maxWidth?: Length; + + /** + * Defines the min height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the min height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the min height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the min height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + minHeight?: Length; + + /** + * Defines the max height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the max height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the max height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the max height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + maxHeight?: Length; +} + +/** + * Defines the size options. + * + * @interface SizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the size options. + * + * @interface SizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the size options. + * + * @interface SizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the size options. + * + * @interface SizeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare interface SizeOptions { + /** + * Defines the width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width?: Length; + + /** + * Defines the height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the height. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height?: Length; +} + +/** + * Defines the options of border. + * + * @interface BorderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of border. + * + * @interface BorderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of border. + * + * @interface BorderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of border. + * + * @interface BorderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +/** + * Defines the options of border. + * + * @interface BorderOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface BorderOptions { + /** + * Defines the border width. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the border width. + * + * @type { ?(EdgeWidths | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the border width. + * + * @type { ?(EdgeWidths | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the border width. + * + * @type { ?(EdgeWidths | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Defines the border width. + * + * @type { ?(EdgeWidths | Length | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + width?: EdgeWidths | Length | LocalizedEdgeWidths; + + /** + * Defines the border color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the border color. + * + * @type { ?(EdgeColors | ResourceColor) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the border color. + * + * @type { ?(EdgeColors | ResourceColor) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the border color. + * + * @type { ?(EdgeColors | ResourceColor) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Defines the border color. + * + * @type { ?(EdgeColors | ResourceColor | LocalizedEdgeColors) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + color?: EdgeColors | ResourceColor | LocalizedEdgeColors; + + /** + * Defines the border radius. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the border radius. + * + * @type { ?(BorderRadiuses | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the border radius. + * + * @type { ?(BorderRadiuses | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the border radius. + * + * @type { ?(BorderRadiuses | Length) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Defines the border radius. + * + * @type { ?(BorderRadiuses | Length | LocalizedBorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + radius?: BorderRadiuses | Length | LocalizedBorderRadiuses; + + /** + * Defines the border style. + * + * @type { ?BorderStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines the border style. + * + * @type { ?(EdgeStyles | BorderStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines the border style. + * + * @type { ?(EdgeStyles | BorderStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines the border style. + * + * @type { ?(EdgeStyles | BorderStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + style?: EdgeStyles | BorderStyle; + + /** + * Defines the gap of dash when BorderStyle is dashed. + * + * @type { ?(EdgeWidths | LengthMetrics | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dashGap?: EdgeWidths | LengthMetrics | LocalizedEdgeWidths; + + /** + * Defines the length of dash when BorderStyle is dashed. + * + * @type { ?(EdgeWidths | LengthMetrics | LocalizedEdgeWidths) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + dashWidth?: EdgeWidths | LengthMetrics | LocalizedEdgeWidths; +} + +/** + * Defines the options of border. + * + * @interface OutlineOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ +/** + * Defines the options of border. + * + * @interface OutlineOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface OutlineOptions { + /** + * Defines the outline width. + * + * @type { ?(EdgeOutlineWidths | Dimension) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the outline width. + * + * @type { ?(EdgeOutlineWidths | Dimension) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + width?: EdgeOutlineWidths | Dimension; + + /** + * Defines the outline color. + * + * @type { ?(EdgeColors | ResourceColor) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the outline color. + * + * @type { ?(EdgeColors | ResourceColor | LocalizedEdgeColors) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + color?: EdgeColors | ResourceColor | LocalizedEdgeColors; + + /** + * Defines the outline radius. + * + * @type { ?(OutlineRadiuses | Dimension) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the outline radius. + * + * @type { ?(OutlineRadiuses | Dimension) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + radius?: OutlineRadiuses | Dimension; + + /** + * Defines the outline style. + * + * @type { ?(EdgeOutlineStyles | OutlineStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 11 + */ + /** + * Defines the outline style. + * + * @type { ?(EdgeOutlineStyles | OutlineStyle) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + style?: EdgeOutlineStyles | OutlineStyle; +} + +/** + * Define the style of checkbox mark. + * + * @interface MarkStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Define the style of checkbox mark. + * + * @interface MarkStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface MarkStyle { + /** + * Define the stroke color of checkbox mark. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the stroke color of checkbox mark. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeColor?: ResourceColor; + + /** + * Define the size of checkbox mark. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the size of checkbox mark. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size?: Length; + + /** + * Define the stroke width of checkbox mark. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Define the stroke width of checkbox mark. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + strokeWidth?: Length; +} + +/** + * Defines the ColorFilter object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the ColorFilter object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the ColorFilter object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +declare class ColorFilter { + /** + * Creates ColorFilter with 4*5 matrix. + * + * @param { number[] } value 4*5 color matrix values. The value[m*n] is located in the m row and n column. The matrix is row-first. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Creates ColorFilter with 4*5 matrix. + * + * @param { number[] } value 4*5 color matrix values. The value[m*n] is located in the m row and n column. The matrix is row-first. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Creates ColorFilter with 4*5 matrix. + * + * @param { number[] } value 4*5 color matrix values. The value[m*n] is located in the m row and n column. The matrix is row-first. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + constructor(value: number[]); +} + +/** + * Defines TouchPoint + * + * @interface TouchPoint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ +/** + * Defines TouchPoint + * + * @interface TouchPoint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare interface TouchPoint { + /** + * Define the touch point x coordinate. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Define the touch point x coordinate. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + x: Dimension; + + /** + * Define the touch point y coordinate. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Define the touch point y coordinate. + * + * @type { Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + y: Dimension; +} + +/** + * Defines the DirectionalEdgesT interface. + * + * @interface DirectionalEdgesT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ +declare interface DirectionalEdgesT { + /** + * Start property. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + start: T; + + /** + * End property. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + end: T; + + /** + * Top property. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + top: T; + + /** + * Bottom property. + * + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + bottom: T; +} + +/** + * Defines the struct of DividerStyleOptions. + * + * @interface DividerStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface DividerStyleOptions { + /** + * The strokeWidth of Divider. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + strokeWidth?: LengthMetrics; + + /** + * The color of Divider. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + color?: ResourceColor; + + /** + * The startMargin of Divider. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + startMargin?: LengthMetrics; + + /** + * The endMargin of Divider. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + endMargin?: LengthMetrics; +} + +/** + * Defines the ChainWeightOptions interface. + * + * @interface ChainWeightOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface ChainWeightOptions { + /** + * Horizontal ChainWeight. + * + * @type { ?(number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + horizontal?: number; + + /** + * Vertical ChainWeight. + * + * @type { ?(number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + vertical?: number; +} + +/** + * Defines the struct of AccessibilityOptions. + * + * @interface AccessibilityOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface AccessibilityOptions { + /** + * accessibilityPreferred - Should accessibilityText be prioritized when contatenating child component strings. + * + * @type { ?(boolean) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityPreferred?: boolean; +} diff --git a/tests/arkts-subset/ets/vector.d.ts b/tests/arkts-subset/ets/vector.d.ts deleted file mode 100644 index c914e756..00000000 --- a/tests/arkts-subset/ets/vector.d.ts +++ /dev/null @@ -1,30 +0,0 @@ - -declare type Vector1 = { - x0: number - x1: number - x2: number - x3: number -} - -declare type Vector2 = { - t: number - x: number - y: number - z: number -} - -declare interface VectorInterface { - (): VectorAttribute -} -declare const Vector: VectorInterface - -declare class VectorAttribute extends CommonMethod { - - testVector1(value: Vector1): VectorAttribute - - testVector2(value: Vector2): VectorAttribute - - testUnionVector1Number(value: Vector1 | number): VectorAttribute - - testUnionVector2Number(value: Vector2 | number): VectorAttribute -} -- Gitee From 27753652d5678d992bbca6fe74a662c4b02bc02e Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Wed, 20 Nov 2024 15:15:47 +0000 Subject: [PATCH 44/53] !1007 Simpler vsync fix --- external | 2 +- predefined/sys/node.idl | 1 + templates/arkoala_api_prologue.h | 2 +- templates/arkoala_node_api.h | 7 +++---- templates/bridge_custom_prologue.cc | 31 +++++++++++++++++++++++++---- templates/dummy_impl_epilogue.cc | 1 - templates/dummy_impl_prologue.cc | 24 +++++++++------------- 7 files changed, 42 insertions(+), 26 deletions(-) diff --git a/external b/external index 675b0eaf..3d1eb3e0 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit 675b0eafd975fa4d8686ba1feba59846dcbe7a8d +Subproject commit 3d1eb3e08609cda04d0650278004f068cdde640f diff --git a/predefined/sys/node.idl b/predefined/sys/node.idl index a7796b13..33b00d4e 100644 --- a/predefined/sys/node.idl +++ b/predefined/sys/node.idl @@ -35,6 +35,7 @@ interface Node { pointer GetPipelineContext(pointer ptr0); // TODO: Actually Promise, fix! Object VSyncAwait(pointer pipeline); + void SetVsyncCallback(pointer pipeline); void UnblockVsyncWait(pointer pipeline); void SetChildTotalCount(pointer ptr0, i32 arg); void ShowCrash(String message); diff --git a/templates/arkoala_api_prologue.h b/templates/arkoala_api_prologue.h index a4e14cee..2b5cd2ed 100644 --- a/templates/arkoala_api_prologue.h +++ b/templates/arkoala_api_prologue.h @@ -26,7 +26,7 @@ #define %CPP_PREFIX%ARKUI_NODE_API_VERSION %CPP_PREFIX%ARKUI_FULL_API_VERSION #define %CPP_PREFIX%ARKUI_BASIC_NODE_API_VERSION 1 -#define %CPP_PREFIX%ARKUI_EXTENDED_NODE_API_VERSION 7 +#define %CPP_PREFIX%ARKUI_EXTENDED_NODE_API_VERSION 8 #define %CPP_PREFIX%ARKUI_NODE_GRAPHICS_API_VERSION 5 #define %CPP_PREFIX%ARKUI_NODE_MODIFIERS_API_VERSION 6 #define GENERIC_SERVICE_API_VERSION 1 diff --git a/templates/arkoala_node_api.h b/templates/arkoala_node_api.h index 21da1083..77239527 100644 --- a/templates/arkoala_node_api.h +++ b/templates/arkoala_node_api.h @@ -73,6 +73,8 @@ typedef struct GenericServiceAPI { void (*setLogger)(const ServiceLogger* logger); } GenericServiceAPI; +typedef void (*Ark_VsyncCallback)(Ark_PipelineContext); + typedef struct %CPP_PREFIX%ArkUIExtendedNodeAPI { Ark_Int32 version; @@ -137,10 +139,7 @@ typedef struct %CPP_PREFIX%ArkUIExtendedNodeAPI { /// Vsync support Ark_PipelineContext (*getPipelineContext)(Ark_NodeHandle node); void (*setVsyncCallback)(Ark_PipelineContext pipelineContext, - Ark_Deferred* deferred); - void (*unblockVsyncWait)(Ark_VMContext vmContext, - Ark_PipelineContext pipelineContext); - + Ark_VsyncCallback callback); void (*setChildTotalCount)(Ark_NodeHandle node, Ark_Int32 totalCount); diff --git a/templates/bridge_custom_prologue.cc b/templates/bridge_custom_prologue.cc index 3d9fb744..f4278c8f 100644 --- a/templates/bridge_custom_prologue.cc +++ b/templates/bridge_custom_prologue.cc @@ -343,22 +343,45 @@ void impl_SetLazyItemIndexer(KVMContext vmContext, Ark_NativePointer nodePtr, Ar } KOALA_INTEROP_CTX_V2(SetLazyItemIndexer, Ark_NativePointer, Ark_Int32) +KVMDeferred* vsyncDeferred = nullptr; + +// TODO: map if multiple pipeline contexts. +static KVMDeferred* currentVsyncDeferred = nullptr; + +void vsyncCallback(Ark_PipelineContext context) { + if (currentVsyncDeferred) { + currentVsyncDeferred->resolve(currentVsyncDeferred, nullptr, 0); + currentVsyncDeferred = nullptr; + } +} + +void impl_SetVsyncCallback(Ark_NativePointer pipelineContext) +{ + Ark_PipelineContext pipelineContextCast = (Ark_PipelineContext) pipelineContext; + GetArkUIExtendedNodeAPI()->setVsyncCallback(pipelineContextCast, vsyncCallback); +} +KOALA_INTEROP_V1(SetVsyncCallback, Ark_NativePointer) KVMObjectHandle impl_VSyncAwait(KVMContext vmContext, Ark_NativePointer pipelineContext) { Ark_PipelineContext pipelineContextCast = (Ark_PipelineContext) pipelineContext; KVMObjectHandle result = nullptr; KVMDeferred* deferred = CreateDeferred(vmContext, &result); - GetArkUIExtendedNodeAPI()->setVsyncCallback(pipelineContextCast, (Ark_Deferred*)deferred); + if (currentVsyncDeferred) { + fprintf(stderr, "Multiple unresolved vsync deferred\n"); + currentVsyncDeferred->reject(currentVsyncDeferred, "Wrong"); + } + currentVsyncDeferred = deferred; return result; } KOALA_INTEROP_CTX_1(VSyncAwait, KVMObjectHandle, Ark_NativePointer) void impl_UnblockVsyncWait(KVMContext vmContext, Ark_NativePointer pipelineContext) { - Ark_VMContext vmContextCast = (Ark_VMContext) vmContext; - Ark_PipelineContext pipelineContextCast = (Ark_PipelineContext) pipelineContext; - GetArkUIExtendedNodeAPI()->unblockVsyncWait(vmContextCast, pipelineContextCast); + if (currentVsyncDeferred) { + currentVsyncDeferred->resolve(currentVsyncDeferred, nullptr, 0); + currentVsyncDeferred = nullptr; + } } KOALA_INTEROP_CTX_V1(UnblockVsyncWait, Ark_NativePointer) diff --git a/templates/dummy_impl_epilogue.cc b/templates/dummy_impl_epilogue.cc index e52a89d8..54594ebb 100644 --- a/templates/dummy_impl_epilogue.cc +++ b/templates/dummy_impl_epilogue.cc @@ -52,7 +52,6 @@ const %CPP_PREFIX%ArkUIExtendedNodeAPI* %CPP_PREFIX%GetExtendedAPI() OHOS::Ace::NG::ApiImpl::SetLazyItemIndexer, OHOS::Ace::NG::ApiImpl::GetPipelineContext, OHOS::Ace::NG::ApiImpl::SetVsyncCallback, - OHOS::Ace::NG::ApiImpl::UnblockVsyncWait, OHOS::Ace::NG::ApiImpl::SetChildTotalCount, OHOS::Ace::NG::ApiImpl::ShowCrash }; diff --git a/templates/dummy_impl_prologue.cc b/templates/dummy_impl_prologue.cc index 7b63e046..f8610248 100644 --- a/templates/dummy_impl_prologue.cc +++ b/templates/dummy_impl_prologue.cc @@ -770,25 +770,19 @@ Ark_Int32 IndexerChecker(Ark_VMContext vmContext, Ark_NodeHandle nodePtr) { void SetRangeUpdater(Ark_NodeHandle nodePtr, Ark_Int32 updaterId) {} void SetLazyItemIndexer(Ark_VMContext vmContext, Ark_NodeHandle nodePtr, Ark_Int32 indexerId) {} Ark_PipelineContext GetPipelineContext(Ark_NodeHandle node) { - return nullptr; + return (Ark_PipelineContext)42; } -Ark_Deferred* currentVsyncWait = nullptr; -void SetVsyncCallback(Ark_PipelineContext pipelineContext, Ark_Deferred* deferred) { - auto delayed_call = std::async(std::launch::async, [deferred] { - currentVsyncWait = deferred; - std::this_thread::sleep_for(1000ms); - if (currentVsyncWait) - deferred->resolve(currentVsyncWait, nullptr, 0); - currentVsyncWait = nullptr; +void SetVsyncCallback(Ark_PipelineContext pipelineContext, Ark_VsyncCallback callback) { + auto producer = std::thread([pipelineContext, callback] { + while (true) { + std::this_thread::sleep_for(1000ms); + callback(pipelineContext); + } }); + producer.detach(); } -void UnblockVsyncWait(Ark_VMContext vmContext, Ark_PipelineContext pipelineContext) { - if (currentVsyncWait) { - currentVsyncWait->reject(currentVsyncWait, "Reject vsync"); - currentVsyncWait = nullptr; - } -} + void SetChildTotalCount(Ark_NodeHandle node, Ark_Int32 totalCount) {} void ShowCrash(Ark_CharPtr message) {} } -- Gitee From e5b6fcc67b2840838891ea765a6289cab112b88a Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Wed, 20 Nov 2024 18:23:19 +0300 Subject: [PATCH 45/53] Move external Signed-off-by: Nikolay Igotti --- external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external b/external index 3d1eb3e0..87f7a9e1 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit 3d1eb3e08609cda04d0650278004f068cdde640f +Subproject commit 87f7a9e1aacd4f9ff9dc6ee80f5072b6ab0a884b -- Gitee From 90141d063130a2918ee72aaf02a2a6982aea1814 Mon Sep 17 00:00:00 2001 From: tsvetkovaelena Date: Wed, 20 Nov 2024 17:25:33 +0000 Subject: [PATCH 46/53] !1006 Restore arkts-subset * Returned deleted d.ts files from arkts-subset --- tests/arkts-subset/ets/calendar_picker.d.ts | 18 + tests/arkts-subset/ets/canvas.d.ts | 150 + tests/arkts-subset/ets/counter.d.ts | 29 + tests/arkts-subset/ets/divider.d.ts | 25 + .../arkts-subset/ets/embedded_component.d.ts | 34 + tests/arkts-subset/ets/flex.d.ts | 40 + tests/arkts-subset/ets/form_component.d.ts | 19 + tests/arkts-subset/ets/grid_container.d.ts | 179 + tests/arkts-subset/ets/list_item.d.ts | 102 + tests/arkts-subset/ets/matrix2d.d.ts | 47 + tests/arkts-subset/ets/nav_destination.d.ts | 723 ++++ tests/arkts-subset/ets/navigation.d.ts | 2990 +++++++++++++++++ tests/arkts-subset/ets/navigator.d.ts | 28 + tests/arkts-subset/ets/particle.d.ts | 26 + tests/arkts-subset/ets/row.d.ts | 30 + .../arkts-subset/ets/security_component.d.ts | 3 + tests/arkts-subset/ets/select.d.ts | 42 + tests/arkts-subset/ets/shape.d.ts | 11 + tests/arkts-subset/ets/sidebar.d.ts | 12 + tests/arkts-subset/ets/slider.d.ts | 24 + tests/arkts-subset/ets/stack.d.ts | 31 + tests/arkts-subset/ets/tab_content.d.ts | 108 + tests/arkts-subset/ets/tabs.d.ts | 57 + tests/arkts-subset/ets/test.d.ts | 294 ++ tests/arkts-subset/ets/text.d.ts | 61 + tests/arkts-subset/ets/toggle.d.ts | 40 + .../ets/ui_extension_component.d.ts | 72 + tests/arkts-subset/ets/vector.d.ts | 30 + 28 files changed, 5225 insertions(+) create mode 100644 tests/arkts-subset/ets/calendar_picker.d.ts create mode 100644 tests/arkts-subset/ets/canvas.d.ts create mode 100644 tests/arkts-subset/ets/counter.d.ts create mode 100644 tests/arkts-subset/ets/divider.d.ts create mode 100644 tests/arkts-subset/ets/embedded_component.d.ts create mode 100644 tests/arkts-subset/ets/flex.d.ts create mode 100644 tests/arkts-subset/ets/form_component.d.ts create mode 100644 tests/arkts-subset/ets/grid_container.d.ts create mode 100644 tests/arkts-subset/ets/list_item.d.ts create mode 100644 tests/arkts-subset/ets/matrix2d.d.ts create mode 100644 tests/arkts-subset/ets/nav_destination.d.ts create mode 100644 tests/arkts-subset/ets/navigation.d.ts create mode 100644 tests/arkts-subset/ets/navigator.d.ts create mode 100644 tests/arkts-subset/ets/particle.d.ts create mode 100644 tests/arkts-subset/ets/row.d.ts create mode 100644 tests/arkts-subset/ets/security_component.d.ts create mode 100644 tests/arkts-subset/ets/select.d.ts create mode 100644 tests/arkts-subset/ets/shape.d.ts create mode 100644 tests/arkts-subset/ets/sidebar.d.ts create mode 100644 tests/arkts-subset/ets/slider.d.ts create mode 100644 tests/arkts-subset/ets/stack.d.ts create mode 100644 tests/arkts-subset/ets/tab_content.d.ts create mode 100644 tests/arkts-subset/ets/tabs.d.ts create mode 100644 tests/arkts-subset/ets/test.d.ts create mode 100644 tests/arkts-subset/ets/text.d.ts create mode 100644 tests/arkts-subset/ets/toggle.d.ts create mode 100644 tests/arkts-subset/ets/ui_extension_component.d.ts create mode 100644 tests/arkts-subset/ets/vector.d.ts diff --git a/tests/arkts-subset/ets/calendar_picker.d.ts b/tests/arkts-subset/ets/calendar_picker.d.ts new file mode 100644 index 00000000..5744287f --- /dev/null +++ b/tests/arkts-subset/ets/calendar_picker.d.ts @@ -0,0 +1,18 @@ + +declare enum CalendarAlign { + START = 0, + CENTER = 1, + END = 2 +} + +declare interface CalendarPickerInterface { + (): CalendarPickerAttribute +} + +declare class CalendarPickerAttribute extends CommonMethod { + edgeAlign(alignType: CalendarAlign, offset?: Offset): CalendarPickerAttribute; + + altEdgeAlign(alignType: CalendarAlign, offset?: AltOffset): CalendarPickerAttribute; +} + +declare const CalendarPicker: CalendarPickerInterface \ No newline at end of file diff --git a/tests/arkts-subset/ets/canvas.d.ts b/tests/arkts-subset/ets/canvas.d.ts new file mode 100644 index 00000000..991319cc --- /dev/null +++ b/tests/arkts-subset/ets/canvas.d.ts @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2024 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 type CanvasFillRule = "evenodd" | "nonzero"; + +declare class ImageData { + + readonly data: Uint8ClampedArray; + + readonly height: number; + + readonly width: number; + + constructor(width: number, height: number, data?: Uint8ClampedArray); + + constructor(width: number, height: number, data?: Uint8ClampedArray, unit?: LengthMetricsUnit); +} + +declare interface CanvasPattern { + + setTransform(transform?: Matrix2D): void; +} + +// interface ImageBitmap { + +// readonly height: number; + +// readonly width: number; + +// close(): void; +// } + + +declare class CanvasPath { + + rect(x: number, y: number, w: number, h: number): void; + + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; + + closePath(): void; +} + +declare class CanvasGradient { + + addColorStop(offset: number, color: string): void; +} + +declare class CanvasRenderer extends CanvasPath { + + globalAlpha: number; + + globalCompositeOperation: string; + + fillStyle: string | number | CanvasGradient | CanvasPattern; + + // drawImage(image: ImageBitmap | PixelMap, dx: number, dy: number): void; + + beginPath(): void; + + clip(fillRule?: CanvasFillRule): void; + + reset(): void; + + putImageData(imagedata: ImageData, dx: number | string, dy: number | string): void; + + putImageData( + imagedata: ImageData, + dx: number | string, + dy: number | string, + dirtyX: number | string, + dirtyY: number | string, + dirtyWidth: number | string, + dirtyHeight: number | string + ): void; + +} + +declare class RenderingContextSettings { + + antialias?: boolean; + + constructor(antialias?: boolean); +} + +declare class CanvasRenderingContext2D extends CanvasRenderer { + + readonly height: number; + + readonly width: number; + + stopImageAnalyzer(): void; + + constructor(settings?: RenderingContextSettings); + + static of(): CanvasRenderingContext2D +} + +declare interface DrawingCanvas {} +declare interface Size { + width: number; + height: number; +} +declare class ImageBitmap { + constructor(src: string); + constructor(src: string, unit: LengthMetricsUnit); + constructor(data: PixelMap); + constructor(data: PixelMap, unit: LengthMetricsUnit); + close(): void; +} + +declare class DrawingRenderingContext { + + get size(): Size; + + get canvas(): DrawingCanvas; + + invalidate(): void; + + constructor(unit?: LengthMetricsUnit); +} + +interface CanvasInterface { + + (context?: CanvasRenderingContext2D | DrawingRenderingContext): CanvasAttribute; +} + +declare class CanvasAttribute extends CommonMethod { + + onReady(event: () => void): CanvasAttribute; + + enableAnalyzer(enable: boolean): CanvasAttribute; +} + +declare const Canvas: CanvasInterface; + +declare const CanvasInstance: CanvasAttribute; + + diff --git a/tests/arkts-subset/ets/counter.d.ts b/tests/arkts-subset/ets/counter.d.ts new file mode 100644 index 00000000..7577a72b --- /dev/null +++ b/tests/arkts-subset/ets/counter.d.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2024 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. + */ + + +interface CounterInterface { + (): CounterAttribute; + } + + declare class CounterAttribute extends CommonMethod { + onInc(event: VoidCallback): CounterAttribute; + onDec(event: VoidCallback): CounterAttribute; + enableDec(value: boolean): CounterAttribute; + enableInc(value: boolean): CounterAttribute; + } + declare const CounterInstance: CounterAttribute; + declare const Counter: CounterInterface; + \ No newline at end of file diff --git a/tests/arkts-subset/ets/divider.d.ts b/tests/arkts-subset/ets/divider.d.ts new file mode 100644 index 00000000..1bbc5daf --- /dev/null +++ b/tests/arkts-subset/ets/divider.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 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. + */ + +interface DividerInterface { + (): DividerAttribute; + } + + declare class DividerAttribute extends CommonMethod { + vertical(value: boolean): DividerAttribute; + color(value: ResourceColor): DividerAttribute; + strokeWidth(value: number | string): DividerAttribute; + lineCap(value: LineCapStyle): DividerAttribute; + } \ No newline at end of file diff --git a/tests/arkts-subset/ets/embedded_component.d.ts b/tests/arkts-subset/ets/embedded_component.d.ts new file mode 100644 index 00000000..7af16134 --- /dev/null +++ b/tests/arkts-subset/ets/embedded_component.d.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 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. + */ + +interface EmbeddedComponentInterface { + ( + loader: import('../api/@ohos.app.ability.Want').default, + type: EmbeddedType + ): EmbeddedComponentAttribute; +} + +declare interface TerminationInfo { + code: number; + want?: import('../api/@ohos.app.ability.Want').default; +} + +declare class EmbeddedComponentAttribute extends CommonMethod { + onTerminated(callback: import('../api/@ohos.base').Callback): EmbeddedComponentAttribute; + onError(callback: import('../api/@ohos.base').ErrorCallback): EmbeddedComponentAttribute; +} + +declare const EmbeddedComponent: EmbeddedComponentInterface; +declare const EmbeddedComponentInstance: EmbeddedComponentAttribute; diff --git a/tests/arkts-subset/ets/flex.d.ts b/tests/arkts-subset/ets/flex.d.ts new file mode 100644 index 00000000..66818f8d --- /dev/null +++ b/tests/arkts-subset/ets/flex.d.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 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 interface FlexOptions { + direction?: FlexDirection; + wrap?: FlexWrap; + justifyContent?: FlexAlign; + alignItems?: ItemAlign; + alignContent?: FlexAlign; + space?: FlexSpaceOptions; +} + +declare interface FlexSpaceOptions { + main?: LengthMetrics; + cross?: LengthMetrics; +} + +interface FlexInterface { + (value?: FlexOptions): FlexAttribute; +} + +declare class FlexAttribute extends CommonMethod { + pointLight(value: PointLightStyle): FlexAttribute; +} + +declare const Flex: FlexInterface; + +declare const FlexInstance: FlexAttribute; diff --git a/tests/arkts-subset/ets/form_component.d.ts b/tests/arkts-subset/ets/form_component.d.ts new file mode 100644 index 00000000..e04095b3 --- /dev/null +++ b/tests/arkts-subset/ets/form_component.d.ts @@ -0,0 +1,19 @@ + +interface FormCallbackInfo { + + id: number; + idString: string; +} + +declare interface FormComponentInterface { + (): FormComponentAttribute +} + +declare class FormComponentAttribute extends CommonMethod { + + size(value: { width: number; height: number }): FormComponentAttribute; + + onAcquired(callback: Callback): FormComponentAttribute; +} + +declare const FormComponent: FormComponentInterface \ No newline at end of file diff --git a/tests/arkts-subset/ets/grid_container.d.ts b/tests/arkts-subset/ets/grid_container.d.ts new file mode 100644 index 00000000..8ad219f2 --- /dev/null +++ b/tests/arkts-subset/ets/grid_container.d.ts @@ -0,0 +1,179 @@ +/* + * 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the size type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead grid_col/GridColColumnOption and grid_row/GridRowColumnOption + */ +declare enum SizeType { + /** + * Select a value based on the device type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + Auto, + + /** + * Select a value based on the device type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + XS, + + /** + * Small width type device. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + SM, + + /** + * Medium width type device. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + MD, + + /** + * Large width type device. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + LG, +} + +/** + * Defines the options of GridContainer. + * + * @interface GridContainerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead grid_col/GridColOptions and grid_row/GridRowOptions + */ +declare interface GridContainerOptions { + /** + * Sets the total number of columns in the current layout. + * + * @type { ?(number | "auto") } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + columns?: number | "auto"; + + /** + * Select the device width type. + * + * @type { ?SizeType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + sizeType?: SizeType; + + /** + * Grid layout column spacing. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + gutter?: number | string; + + /** + * Spacing on both sides of the grid layout. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + margin?: number | string; +} + +/** + * Defines the GridContainer component. + * + * @interface GridContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead grid_col/GridColInterface and grid_row/GridRowInterface + */ +interface GridContainerInterface { + /** + * Defines the constructor of GridContainer. + * + * @param { GridContainerOptions } value + * @returns { GridContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + */ + (value?: GridContainerOptions): GridContainerAttribute; +} + +/** + * Defines the grid container attribute from inheritance Column + * + * @extends ColumnAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead grid_col/GridColAttribute and grid_row/GridRowAttribute + */ +declare class GridContainerAttribute extends ColumnAttribute {} + +/** + * Defines GridContainer Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead grid_col/GridColColumnOption and grid_row/GridRowColumnOption + */ +declare const GridContainer: GridContainerInterface + +/** + * Defines GridContainer Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + * @deprecated since 9 + * @useinstead grid_col/GridColAttribute and grid_row/GridRowAttribute + */ +declare const GridContainerInstance: GridContainerAttribute; diff --git a/tests/arkts-subset/ets/list_item.d.ts b/tests/arkts-subset/ets/list_item.d.ts new file mode 100644 index 00000000..4699ca2f --- /dev/null +++ b/tests/arkts-subset/ets/list_item.d.ts @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2024 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 enum Sticky { + None, + Normal, + Opacity, +} + +declare enum EditMode { + None, + Deletable, + Movable, +} + + +declare enum SwipeEdgeEffect { + Spring, + None, +} + +declare enum SwipeActionState { + COLLAPSED, + EXPANDED, + ACTIONING, +} + +declare interface SwipeActionItem { + + builder?: CustomBuilder; + + actionAreaDistance?: Length; + + onAction?: () => void; + + onEnterActionArea?: () => void; + + onExitActionArea?: () => void; + + onStateChange?: (state: SwipeActionState) => void; +} + +declare interface SwipeActionOptions { + + start?: CustomBuilder | SwipeActionItem; + + + end?: CustomBuilder | SwipeActionItem; + + + edgeEffect?: SwipeEdgeEffect; + + + onOffsetChange?: (offset: number) => void; +} + +declare enum ListItemStyle { + + NONE = 0, + + CARD = 1, +} + +declare interface ListItemOptions { + style?: ListItemStyle; +} + +interface ListItemInterface { + (value?: ListItemOptions): ListItemAttribute; + (value?: string): ListItemAttribute; +} + +declare class ListItemAttribute extends CommonMethod { + sticky(value: Sticky): ListItemAttribute; + + editable(value: boolean | EditMode): ListItemAttribute; + + selectable(value: boolean): ListItemAttribute; + + selected(value: boolean): ListItemAttribute; + + swipeAction(value: SwipeActionOptions): ListItemAttribute; + + onSelect(event: (isSelected: boolean) => void): ListItemAttribute; +} + +declare const ListItemInstance: ListItemAttribute; + +declare const ListItem: ListItemInterface; + diff --git a/tests/arkts-subset/ets/matrix2d.d.ts b/tests/arkts-subset/ets/matrix2d.d.ts new file mode 100644 index 00000000..f86bad7d --- /dev/null +++ b/tests/arkts-subset/ets/matrix2d.d.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2024 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 class Matrix2D { + + scaleX?: number; + + rotateY?: number; + + rotateX?: number; + + scaleY?: number; + + translateX?: number; + + translateY?: number; + + identity(): Matrix2D; + + invert(): Matrix2D; + + multiply(other?: Matrix2D): Matrix2D; + + rotate(rx?: number, ry?: number): Matrix2D; + + rotate(degree: number, rx?: number, ry?: number): Matrix2D; + + translate(tx?: number, ty?: number): Matrix2D; + + scale(sx?: number, sy?: number): Matrix2D; + + constructor(); + + constructor(unit: LengthMetricsUnit); +} diff --git a/tests/arkts-subset/ets/nav_destination.d.ts b/tests/arkts-subset/ets/nav_destination.d.ts new file mode 100644 index 00000000..b0d2a349 --- /dev/null +++ b/tests/arkts-subset/ets/nav_destination.d.ts @@ -0,0 +1,723 @@ +/* + * Copyright (c) 2022-2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Defines the navigation destination common title. + * + * @interface NavDestinationCommonTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the navigation destination common title. + * + * @interface NavDestinationCommonTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the navigation destination common title. + * + * @interface NavDestinationCommonTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface NavDestinationCommonTitle { + /** + * Sets the main title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the main title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the main title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + main: string; + + /** + * Sets the sub title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the sub title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the sub title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + sub: string; +} + +/** + * Defines the navigation destination custom title. + * + * @interface NavDestinationCustomTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the navigation destination custom title. + * + * @interface NavDestinationCustomTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the navigation destination custom title. + * + * @interface NavDestinationCustomTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface NavDestinationCustomTitle { + /** + * Sets the custom title builder. + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the custom title builder. + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the custom title builder. + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + builder: CustomBuilder; + + /** + * Sets the custom title height. + * + * @type { TitleHeight | Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the custom title height. + * + * @type { TitleHeight | Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the custom title height. + * + * @type { TitleHeight | Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + height: TitleHeight | Length; +} + +/** + * NavDestination mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * NavDestination mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum NavDestinationMode { + /** + * Standard mode is default mode of NavDestination. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Standard mode is default mode of NavDestination. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + STANDARD = 0, + + /** + * Dialog mode is transparent by default and does not affect the life cycle of other NavDestination. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Dialog mode is transparent by default and does not affect the life cycle of other NavDestination. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DIALOG = 1, +} + +/** + * The construct function of NavDestination. + * + * @interface NavDestinationInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * The construct function of NavDestination. + * + * @interface NavDestinationInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The construct function of NavDestination. + * + * @interface NavDestinationInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface NavDestinationInterface { + /** + * Constructor. + * + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Constructor. + * + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Constructor. + * + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (): NavDestinationAttribute; +} + +/** + * Indicates configuration info of destination. + * + * @interface RouteMapConfig + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface RouteMapConfig { + /** + * Get destination name. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + name: string; + + /** + * Get destination builder file position + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pageSourceFile: string; + + /** + * Indicate the custom data of current destination. + * + * @type { Object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + data: Object +} + +/** + * Indicates the context of NavDestination. + * + * @interface NavDestinationContext + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface NavDestinationContext { + /** + * Get path info. + * + * @type { NavPathInfo } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pathInfo: NavPathInfo; + + /** + * Get stack of the Navigation where the NavDestination is located. + * + * @type { NavPathStack } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pathStack: NavPathStack; + + /** + * Get the unique id of NavDestination, which is different from common property id of Component. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + navDestinationId?: string; + + /** + * Get configuration of current Destination in module.json + * + * @returns {RouteMapConfig | undefined} + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + getConfigInRouteMap(): RouteMapConfig | undefined; +} + +/** + * The attribute function of NavDestination + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * The attribute function of NavDestination + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The attribute function of NavDestination + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class NavDestinationAttribute extends CommonMethod { + /** + * Navigation title bar + * + * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Navigation title bar + * + * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Navigation title bar + * + * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * NavDestination title bar + * + * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value + * @param { NavigationTitleOptions } [options] - Indicates the options of titlebar. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + title(value: string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle, options?: NavigationTitleOptions): NavDestinationAttribute; + + /** + * Hide navigation title bar + * + * @param { boolean } value + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Hide navigation title bar + * + * @param { boolean } value + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Hide navigation title bar + * + * @param { boolean } value + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hideTitleBar(value: boolean): NavDestinationAttribute; + + /** + * Invoked when the navDestination page is displayed. + * + * @param { function } callback - Indicates callback when the navDestination page is displayed. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoked when the navDestination page is displayed. + * + * @param { function } callback - Indicates callback when the navDestination page is displayed. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onShown(callback: () => void): NavDestinationAttribute; + + /** + * Invoked when the navDestination is hidden. + * + * @param { function } callback - Indicates callback when the navDestination is hidden. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoked when the navDestination is hidden. + * + * @param { function } callback - Indicates callback when the navDestination is hidden. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onHidden(callback: () => void): NavDestinationAttribute; + + /** + * Invoked when the backButton is pressed. + * + * @param { function } callback - Indicates callback when the backButton is pressed. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Invoked when the backButton is pressed. + * + * @param { function } callback - Indicates callback when the backButton is pressed. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onBackPressed(callback: () => boolean): NavDestinationAttribute; + + /** + * Sets the different mode of NavDestination. + * + * @param { NavDestinationMode } value - NavDestinationMode + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets the different mode of NavDestination. + * + * @param { NavDestinationMode } value - NavDestinationMode + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + mode(value: NavDestinationMode): NavDestinationAttribute; + + /** + * Set back button icon. + * + * @param { ResourceStr | PixelMap } value - Indicates icon of back button. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set back button icon. + * + * @param { ResourceStr | PixelMap | SymbolGlyphModifier } value - Indicates icon of back button. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backButtonIcon(value: ResourceStr | PixelMap | SymbolGlyphModifier): NavDestinationAttribute; + + /** + * NavDestination title bar's menus + * + * @param { Array | CustomBuilder } value + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + menus(value: Array | CustomBuilder): NavDestinationAttribute; + + /** + * Invoked before sub-components of NavDestination are created. + * + * @param { import('../api/@ohos.base').Callback } callback + * - Indicates callback that invoked before sub-components of NavDestination are created. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReady(callback: import('../api/@ohos.base').Callback): NavDestinationAttribute; + + /** + * Invoked before the navDestination is appeared. + * + * @param { Callback } callback - Indicates callback before the navDestination is appeared. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillAppear(callback: Callback): NavDestinationAttribute; + + /** + * Invoked before the navDestination is disappeared. + * + * @param { Callback } callback - Indicates callback before the navDestination is disappeared. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillDisappear(callback: Callback): NavDestinationAttribute; + + /** + * Invoked before the navDestination is displayed. + * + * @param { Callback } callback - Indicates callback before the navDestination is displayed. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillShow(callback: Callback): NavDestinationAttribute; + + /** + * Invoked before the navDestination is hidden. + * + * @param { Callback } callback - Indicates callback before the navDestination is hidden. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onWillHide(callback: Callback): NavDestinationAttribute; + + /** + * Set navDestination content expand types and edges. + * + * @param { Array } [types] - Indicates the types of the safe area. + * @param { Array } [edges] - Indicates the edges of the safe area. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ignoreLayoutSafeArea(types?: Array, edges?: Array): NavDestinationAttribute; + + /** + * Set the style of system bar + * + * @param { Optional } style - The properties of system bar + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + systemBarStyle(style: Optional): NavDestinationAttribute; +} + +/** + * Defines NavDestination Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines NavDestination Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines NavDestination Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const NavDestination: NavDestinationInterface; + +/** + * Defines NavDestination Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines NavDestination Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines NavDestination Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const NavDestinationInstance: NavDestinationAttribute; diff --git a/tests/arkts-subset/ets/navigation.d.ts b/tests/arkts-subset/ets/navigation.d.ts new file mode 100644 index 00000000..b134b2ac --- /dev/null +++ b/tests/arkts-subset/ets/navigation.d.ts @@ -0,0 +1,2990 @@ +/* + * Copyright (c) 2021-2024 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. + */ + +/** + * @file + * @kit ArkUI + */ + +/** + * Import the SystemBarStyle type for Navigation. + * + * @typedef { import('../api/@ohos.window').default.SystemBarStyle } SystemBarStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +declare type SystemBarStyle = import('../api/@ohos.window').default.SystemBarStyle; + +/** + * Defines the navigation common title. + * + * @interface NavigationCommonTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the navigation common title. + * + * @interface NavigationCommonTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the navigation common title. + * + * @interface NavigationCommonTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface NavigationCommonTitle { + /** + * Sets the main title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the main title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the main title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + main: string; + + /** + * Sets the sub title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the sub title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the sub title. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + sub: string; +} + +/** + * Defines the navigation custom title. + * + * @interface NavigationCustomTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Defines the navigation custom title. + * + * @interface NavigationCustomTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the navigation custom title. + * + * @interface NavigationCustomTitle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface NavigationCustomTitle { + /** + * Sets the custom title builder. + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the custom title builder. + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the custom title builder. + * + * @type { CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + builder: CustomBuilder; + + /** + * Sets the custom title height. + * + * @type { TitleHeight | Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the custom title height. + * + * @type { TitleHeight | Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the custom title height. + * + * @type { TitleHeight | Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + height: TitleHeight | Length; +} + + +/** + * Navigation mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Navigation mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Navigation mode + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum NavigationMode { + /** + * The navigation bar and the content area are displayed in stack. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The navigation bar and the content area are displayed in stack. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The navigation bar and the content area are displayed in stack. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Stack, + + /** + * The navigation bar and the content area are displayed side by side. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The navigation bar and the content area are displayed side by side. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The navigation bar and the content area are displayed side by side. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Split, + + /** + * If the window width is greater than 520vp, the navigation component is displayed in split mode. + * Otherwise it's displayed in stack mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * If the window width is greater than the sum of minNavBarWidth and minContentWidth, the navigation component is displayed in split mode. + * Otherwise it's displayed in stack mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * If the window width is greater than the sum of minNavBarWidth and minContentWidth, the navigation component is displayed in split mode. + * Otherwise it's displayed in stack mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Auto, +} + +/** + * Navigation bar position + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ +/** + * Navigation bar position + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Navigation bar position + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum NavBarPosition { + /** + * The navigation bar is on the Start of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The navigation bar is on the Start of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The navigation bar is on the Start of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Start, + + /** + * The navigation bar is on the End of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * The navigation bar is on the End of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The navigation bar is on the End of the container + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + End, +} + +/** + * Navigation title mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Navigation title mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Navigation title mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum NavigationTitleMode { + /** + * The title is free mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The title is free mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The title is free mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Free = 0, + + /** + * The title is full mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The title is full mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The title is full mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Full, + + /** + * The title is mini mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The title is mini mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The title is mini mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Mini, +} + +/** + * Navigation menu item, include menu icon and menu info + * + * @interface NavigationMenuItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Navigation menu item, include menu icon and menu info + * + * @interface NavigationMenuItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Navigation menu item, include menu icon and menu info + * + * @interface NavigationMenuItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface NavigationMenuItem { + /** + * The value of navigation menu item. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The value of navigation menu item. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of navigation menu item. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string; + + /** + * The icon of navigation menu item. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The icon of navigation menu item. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The icon of navigation menu item. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + icon?: string; + + /** + * The symbol of navigation menu item. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolIcon?: SymbolGlyphModifier; + + /** + * Whether to enable this menu item. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isEnabled?: boolean; + + /** + * Trigger by navigation menu item click. + * + * @type { ?(() => void) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger by navigation menu item click. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger by navigation menu item click. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + action?: () => void; +} + +/** + * Indicates the information of the popped page. + * + * @interface PopInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Indicates the information of the popped page. + * + * @interface PopInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface PopInfo { + /** + * The info of the popped page. + * + * @type { NavPathInfo } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The info of the popped page. + * + * @type { NavPathInfo } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + info: NavPathInfo; + + /** + * The result of the popped page. + * + * @type { Object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The result of the popped page. + * + * @type { Object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + result: Object; +} + +/** + * Indicates the information of NavDestination. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Indicates the information of NavDestination. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class NavPathInfo { + /** + * Creates an instance of NavPathInfo. + * + * @param { string } name - The name of NavDestination. + * @param { unknown } param - The detailed parameter of the NavDestination. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Creates an instance of NavPathInfo. + * + * @param { string } name - The name of NavDestination. + * @param { unknown } param - The detailed parameter of the NavDestination. + * @param { import('../api/@ohos.base').Callback } onPop - The callback when next page returns. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(name: string, param: unknown, onPop?: import('../api/@ohos.base').Callback); + + /** + * The name of NavDestination. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The name of NavDestination. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + name: string; + + /** + * The detailed parameter of the NavDestination. + * + * @type { ?unknown } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The detailed parameter of the NavDestination. + * + * @type { ?unknown } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + param?: unknown; + + /** + * The callback when next page returns. + * + * @type { ?import('../api/@ohos.base').Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * The callback when next page returns. + * + * @type { ?import('../api/@ohos.base').Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onPop?: import('../api/@ohos.base').Callback; +} + +/** + * Defines the mode of stack operation. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum LaunchMode { + /** + * The default mode of stack operation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + STANDARD = 0, + + /** + * When the NavDestination with a specified name exists, it will be moved to top of stack, + * otherwise, the behavior will be consistent with the STANDARD mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + MOVE_TO_TOP_SINGLETON = 1, + + /** + * When the NavDestination with a specified name exists, the stack will pop until that NavDestination, + * otherwise, the behavior will be consistent with the STANDARD mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + POP_TO_SINGLETON = 2, + + /** + * Forced to create a new NavDestination instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + NEW_INSTANCE = 3, +} + +/** + * Indicates the options of stack operation. + * + * @interface NavigationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface NavigationOptions { + /** + * Indicates the launchMode of stack operation. + * + * @type { ?LaunchMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + launchMode?: LaunchMode; + + /** + * Indicates whether the transition is animated. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + animated?: boolean; +} + +/** + * Indicates the information of NavDestinations. Providers methods for controlling destination page in the stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Indicates the information of NavDestinations. Providers methods for controlling destination page in the stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class NavPathStack { + /** + * Creates an instance of NavPathStack. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Creates an instance of NavPathStack. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + constructor(); + + /** + * Pushes the NavDestination into the stack. + * + * @param { NavPathInfo } info - Indicates the NavDestination to be pushed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pushes the NavDestination into the stack. + * + * @param { NavPathInfo } info - Indicates the NavDestination to be pushed. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pushPath(info: NavPathInfo, animated?: boolean): void; + + /** + * Pushes the NavDestination into the stack. + * + * @param { NavPathInfo } info - Indicates the NavDestination to be pushed. + * @param { NavigationOptions } [options] - Indicates options of stack operation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pushPath(info: NavPathInfo, options?: NavigationOptions): void; + + /** + * Pushes the NavDestination into the stack. + * + * @param { NavPathInfo } info - Indicates the NavDestination to be pushed. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameters types. + * 3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Pushes the NavDestination into the stack. + * + * @param { NavPathInfo } info - Indicates the NavDestination to be pushed. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameters types. + * 3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pushDestination(info: NavPathInfo, animated?: boolean): Promise; + + /** + * Pushes the NavDestination into the stack. + * + * @param { NavPathInfo } info - Indicates the NavDestination to be pushed. + * @param { NavigationOptions } [options] - Indicates options of stack operation. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameters types. + * 3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pushDestination(info: NavPathInfo, options?: NavigationOptions): Promise; + + /** + * Pushes the specified NavDestination into the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be pushed. + * @param { unknown } param - Indicates the detailed parameter of the NavDestination to be pushed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pushes the specified NavDestination into the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be pushed. + * @param { unknown } param - Indicates the detailed parameter of the NavDestination to be pushed. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pushPathByName(name: string, param: unknown, animated?: boolean): void; + + /** + * Pushes the specified NavDestination into the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be pushed. + * @param { Object } param - Indicates the detailed parameter of the NavDestination to be pushed. + * @param { import('../api/@ohos.base').Callback } onPop - The callback when next page returns. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Pushes the specified NavDestination into the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be pushed. + * @param { Object } param - Indicates the detailed parameter of the NavDestination to be pushed. + * @param { import('../api/@ohos.base').Callback } onPop - The callback when next page returns. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pushPathByName(name: string, param: Object, onPop: import('../api/@ohos.base').Callback, animated?: boolean): void; + + /** + * Pushes the specified NavDestination into the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be pushed. + * @param { Object } param - Indicates the detailed parameter of the NavDestination to be pushed. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameters types. + * 3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Pushes the specified NavDestination into the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be pushed. + * @param { Object } param - Indicates the detailed parameter of the NavDestination to be pushed. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameters types. + * 3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pushDestinationByName(name: string, param: Object, animated?: boolean): Promise; + + /** + * Pushes the specified NavDestination into the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be pushed. + * @param { Object } param - Indicates the detailed parameter of the NavDestination to be pushed. + * @param { import('../api/@ohos.base').Callback } onPop - The callback when next page returns. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameters types. + * 3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Pushes the specified NavDestination into the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be pushed. + * @param { Object } param - Indicates the detailed parameter of the NavDestination to be pushed. + * @param { import('../api/@ohos.base').Callback } onPop - The callback when next page returns. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameters types. + * 3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pushDestinationByName(name: string, param: Object, onPop: import('../api/@ohos.base').Callback, animated?: boolean): Promise; + + /** + * Replace the current NavDestination with the specific one.The current NavDestination will be destroyed. + * + * @param { NavPathInfo } info - Indicates the new NavDestination in top of the stack. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Replace the current NavDestination with the specific one.The current NavDestination will be destroyed. + * + * @param { NavPathInfo } info - Indicates the new NavDestination in top of the stack. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacePath(info: NavPathInfo, animated?: boolean): void; + + /** + * Replace the current NavDestination with the specific one.The current NavDestination will be destroyed. + * + * @param { NavPathInfo } info - Indicates the new NavDestination in top of the stack. + * @param { NavigationOptions } [options] - Indicates options of stack operation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacePath(info: NavPathInfo, options?: NavigationOptions): void; + + /** + * Replace the current NavDestination with the specific one.The current NavDestination will be destroyed. + * + * @param { string } name - Indicates name of the new NavDestination in top of stack. + * @param { Object } param - Indicates the detailed parameter of the new NavDestination in top of the stack. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Replace the current NavDestination with the specific one.The current NavDestination will be destroyed. + * + * @param { string } name - Indicates name of the new NavDestination in top of stack. + * @param { Object } param - Indicates the detailed parameter of the new NavDestination in top of the stack. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + replacePathByName(name: string, param: Object, animated?: boolean): void; + + /** + * Remove the specified NavDestinations by indexes. + * + * @param { Array } indexes - Indicates the indexes of the NavDestinations to be removed. + * @returns { number } Returns the number of removed pages. Invalid indexes will be ignored. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Remove the specified NavDestinations by indexes. + * + * @param { Array } indexes - Indicates the indexes of the NavDestinations to be removed. + * @returns { number } Returns the number of removed pages. Invalid indexes will be ignored. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeByIndexes(indexes: Array): number; + + /** + * Remove the specified NavDestination by name. + * + * @param { string } name - Indicates the name of the NavDestination to be removed. + * @returns { number } Returns the number of removed NavDestinations. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Remove the specified NavDestination by name. + * + * @param { string } name - Indicates the name of the NavDestination to be removed. + * @returns { number } Returns the number of removed NavDestinations. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeByName(name: string): number; + + /** + * Remove the specified NavDestination by its navDestinationId. + * + * @param { string } navDestinationId - Indicates the navDestinationId of the NavDestination to be removed. + * @returns { boolean } Returns true if remove successfully, otherwise returns false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + removeByNavDestinationId(navDestinationId: string): boolean; + + /** + * Pops the top NavDestination out of the stack. + * + * @returns { NavPathInfo | undefined } Returns the top NavPathInfo if the stack is not empty, otherwise returns undefined. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pops the top NavDestination out of the stack. + * + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { NavPathInfo | undefined } Returns the top NavPathInfo if the stack is not empty, otherwise returns undefined. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + pop(animated?: boolean): NavPathInfo | undefined; + + /** + * Pops the top NavDestination out of the stack. + * + * @param { Object } result - The result of the NavDestination. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { NavPathInfo | undefined } Returns the top NavPathInfo if the stack is not empty, otherwise returns undefined. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Pops the top NavDestination out of the stack. + * + * @param { Object } result - The result of the NavDestination. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { NavPathInfo | undefined } Returns the top NavPathInfo if the stack is not empty, otherwise returns undefined. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + pop(result: Object, animated?: boolean): NavPathInfo | undefined; + + /** + * Pops the specified NavDestination out of the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be popped. + * @returns { number } Returns the index of the NavDestination if it exists in the stack, otherwise returns -1; + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pops the specified NavDestination out of the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be popped. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { number } Returns the index of the NavDestination if it exists in the stack, otherwise returns -1; + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popToName(name: string, animated?: boolean): number; + + /** + * Pops the specified NavDestination out of the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be popped. + * @param { Object } result - The result of the NavDestination. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { number } Returns the index of the NavDestination if it exists in the stack, otherwise returns -1; + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Pops the specified NavDestination out of the stack. + * + * @param { string } name - Indicates the name of the NavDestination to be popped. + * @param { Object } result - The result of the NavDestination. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { number } Returns the index of the NavDestination if it exists in the stack, otherwise returns -1; + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + popToName(name: string, result: Object, animated?: boolean): number; + + /** + * Pops the specified NavDestination out of the stack. + * + * @param { number } index - Indicates the index of the NavDestination to be popped. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Pops the specified NavDestination out of the stack. + * + * @param { number } index - Indicates the index of the NavDestination to be popped. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popToIndex(index: number, animated?: boolean): void; + + /** + * Pops the specified NavDestination out of the stack. + * + * @param { number } index - Indicates the index of the NavDestination to be popped. + * @param { Object } result - The result of the NavDestination. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + popToIndex(index: number, result: Object, animated?: boolean): void; + + /** + * Moves the specified NavDestination to stack top. + * + * @param { string } name - Indicates the name of the NavDestination to be moved to the top. + * @returns { number } Returns the index of the NavDestination if it exists in the stack, otherwise returns -1; + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Moves the specified NavDestination to stack top. + * + * @param { string } name - Indicates the name of the NavDestination to be moved to the top. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { number } Returns the index of the NavDestination if it exists in the stack, otherwise returns -1; + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + moveToTop(name: string, animated?: boolean): number; + + /** + * Moves the specified NavDestination to stack top. + * + * @param { number } index - Indicates the index of the NavDestination to be moved to the top. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Moves the specified NavDestination to stack top. + * + * @param { number } index - Indicates the index of the NavDestination to be moved to the top. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + moveIndexToTop(index: number, animated?: boolean): void; + + /** + * Clears the stack. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Clears the stack. + * + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + clear(animated?: boolean): void; + + /** + * Obtains all the NavDestination name in the stack. + * + * @returns { Array } Returns all the NavDestination name in the stack; + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Obtains all the NavDestination name in the stack. + * + * @returns { Array } Returns all the NavDestination name in the stack; + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getAllPathName(): Array; + + /** + * Obtains the param of the specified NavDestination. + * + * @param { number } index - Indicates the index of the NavDestination. + * @returns { unknown | undefined } Returns the detailed parameter of the NavDestination if it exists in the stack, otherwise returns undefined; + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Obtains the param of the specified NavDestination. + * + * @param { number } index - Indicates the index of the NavDestination. + * @returns { unknown | undefined } Returns the detailed parameter of the NavDestination if it exists in the stack, otherwise returns undefined; + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getParamByIndex(index: number): unknown | undefined; + + /** + * Obtains the param of the specified NavDestination. + * + * @param { string } name - Indicates the name of the NavDestination. + * @returns { Array } Returns the detailed parameter of all the NavDestinations. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Obtains the param of the specified NavDestination. + * + * @param { string } name - Indicates the name of the NavDestination. + * @returns { Array } Returns the detailed parameter of all the NavDestinations. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getParamByName(name: string): Array; + + /** + * Obtains the index of the specified NavDestination. + * + * @param { string } name - Indicates the name of the NavDestination. + * @returns { Array } Returns the index of all the NavDestinations. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Obtains the index of the specified NavDestination. + * + * @param { string } name - Indicates the name of the NavDestination. + * @returns { Array } Returns the index of all the NavDestinations. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getIndexByName(name: string): Array; + + /** + * Obtains the parent of the current stack. + * + * @returns { NavPathStack | null } Returns the parent of the current stack. If no parent, it returns null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + getParent(): NavPathStack | null; + + /** + * Obtains the size of the stack. + * + * @returns { number } Returns the size of the stack. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Obtains the size of the stack. + * + * @returns { number } Returns the size of the stack. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + size(): number; + + /** + * disable or enable all transition animation in this navigation stack. + * + * @param { boolean } value - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * disable or enable all transition animation in this navigation stack. + * + * @param { boolean } value - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + disableAnimation(value: boolean): void; + + /** + * set navigation transition interception.It will be called in navPathStack changes or navigation mode changes. + * + * @param { NavigationInterception } interception - the instance to intercept in navigation changes. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + setInterception(interception: NavigationInterception): void; +} + +/** + * Navigation home name + * + * @typedef { 'navBar' } NavBar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type NavBar = 'navBar' + +/** + * navigation interception callback using in willShow and didShow + * + * @typedef { function } InterceptionShowCallback + * @param { NavDestinationContext | NavBar } from - Indicates the starting NavDestination or NavBar. + * @param { NavDestinationContext | NavBar } to - Indicates the destination NavDestination or NavBar. + * @param { NavigationOperation } operation - Indicates the type of stack operation. + * @param { boolean } isAnimated - Indicates whether the transition is animated. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type InterceptionShowCallback = (from: NavDestinationContext|NavBar, to: NavDestinationContext|NavBar, operation: NavigationOperation, isAnimated: boolean) => void; + +/** + * navigation interception callback using in navigation mode change + * + * @typedef { function } InterceptionModeCallback + * @param { NavigationMode } mode - Indicates the mode of Navigation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type InterceptionModeCallback = (mode: NavigationMode) => void; + +/** + * Provide navigation transition interception + * + * @interface NavigationInterception + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface NavigationInterception { + /** + * Called before destination transition.NavPathStack can be changed in this callback, + * it will takes effect during this transition.For details, see { @Link InterceptionShowCallback}. + * + * @type { ?InterceptionShowCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + willShow?: InterceptionShowCallback; + + /** + * Called after destination transition.For details, see { @Link InterceptionShowCallback}. + * + * @type { ?InterceptionShowCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + didShow?: InterceptionShowCallback; + + /** + * Called when navigation mode changed.For details, see { @Link InterceptionModeCallback}. + * + * @type { ?InterceptionModeCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + modeChange?: InterceptionModeCallback; +} + +/** + * Provide navigator view interface + * + * @interface NavigationInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Provide navigator view interface + * + * @interface NavigationInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Provide navigator view interface + * + * @interface NavigationInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +interface NavigationInterface { + /** + * Called when the navigator view interface is used. + * + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the navigator view interface is used. + * + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the navigator view interface is used. + * + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (): NavigationAttribute; + + /** + * Called when the navigator view interface is used, with route table provided. + * + * @param { NavPathStack } pathInfos - The stack of the route table. + * @returns { NavigationAttribute } Returns the instance of the NavigationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the navigator view interface is used, with route table provided. + * + * @param { NavPathStack } pathInfos - The stack of the route table. + * @returns { NavigationAttribute } Returns the instance of the NavigationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + (pathInfos: NavPathStack): NavigationAttribute; +} + +/** + * Defines the status of toolbar item and it is used in the ToolbarItem interface. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines the status of toolbar item and it is used in the ToolbarItem interface. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare enum ToolbarItemStatus { + /** + * Normal state of toolbar item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Normal state of toolbar item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + NORMAL = 0, + + /** + * Disable state of toolbar item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Disable state of toolbar item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + DISABLED = 1, + + /** + * Active state of toolbar item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Active state of toolbar item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ACTIVE = 2, +} + +/** + * Defines the operation of current navigation transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Defines the operation of current navigation transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum NavigationOperation { + /** + * Push operation of navigation transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Push operation of navigation transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + PUSH = 1, + + /** + * Pop operation of navigation transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Pop operation of navigation transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + POP = 2, + + /** + * Replace operation of navigation transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Replace operation of navigation transition. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + REPLACE = 3, +} + +/** + * Defines configurable parameters for toolbar item. + * + * @interface ToolbarItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +/** + * Defines configurable parameters for toolbar item. + * + * @interface ToolbarItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ +declare interface ToolbarItem { + /** + * The value of navigation toolbar item. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The value of navigation toolbar item. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: ResourceStr; + + /** + * The icon of navigation toolbar item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The icon of navigation toolbar item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + icon?: ResourceStr; + + /** + * The symbol of navigation toolbar item. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + symbolIcon?: SymbolGlyphModifier; + + /** + * Trigger by navigation toolbar item click. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger by navigation toolbar item click. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + action?: () => void; + + /** + * The state of navigation toolbar item. + * + * @type { ?ToolbarItemStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The state of navigation toolbar item. + * + * @type { ?ToolbarItemStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + status?: ToolbarItemStatus; + + /** + * The icon of navigation toolbar item in active state. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The icon of navigation toolbar item in active state. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + activeIcon?: ResourceStr; + + /** + * The symbol of navigation toolbar item in active state. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + activeSymbolIcon?: SymbolGlyphModifier; +} + +/** + * Indicates the options of Navigation's Titlebar. + * + * @interface NavigationTitleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface NavigationTitleOptions { + /** + * Background color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundColor?: ResourceColor; + + /** + * Background blur style. + * + * @type { ?BlurStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Set title bar style. + * + * @type { ?BarStyle } + * @default BarStyle.STANDARD + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + barStyle?: BarStyle; + + /** + * Set title bar start padding. + * + * @type { ?LengthMetrics } + * @default LengthMetrics.resource($r('sys.float.margin_left')) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + paddingStart?: LengthMetrics; + + /** + * Set title bar end padding. + * + * @type { ?LengthMetrics } + * @default LengthMetrics.resource($r('sys.float.margin_right')) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + paddingEnd?: LengthMetrics; +} + +/** + * Declare BarStyle enum. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare enum BarStyle { + /** + * Standard style means that the bar and content area are column layouts. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + STANDARD = 0, + + /** + * Stack style means that the bar and content area are stack layouts. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + STACK = 1, +} + +/** + * Indicates the options of Navigation's Toolbar. + * + * @interface NavigationToolbarOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare interface NavigationToolbarOptions { + /** + * Background color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundColor?: ResourceColor; + + /** + * Background blur style. + * + * @type { ?BlurStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + backgroundBlurStyle?: BlurStyle; +} + +/** + * Declare Navigation view properties. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Declare Navigation view properties. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Declare Navigation view properties. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare class NavigationAttribute extends CommonMethod { + /** + * Sets the width of navigation bar. + * + * @param { Length } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the width of navigation bar. + * + * @param { Length } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the width of navigation bar. + * + * @param { Length } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + navBarWidth(value: Length): NavigationAttribute; + + /** + * Sets the position of navigation bar. + * + * @param { NavBarPosition } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the position of navigation bar. + * + * @param { NavBarPosition } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the position of navigation bar. + * + * @param { NavBarPosition } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + navBarPosition(value: NavBarPosition): NavigationAttribute; + + /** + * Sets the minimum width and the maximum width of navigation bar. + * + * @param { [Dimension, Dimension] } value - The minimum and the maximum width of navigation bar. + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the minimum width and the maximum width of navigation bar. + * + * @param { [Dimension, Dimension] } value - The minimum and the maximum width of navigation bar. + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + navBarWidthRange(value: [Dimension, Dimension]): NavigationAttribute; + + /** + * Sets the minimum width of content. + * + * @param { Dimension } value - The minimum width of content. + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the minimum width of content. + * + * @param { Dimension } value - The minimum width of content. + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + minContentWidth(value: Dimension): NavigationAttribute; + + /** + * Sets the mode of navigation. + * + * @param { NavigationMode } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the mode of navigation. + * + * @param { NavigationMode } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the mode of navigation. + * + * @param { NavigationMode } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + mode(value: NavigationMode): NavigationAttribute; + + /** + * Sets the back button icon. + * + * @param { string | PixelMap | Resource } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Sets the back button icon. + * + * @param { string | PixelMap | Resource } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the back button icon. + * + * @param { string | PixelMap | Resource } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Sets the back button icon. + * + * @param { string | PixelMap | Resource | SymbolGlyphModifier } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + backButtonIcon(value: string | PixelMap | Resource | SymbolGlyphModifier): NavigationAttribute; + + /** + * Hide the NavBar, which includes title bar, the child of Navigation and tool bar. Supported in split mode. + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Hide the NavBar, which includes title bar, the child of Navigation and tool bar. Supported in split mode. + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Hide the NavBar, which includes title bar, the child of Navigation and tool bar. Supported in all mode. + * It will show top page in the NavPathStack directly or empty if there is no page in the NavPathStack. + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hideNavBar(value: boolean): NavigationAttribute; + + /** + * Navigation title + * + * @param { string | CustomBuilder } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Navigation title + * + * @param { string | CustomBuilder | NavigationCommonTitle | NavigationCustomTitle } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Navigation title + * + * @param { ResourceStr | CustomBuilder | NavigationCommonTitle | NavigationCustomTitle } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Navigation title + * + * @param { ResourceStr | CustomBuilder | NavigationCommonTitle | NavigationCustomTitle } value + * @param { NavigationTitleOptions } [options] - Indicates the options of titlebar. + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + title(value: ResourceStr | CustomBuilder | NavigationCommonTitle | NavigationCustomTitle, options?: NavigationTitleOptions): NavigationAttribute; + + /** + * Navigation subtitle + * + * @param { string } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 9 + * @useinstead title + */ + subTitle(value: string): NavigationAttribute; + + /** + * Hide navigation title bar + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Hide navigation title bar + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Hide navigation title bar + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hideTitleBar(value: boolean): NavigationAttribute; + + /** + * Hide navigation back button + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Hide navigation back button + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Hide navigation back button + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hideBackButton(value: boolean): NavigationAttribute; + + /** + * Navigation title mode + * + * @param { NavigationTitleMode } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Navigation title mode + * + * @param { NavigationTitleMode } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Navigation title mode + * + * @param { NavigationTitleMode } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + titleMode(value: NavigationTitleMode): NavigationAttribute; + + /** + * Navigation title bar's menus + * + * @param { Array | CustomBuilder } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Navigation title bar's menus + * + * @param { Array | CustomBuilder } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Navigation title bar's menus + * + * @param { Array | CustomBuilder } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + menus(value: Array | CustomBuilder): NavigationAttribute; + + /** + * Tool bar + * + * @param { object | CustomBuilder } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + * @deprecated since 10 + * @useinstead navigation/NavigationAttribute#toolbarConfiguration + */ + toolBar(value: object | CustomBuilder): NavigationAttribute; + + /** + * Configure toolbar with default style parameter or custom parameter. + * + * @param { Array | CustomBuilder } value - Toolbar configuration parameters. + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Configure toolbar with default style parameter or custom parameter. + * + * @param { Array | CustomBuilder } value - Toolbar configuration parameters. + * @param { NavigationToolbarOptions } [options] - Indicates the options of toolbar. + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + toolbarConfiguration(value: Array | CustomBuilder, options?: NavigationToolbarOptions): NavigationAttribute; + + /** + * Hide tool bar + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Hide tool bar + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Hide tool bar + * + * @param { boolean } value + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hideToolBar(value: boolean): NavigationAttribute; + + /** + * Trigger callback when title mode change finished at free mode. + * + * @param { (titleMode: NavigationTitleMode) => void } callback + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Trigger callback when title mode change finished at free mode. + * + * @param { function } callback + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger callback when title mode change finished at free mode. + * + * @param { function } callback + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onTitleModeChange(callback: (titleMode: NavigationTitleMode) => void): NavigationAttribute; + + /** + * Trigger callback when the visibility of navigation bar change. + * + * @param { (isVisible: boolean) => void } callback + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Trigger callback when the visibility of navigation bar change. + * + * @param { function } callback + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Trigger callback when the visibility of navigation bar change. + * + * @param { function } callback + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onNavBarStateChange(callback: (isVisible: boolean) => void): NavigationAttribute; + + /** + * Trigger callback when navigation mode changes. + * + * @param { function } callback + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onNavigationModeChange(callback: (mode: NavigationMode) => void): NavigationAttribute; + + /** + * Set builder for user-defined NavDestination component. + * + * @param { function } builder - The builder function of NavDestination component. + * @returns { NavigationAttribute } Returns the instance of the NavigationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set builder for user-defined NavDestination component. + * + * @param { function } builder - The builder function of NavDestination component. + * @returns { NavigationAttribute } Returns the instance of the NavigationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + navDestination(builder: (name: string, param: unknown) => void): NavigationAttribute; + + /** + * Set custom navigation content transition animation. + * + * @param { function } delegate - Custom transition delegate. + * @returns { NavigationAttribute } Returns the instance of the NavigationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Set custom navigation content transition animation. + * + * @param { function } delegate - Custom transition delegate. + * @returns { NavigationAttribute } Returns the instance of the NavigationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + customNavContentTransition(delegate: (from: NavContentInfo, to: NavContentInfo, operation: NavigationOperation) => NavigationAnimatedTransition | undefined): NavigationAttribute; + + /** + * Set navigation content expand types and edges. + * + * @param { Array } [types] - Indicates the types of the safe area. + * @param { Array } [edges] - Indicates the edges of the safe area. + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + ignoreLayoutSafeArea(types?: Array, edges?: Array): NavigationAttribute; + + /** + * Set the style of system bar + * + * @param { Optional } style - The properties of system bar + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + systemBarStyle(style: Optional): NavigationAttribute; +} + +/** +* Navigation transition animation protocol. +* +* @interface NavigationAnimatedTransition +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @since 11 +*/ +/** +* Navigation transition animation protocol. +* +* @interface NavigationAnimatedTransition +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @crossplatform +* @atomicservice +* @since 12 +*/ +declare interface NavigationAnimatedTransition { + /** + * This method is called after the transition ends to notify whether the transition was successful. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * This method is called after the transition ends to notify whether the transition was successful. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onTransitionEnd?: (success: boolean) => void + + /** + * Define the limit duration of the transition animation. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the limit duration of the transition animation. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + timeout?: number; + + /** + * Indicates whether it is an interactive transition. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isInteractive?: boolean; + + /** + * Configure the animations associated with custom transition. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Configure the animations associated with custom transition. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + transition: (transitionProxy: NavigationTransitionProxy) => void +} + +/** + * Navigation transition proxy. + * + * @interface NavigationTransitionProxy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Navigation transition proxy. + * + * @interface NavigationTransitionProxy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface NavigationTransitionProxy { + /** + * From navigation content info. + * + * @type { NavContentInfo } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * From navigation content info. + * + * @type { NavContentInfo } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + from: NavContentInfo; + + /** + * To navigation content info. + * + * @type { NavContentInfo } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * To navigation content info. + * + * @type { NavContentInfo } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + to: NavContentInfo; + + /** + * Indicates whether it is an interactive transition. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + isInteractive?: boolean; + + /** + * Notification system transition animation completed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Notification system transition animation completed. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + finishTransition(): void; + + /** + * Notification system transition animation canceled. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cancelTransition?(): void; + + /** + * Notification system transition animation update. + * + * @param { number } progress - The progress of transition animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + updateTransition?(progress: number): void; +} + +/** + * Navigation content info. + * + * @interface NavContentInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ +/** + * Navigation content info. + * + * @interface NavContentInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare interface NavContentInfo { + /** + * Navigation content name. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Navigation content name. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + name?: string; + + /** + * Navigation content index. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Navigation content index. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + index: number; + + /** + * Navigation content mode. + * + * @type { ?NavDestinationMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Navigation content mode. + * + * @type { ?NavDestinationMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + mode?: NavDestinationMode; + + /** + * Navigation content param. + * + * @type { ?Object } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + param?: Object; + + /** + * The unique id of NavDestination. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + navDestinationId?: string; +} + +/** + * Defines Navigation Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Navigation Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Navigation Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const Navigation: NavigationInterface; + +/** + * Defines Navigation Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * Defines Navigation Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Navigation Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +declare const NavigationInstance: NavigationAttribute; diff --git a/tests/arkts-subset/ets/navigator.d.ts b/tests/arkts-subset/ets/navigator.d.ts new file mode 100644 index 00000000..b01af1eb --- /dev/null +++ b/tests/arkts-subset/ets/navigator.d.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 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. + */ + +interface NavigatorInterface { + (): NavigatorAttribute; + // (value?: { target: string; type?: NavigationType }): NavigatorAttribute; +} + +declare class NavigatorAttribute extends CommonMethod { + // active(value: boolean): NavigatorAttribute; + // type(value: NavigationType): NavigatorAttribute; + // target(value: string): NavigatorAttribute; + // params(value: object): NavigatorAttribute; +} +declare const Navigator: NavigatorInterface; +declare const NavigatorInstance: NavigatorAttribute; \ No newline at end of file diff --git a/tests/arkts-subset/ets/particle.d.ts b/tests/arkts-subset/ets/particle.d.ts new file mode 100644 index 00000000..23c44c52 --- /dev/null +++ b/tests/arkts-subset/ets/particle.d.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 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. + */ + +interface EmitterProperty { + + index: number; + + emitRate?: number; +} + +declare class ParticleAttribute extends CommonMethod { + + emitter(value: Array): ParticleAttribute; +} \ No newline at end of file diff --git a/tests/arkts-subset/ets/row.d.ts b/tests/arkts-subset/ets/row.d.ts new file mode 100644 index 00000000..0be57945 --- /dev/null +++ b/tests/arkts-subset/ets/row.d.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 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 interface RowOptions { + space?: string | number; +} +interface RowInterface { + (options?: RowOptions): RowAttribute; +} + +declare class RowAttribute extends CommonMethod { + alignItems(value: VerticalAlign): RowAttribute; + justifyContent(value: FlexAlign): RowAttribute; + pointLight(value: PointLightStyle): RowAttribute; + reverse(isReversed: Optional): RowAttribute; +} +declare const Row: RowInterface; +declare const RowInstance: RowAttribute; diff --git a/tests/arkts-subset/ets/security_component.d.ts b/tests/arkts-subset/ets/security_component.d.ts new file mode 100644 index 00000000..e4938b22 --- /dev/null +++ b/tests/arkts-subset/ets/security_component.d.ts @@ -0,0 +1,3 @@ + +declare class SecurityComponentMethod { +} \ No newline at end of file diff --git a/tests/arkts-subset/ets/select.d.ts b/tests/arkts-subset/ets/select.d.ts new file mode 100644 index 00000000..d4eb6d8e --- /dev/null +++ b/tests/arkts-subset/ets/select.d.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2024 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 interface SelectOption { + value: ResourceStr; + icon?: ResourceStr; + symbolIcon?: SymbolGlyphModifier; +} + +declare interface MenuItemConfiguration extends CommonConfiguration { + + value: ResourceStr; + + icon?: ResourceStr; + + triggerSelect(index: number, value: string): void; +} + +interface SelectInterface { + (options: Array): SelectAttribute; +} + +declare class SelectAttribute extends CommonMethod { + + menuItemContentModifier(modifier: ContentModifier): SelectAttribute; +} + +declare const Select: SelectInterface; + +declare const SelectInstance: SelectAttribute; diff --git a/tests/arkts-subset/ets/shape.d.ts b/tests/arkts-subset/ets/shape.d.ts new file mode 100644 index 00000000..8978c964 --- /dev/null +++ b/tests/arkts-subset/ets/shape.d.ts @@ -0,0 +1,11 @@ + +interface ShapeInterface { + (): ShapeAttribute +} + +declare class ShapeAttribute extends CommonMethod { +} + +declare const Shape: ShapeInterface; + +declare const ShapeInstance: ShapeAttribute; diff --git a/tests/arkts-subset/ets/sidebar.d.ts b/tests/arkts-subset/ets/sidebar.d.ts new file mode 100644 index 00000000..dfb258a4 --- /dev/null +++ b/tests/arkts-subset/ets/sidebar.d.ts @@ -0,0 +1,12 @@ + +interface SideBarContainerInterface { + (): SideBarContainerAttribute +} + +declare class SideBarContainerAttribute extends CommonMethod { + minSideBarWidth(value: number): SideBarContainerAttribute; + minSideBarWidth(value: Length): SideBarContainerAttribute; +} + +declare const SideBarContainer: SideBarContainerInterface; +declare const SideBarContainerInstance: SideBarContainerAttribute; diff --git a/tests/arkts-subset/ets/slider.d.ts b/tests/arkts-subset/ets/slider.d.ts new file mode 100644 index 00000000..0be72463 --- /dev/null +++ b/tests/arkts-subset/ets/slider.d.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021-2024 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 class SliderAttribute extends CommonMethod { + blockColor(value: ResourceColor): SliderAttribute; + trackColor(value: ResourceColor | LinearGradient): SliderAttribute; + selectedColor(value: ResourceColor): SliderAttribute; + minLabel(value: string): SliderAttribute; + maxLabel(value: string): SliderAttribute; + showSteps(value: boolean): SliderAttribute; + showTips(value: boolean, content?: ResourceStr): SliderAttribute; +} diff --git a/tests/arkts-subset/ets/stack.d.ts b/tests/arkts-subset/ets/stack.d.ts new file mode 100644 index 00000000..896952dd --- /dev/null +++ b/tests/arkts-subset/ets/stack.d.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 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 interface StackOptions { + alignContent?: Alignment; +} + +interface StackInterface { + (options?: StackOptions): StackAttribute; +} + +declare class StackAttribute extends CommonMethod { + alignContent(value: Alignment): StackAttribute; + pointLight(value: PointLightStyle): StackAttribute; +} + +declare const Stack: StackInterface; +declare const StackInstance: StackAttribute; diff --git a/tests/arkts-subset/ets/tab_content.d.ts b/tests/arkts-subset/ets/tab_content.d.ts new file mode 100644 index 00000000..5582259c --- /dev/null +++ b/tests/arkts-subset/ets/tab_content.d.ts @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2024 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 enum SelectedMode { + + INDICATOR, + BOARD +} + +interface BoardStyle { + + borderRadius?: Length; +} + +interface IndicatorStyle { + + color?: ResourceColor; +} + +declare class TabBarSymbol { + + normal: SymbolGlyphModifier; + + selected?: SymbolGlyphModifier; +} + +declare enum LayoutMode { + AUTO = 0, + VERTICAL = 1, + HORIZONTAL = 2 +} + +declare interface TabBarIconStyle { + + selectedColor?: ResourceColor; + unselectedColor?: ResourceColor; +} + +declare class SubTabBarStyle { + + constructor(content: ResourceStr); + + constructor(content: ResourceStr | ComponentContent); + + static of(content: ResourceStr): SubTabBarStyle; + + static of(content: ResourceStr | ComponentContent): SubTabBarStyle; + + indicator(value: IndicatorStyle): SubTabBarStyle; + + selectedMode(value: SelectedMode): SubTabBarStyle; + + board(value: BoardStyle): SubTabBarStyle; + + labelStyle(value: LabelStyle): SubTabBarStyle; + + padding(value: Padding | Dimension): SubTabBarStyle; + + padding(padding: LocalizedPadding): SubTabBarStyle; + + id(value: string): SubTabBarStyle; +} + +declare class BottomTabBarStyle { + + constructor(icon: ResourceStr | TabBarSymbol, text: ResourceStr); + + static of(icon: ResourceStr | TabBarSymbol, text: ResourceStr): BottomTabBarStyle; + + labelStyle(value: LabelStyle): BottomTabBarStyle; + + padding(value: Padding | Dimension | LocalizedPadding): BottomTabBarStyle; + + layoutMode(value: LayoutMode): BottomTabBarStyle; + + verticalAlign(value: VerticalAlign): BottomTabBarStyle; + + symmetricExtensible(value: boolean): BottomTabBarStyle; + + id(value: string): BottomTabBarStyle; + + iconStyle(style: TabBarIconStyle): BottomTabBarStyle; +} + +declare interface TabContentInterface { + (): TabContentAttribute +} + +declare class TabContentAttribute extends CommonMethod { + + tabBar(value: string | Resource | CustomBuilder | { icon?: string | Resource; text?: string | Resource }): TabContentAttribute; + + tabBar(value: SubTabBarStyle | BottomTabBarStyle): TabContentAttribute; +} + +declare const TabContent: TabContentInterface diff --git a/tests/arkts-subset/ets/tabs.d.ts b/tests/arkts-subset/ets/tabs.d.ts new file mode 100644 index 00000000..3703ea40 --- /dev/null +++ b/tests/arkts-subset/ets/tabs.d.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024 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 enum BarMode { + Scrollable = 0, + Fixed = 1, +} + +declare class TabsController { + constructor(); + changeIndex(value: number): void; + // preloadItems(indices: Optional>): Promise; + // setTabBarTranslate(translate: TranslateOptions): void; + // setTabBarOpacity(opacity: number): void; +} + +declare enum BarPosition { + Start, + End, +} + +declare interface TabsOptions { + barPosition?: BarPosition; + index?: number; + controller?: TabsController +} + +declare interface TabsInterface { + (options?: TabsOptions): TabsAttribute; +} + +declare class TabsAttribute extends CommonMethod { + + // TBD: Fix for the TestGeneratorVisitor + // barMode(value: BarMode.Fixed): TabsAttribute; + barMode(value: BarMode): TabsAttribute; + barWidth(value: Length): TabsAttribute; + barHeight(value: Length): TabsAttribute; + barPosition(value: BarPosition): TabsAttribute; + animationDuration(value: number): TabsAttribute; + scrollable(value: boolean): TabsAttribute; + +} + +declare const Tabs: TabsInterface \ No newline at end of file diff --git a/tests/arkts-subset/ets/test.d.ts b/tests/arkts-subset/ets/test.d.ts new file mode 100644 index 00000000..8fc712ae --- /dev/null +++ b/tests/arkts-subset/ets/test.d.ts @@ -0,0 +1,294 @@ +declare enum EnumDTS { + ELEM_0 = 0, + ELEM_1 = 1, + ELEM_2 = 2, +} + +declare interface BooleanInterfaceDTS { + valBool: boolean +} + +declare interface NumberInterfaceDTS { + valNumber: number +} + +declare interface StringInterfaceDTS { + valString: string +} + +declare interface UnionInterfaceDTS { + + unionProp: number | boolean +} + +declare interface UnionOptionalInterfaceDTS { + + unionProp: string | undefined +} + +declare interface TupleInterfaceDTS { + + tuple: [number, boolean] +} + +declare interface OptionInterfaceDTS { + + tuple: [boolean?, number?] +} + +declare interface ArrayRefNumberInterfaceDTS { + + tuple: Array +} + +declare interface ArrayRefTuplesInterfaceDTS { + + tuple: Array<[boolean, number]> +} + +declare class ClassDTS { + + valBoolean: boolean +} + +// Non materialized class +declare class ClassWithConstructorDTS { + + constructor(valNumber: number, valString: string) +} + +// Non materialized class +declare class ClassWithConstructorAndFieldsDTS { + + valNumber: number + valBoolean: boolean + + constructor(valNumber: number, valBoolean: boolean) +} + +// Materialized class +declare class ClassWithConstructorAndMethodsDTS { + + constructor(valNumber: number, valString: string) + + method(valNumber: number, valString: string): void +} + +// Materialized class +declare class ClassWithConstructorAndStaticMethodsDTS { + + constructor(valNumber: number, valString: string) + + static of(valNumber: number, valString: string): ClassWithConstructorAndStaticMethodsDTS +} + +// Materialized class +declare class ClassWithConstructorAndFieldsAndMethodsDTS { + + valNumber: number + valBoolean: boolean + + constructor(valNumber: number, valBoolean: boolean) + + method(valNumber: number, valString: string): void +} + + +// Materialized class +declare class ClassWithConstructorAndWithoutParamsDTS { + + constructor() + + static of(): ClassWithConstructorAndWithoutParamsDTS + + method(): void +} + +// Materialized class +declare class ClassWithConstructorAndNonOptionalParamsDTS { + + constructor(valNumber: number, valString: string) + + static of(valNumber: number, valString: string): ClassWithConstructorAndNonOptionalParamsDTS + + method(valBoolean: boolean, valString: string): void +} + +// Materialized class +declare class ClassWithConstructorAndSomeOptionalParamsDTS { + + constructor(valNumber: number, valString?: string) + + static of(valNumber: number, valString?: string): ClassWithConstructorAndSomeOptionalParamsDTS + + method(valBoolean: boolean, valString?: string): void +} + +// Materialized class +declare class ClassWithConstructorAndAllOptionalParamsDTS { + + constructor(valNumber?: number, valString?: string) + + static of(valNumber?: number, valString?: string): ClassWithConstructorAndAllOptionalParamsDTS + + method(valBoolean?: boolean, valString?: string): void +} + +declare interface TestInterface { + (): TestAttribute +} +declare const Test: TestInterface + +// basic types: +// - boolean +// - number +// - string, +// - enum +// - function +// +// type | undefined // undefined +// type1 | type2 // union +// type[] // array +// [type1, type2] // tuple +// [type1?, type2?] // tuple optional +// [type1 | type2, (type3 | type 4)?] // tuple union +// Array // ArrayRef type +// Array<[type1, type2]> // ArrayRef tuple +declare class TestAttribute extends CommonMethod { + + // basic types + testBoolean(value: boolean): TestAttribute; + + testNumber(value: number): TestAttribute; + + testString(value: string): TestAttribute; + + testEnum(value: EnumDTS): TestAttribute + + testFunction(value: (a: number) => boolean): TestAttribute; + + testBasicMix(v1: number, v2: string, v3: number): TestAttribute + + // undefined + + testBooleanUndefined(value: boolean | undefined): TestAttribute; + + testNumberUndefined(value: number | undefined): TestAttribute; + + testStringUndefined(value: string | undefined): TestAttribute; + + testEnumUndefined(value: EnumDTS | undefined): TestAttribute; + + testFunctionUndefined(value: (a: number) => boolean | undefined): TestAttribute; + + // union + + testUnionNumberEnum(val: number | EnumDTS): TestAttribute + + testUnionBooleanString(val: boolean | string): TestAttribute + + testUnionStringNumber(val: string | number): TestAttribute + + testUnionBooleanStringNumberUndefined(val: boolean | string | number | undefined): TestAttribute + + testUnionWithGenericArray(value: number | Array): TestAttribute; + + testUnionWithArrayType(value: number | string[]): TestAttribute; + + // array + + testBooleanArray(value: boolean[]): TestAttribute; + + testNumberArray(value: number[]): TestAttribute; + + testStringArray(value: string[]): TestAttribute; + + testEnumArray(value: EnumDTS[]): TestAttribute + + // TBD: array of functions + // testFunctionArray(value: ((a: number) => boolean)[]): TestAttribute; + + testArrayMix(v1: number[], v2: string[], v3: EnumDTS[]): TestAttribute; + + // TBD: array of functions + //testArrayMix(v1: number[], v2: string[], v3: EnumDTS[], v4: ((a: number) => string)[]): TestAttribute; + + // tuple + + testTupleBooleanNumber(value: [boolean, number]): TestAttribute; + + testTupleNumberStringEnum(value: [number, string, EnumDTS]): TestAttribute; + + // tuple optional + + testTupleOptional(value: [number, string, boolean, EnumDTS]): TestAttribute; + + // tuple union + + testTupleUnion(value: [(number | string), (boolean | EnumDTS), (string | EnumDTS | boolean)]): TestAttribute; + + // Array + + testArrayRefBoolean(value: Array): TestAttribute + + testArrayRefNumber(value: Array): TestAttribute + + // testArrayTuple(value: Array<[number, boolean]>): TestAttribute + + // interface + + testBooleanInterface(value: BooleanInterfaceDTS): TestAttribute + + testNumberInterface(value: NumberInterfaceDTS): TestAttribute + + testStringInterface(value: StringInterfaceDTS): TestAttribute + + testUnionInterface(value: UnionInterfaceDTS): TestAttribute + + testUnionOptional(value: UnionOptionalInterfaceDTS): TestAttribute + + testTupleInterface(value: TupleInterfaceDTS): TestAttribute + + testOptionInterface(value: OptionInterfaceDTS): TestAttribute + + testArrayRefNumberInterface(value: ArrayRefNumberInterfaceDTS): TestAttribute + + // testArrayRefTupleInterface(value: ArrayRefTuplesInterfaceDTS) + + + // Boolean Interface + + testBooleanInterfaceOption(value?: BooleanInterfaceDTS): TestAttribute + // leads to es2panda segmentation fault + // testBooleanInterfaceTuple(value: [BooleanInterfaceDTS]): TestAttribute + + testBooleanInterfaceArray(value: BooleanInterfaceDTS[]): TestAttribute + + testBooleanInterfaceArrayRef(value: Array): TestAttribute + + testInterfaceMixed(v1: UnionInterfaceDTS, v2: number, v3: TupleInterfaceDTS): TestAttribute + + // Class + + testClass(value: ClassDTS): TestAttribute + + testClassWithConstructor(value: ClassWithConstructorDTS): TestAttribute + + testClassWithConstructorAndFields(value: ClassWithConstructorAndFieldsDTS): TestAttribute + + // Materialized class + + testClassWithConstructorAndMethods(value: ClassWithConstructorAndMethodsDTS): TestAttribute + + testClassWithConstructorAndStaticMethods(value: ClassWithConstructorAndStaticMethodsDTS): TestAttribute + + testClassWithConstructorAndFieldsAndMethods(value: ClassWithConstructorAndFieldsAndMethodsDTS): TestAttribute + + testClassWithConstructorAndNonOptionalParams(value: ClassWithConstructorAndNonOptionalParamsDTS): TestAttribute + + testClassWithConstructorAndSomeOptionalParams(value: ClassWithConstructorAndSomeOptionalParamsDTS): TestAttribute + + testClassWithConstructorAndAllOptionalParams(value: ClassWithConstructorAndAllOptionalParamsDTS): TestAttribute + + testClassWithConstructorAndWithoutParams(value: ClassWithConstructorAndWithoutParamsDTS): TestAttribute +} \ No newline at end of file diff --git a/tests/arkts-subset/ets/text.d.ts b/tests/arkts-subset/ets/text.d.ts new file mode 100644 index 00000000..ab82a884 --- /dev/null +++ b/tests/arkts-subset/ets/text.d.ts @@ -0,0 +1,61 @@ +/* + * 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 interface TextOptions { + + controller: TextController; +} + +declare interface TextOverflowOptions { + overflow: TextOverflow; +} + +interface TextInterface { + + (content?: string | Resource, value?: TextOptions): TextAttribute; +} + +declare class TextAttribute extends CommonMethod { + + font(value: Font): TextAttribute; + + fontColor(value: ResourceColor): TextAttribute; + + maxLines(value: number): TextAttribute; + + fontSize(value: number | string | Resource): TextAttribute; + + fontWeight(value: number | FontWeight | string): TextAttribute; + + textOverflow(options: TextOverflowOptions): TextAttribute; + + textAlign(value: TextAlign): TextAttribute; + + lineHeight(value: number | string | Resource): TextAttribute; + +} + +declare const TextInstance: TextAttribute; + +declare const Text: TextInterface; + +declare class TextController { + + closeSelectionMenu(): void; + + setStyledString(value: StyledString): void; + + // getLayoutManager(): LayoutManager; +} diff --git a/tests/arkts-subset/ets/toggle.d.ts b/tests/arkts-subset/ets/toggle.d.ts new file mode 100644 index 00000000..d3a94ea5 --- /dev/null +++ b/tests/arkts-subset/ets/toggle.d.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 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 enum ToggleType { + Checkbox, + Switch, + Button, + } + + declare interface ToggleOptions { + type: ToggleType; + isOn?: boolean + } + + interface ToggleInterface { + (options: ToggleOptions): ToggleAttribute; + } + + declare class ToggleAttribute extends CommonMethod { + // onChange(callback: (isOn: boolean) => void): ToggleAttribute; + // contentModifier(modifier: ContentModifier): ToggleAttribute; + // selectedColor(value: ResourceColor): ToggleAttribute; + // switchPointColor(color: ResourceColor): ToggleAttribute; + // switchStyle(value: SwitchStyle): ToggleAttribute; + } + +declare const Toggle: ToggleInterface; +declare const ToggleInstance: ToggleAttribute; diff --git a/tests/arkts-subset/ets/ui_extension_component.d.ts b/tests/arkts-subset/ets/ui_extension_component.d.ts new file mode 100644 index 00000000..dd23e3e4 --- /dev/null +++ b/tests/arkts-subset/ets/ui_extension_component.d.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) 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 enum DpiFollowStrategy { + FOLLOW_HOST_DPI = 0, + FOLLOW_UI_EXTENSION_ABILITY_DPI = 1, +} + +declare interface UIExtensionOptions { + isTransferringCaller?: boolean; + placeholder?: ComponentContent; + dpiFollowStrategy?: DpiFollowStrategy; +} + +// declare interface TerminationInfo { +// code: number; +// want?: import('../api/@ohos.app.ability.Want').default; +// } + +declare interface UIExtensionProxy { + send(data: Record): void; + sendSync(data: Record): Record; + on(type: 'asyncReceiverRegister', callback: (proxy: UIExtensionProxy) => void): void; + on(type: 'syncReceiverRegister', callback: (proxy: UIExtensionProxy) => void): void; + off(type: 'asyncReceiverRegister', callback?: (proxy: UIExtensionProxy) => void): void; + off(type: 'syncReceiverRegister', callback?: (proxy: UIExtensionProxy) => void): void; +} + +// interface UIExtensionComponentInterface { +// ( +// want: import('../api/@ohos.app.ability.Want').default, +// options?: UIExtensionOptions +// ): UIExtensionComponentAttribute; +// } +// +// declare class UIExtensionComponentAttribute extends CommonMethod { +// onRemoteReady( +// callback: import('../api/@ohos.base').Callback +// ): UIExtensionComponentAttribute; +// onReceive( +// callback: import('../api/@ohos.base').Callback<{ [key: string]: Object }> +// ): UIExtensionComponentAttribute; +// onResult( +// callback: import('../api/@ohos.base').Callback<{ +// code: number; +// want?: import('../api/@ohos.app.ability.Want').default; +// }> +// ): UIExtensionComponentAttribute; +// onRelease( +// callback: import('../api/@ohos.base').Callback +// ): UIExtensionComponentAttribute; +// onError( +// callback: import('../api/@ohos.base').ErrorCallback +// ): UIExtensionComponentAttribute; +// onTerminated(callback: Callback): UIExtensionComponentAttribute; +// } +// +// declare const UIExtensionComponent: UIExtensionComponentInterface; +// +// declare const UIExtensionComponentInstance: UIExtensionComponentAttribute; diff --git a/tests/arkts-subset/ets/vector.d.ts b/tests/arkts-subset/ets/vector.d.ts new file mode 100644 index 00000000..c914e756 --- /dev/null +++ b/tests/arkts-subset/ets/vector.d.ts @@ -0,0 +1,30 @@ + +declare type Vector1 = { + x0: number + x1: number + x2: number + x3: number +} + +declare type Vector2 = { + t: number + x: number + y: number + z: number +} + +declare interface VectorInterface { + (): VectorAttribute +} +declare const Vector: VectorInterface + +declare class VectorAttribute extends CommonMethod { + + testVector1(value: Vector1): VectorAttribute + + testVector2(value: Vector2): VectorAttribute + + testUnionVector1Number(value: Vector1 | number): VectorAttribute + + testUnionVector2Number(value: Vector2 | number): VectorAttribute +} -- Gitee From d0eb7a8254171d4c5ee5447bebebd1e2ace51c5d Mon Sep 17 00:00:00 2001 From: Mikhail Bystretskiy Date: Thu, 21 Nov 2024 07:25:33 +0000 Subject: [PATCH 47/53] !995 Fix inheritance of synthetic interfaces for materialized classes in ArkTS * Fix inheritance of synthetic interfaces for materialized classes in ArkTS --- src/peer-generation/idl/IdlEntryManager.ts | 4 +- .../idl/IdlPeerGeneratorVisitor.ts | 46 +++++++++++-------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/peer-generation/idl/IdlEntryManager.ts b/src/peer-generation/idl/IdlEntryManager.ts index 94e63fc3..7eabbc6d 100644 --- a/src/peer-generation/idl/IdlEntryManager.ts +++ b/src/peer-generation/idl/IdlEntryManager.ts @@ -41,8 +41,8 @@ export class IdlEntryManager { return [ref, callback] } - registerInterface(entry:idl.IDLInterface): [idl.IDLReferenceType, idl.IDLInterface] { - const mangledName = `Generated_synthetic_${entry.name}` + registerInterface(entry:idl.IDLInterface, nameSuggestion?: string): [idl.IDLReferenceType, idl.IDLInterface] { + const mangledName = nameSuggestion ? nameSuggestion : `Generated_synthetic_${entry.name}` this.entries.set(mangledName, entry) const ref = idl.createReferenceType(mangledName) return [ref, entry] diff --git a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts index 79bd83ce..e8ad7b46 100644 --- a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts +++ b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts @@ -29,7 +29,8 @@ import { renameClassToBuilderClass, renameClassToMaterialized, renameDtsToInterfaces, - serializerBaseMethods + serializerBaseMethods, + throwException } from "../../util" import { GenericVisitor } from "../../options" import { ArgConvertor, RetConvertor } from "../ArgConvertors" @@ -919,28 +920,37 @@ export class IdlPeerProcessor { .map(it => convertDeclToFeature(this.library, it)) // self-interface is not supported ArkTS if (idl.isInterface(decl) && this.library.language == Language.ARKTS) { - importFeatures.push(convertDeclToFeature(this.library, - makeSyntheticDeclCompletely( - decl, - { - ...decl, - name: createInterfaceDeclName(decl.name), - methods: decl.methods.map(method => { - return { - ...method, - returnType: method.returnType!, - } as idl.IDLMethod - }), - } as idl.IDLInterface, - this.library, - this.dependenciesCollector, - 'SyntheticDeclarations' - ))) + importFeatures.push(this.registerSelfInterface(decl)) } } return importFeatures } + private registerSelfInterface(decl: idl.IDLInterface): ImportFeature { + const inheritance: idl.IDLType[] = [] + const superType = idl.getSuperType(decl) + if (superType) { + const resolved = this.library.resolveTypeReference(superType as idl.IDLReferenceType) ?? throwException(`${superType} cannot be resolved`) + inheritance.push(idl.createReferenceType(createInterfaceDeclName(idl.forceAsNamedNode(resolved).name))) + } + + const newInterface: idl.IDLInterface = { + ...decl, + name: createInterfaceDeclName(decl.name), + inheritance: inheritance, + methods: decl.methods.map(method => { + return { + ...method, + returnType: method.returnType!, + } as idl.IDLMethod + }), + } as idl.IDLInterface + this.library.factory.registerInterface(newInterface, newInterface.name) + + return convertDeclToFeature(this.library, + makeSyntheticDeclCompletely(decl, newInterface, this.library, this.dependenciesCollector, 'SyntheticDeclarations')) + } + private processMaterialized(decl: idl.IDLInterface) { const name = decl.name if (this.library.materializedClasses.has(name)) { -- Gitee From a03ab8e2b8f93c131c3afd25c0a2182bbfe2db9d Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Thu, 21 Nov 2024 09:56:25 +0000 Subject: [PATCH 48/53] !1011 Basic events emulation --- external | 2 +- .../src/org/koalaui/arkoala/Application.java | 6 +- .../org/koalaui/arkoala/ResourceHolder.java | 61 +++++++++++++++++++ .../org/koalaui/arkoala/SerializerBase.java | 14 ++++- predefined/sys/node.idl | 4 ++ src/peer-generation/printers/EventsPrinter.ts | 3 +- templates/arkoala_node_api.h | 1 + templates/bridge_generated_prologue.cc | 13 ++++ tests/java-subset/ets/common.d.ts | 7 +++ 9 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/ResourceHolder.java diff --git a/external b/external index 87f7a9e1..18f60f3e 160000 --- a/external +++ b/external @@ -1 +1 @@ -Subproject commit 87f7a9e1aacd4f9ff9dc6ee80f5072b6ab0a884b +Subproject commit 18f60f3eb93293740b2a12696e06a855899cb557 diff --git a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java index 16c6bf80..5aac3f48 100644 --- a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java +++ b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Application.java @@ -59,9 +59,13 @@ public class Application { return false; } + byte[] eventBuffer = new byte[4 * 60]; + void checkEvents(int what) { System.out.println("JAVA: checkEvents " + what); - NativeModule._CreateNode(0, 0, 0); + while (NativeModule._CheckArkoalaGeneratedEvents(eventBuffer, eventBuffer.length) != 0) { + System.out.println("JAVA: checkEvents: got an event: " + (int)eventBuffer[0]); + } } void updateState() { diff --git a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/ResourceHolder.java b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/ResourceHolder.java new file mode 100644 index 00000000..b25cacb8 --- /dev/null +++ b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/ResourceHolder.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 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. + */ +package org.koalaui.arkoala; + +import java.util.HashMap; + +class ResourceInfo { + Object resource; + int holdersCount; + ResourceInfo(Object resource, int holdersCount) { + this.resource = resource; + this.holdersCount = holdersCount; + } +} + +public class ResourceHolder { + private static int nextResourceId = 100; + private HashMap resources = new HashMap(); + private static ResourceHolder _instance = null; + static ResourceHolder instance() { + if (ResourceHolder._instance == null) { + ResourceHolder._instance = new ResourceHolder(); + } + return ResourceHolder._instance; + } + + public void hold(int resourceId) { + ResourceInfo info = this.resources.get(resourceId); + if (info == null) + throw new Error("Resource " + resourceId + " does not exists, can not hold"); + else + info.holdersCount++; + } + + public void release(int resourceId) { + ResourceInfo resource = this.resources.get(resourceId); + if (resource == null) + throw new Error("Resource " + resourceId + " does not exists, can not release"); + resource.holdersCount--; + if (resource.holdersCount <= 0) + this.resources.remove(resourceId); + } + + public int registerAndHold(Object resource) { + int resourceId = ResourceHolder.nextResourceId++; + this.resources.put(resourceId, new ResourceInfo(resource, 1)); + return resourceId; + } +} diff --git a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/SerializerBase.java b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/SerializerBase.java index b112e8c6..1126cfd7 100644 --- a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/SerializerBase.java +++ b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/SerializerBase.java @@ -20,13 +20,13 @@ package org.koalaui.arkoala; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.function.Supplier; public class SerializerBase { - private static List customSerializers = new LinkedList(); + private static List customSerializers = new ArrayList(); public static void registerCustomSerializer(CustomSerializer serializer) { customSerializers.add(serializer); } @@ -156,4 +156,14 @@ public class SerializerBase { System.out.println(String.format("Unsupported custom serialization for %s, write undefined", kind)); this.writeInt8(Tag.UNDEFINED.value); } + private ArrayList heldResources = new ArrayList(); + void holdAndWriteCallback(Object callback) { + int resourceId = ResourceHolder.instance().registerAndHold(callback); + this.heldResources.add(resourceId); + this.writeInt32(resourceId); + this.writePointer(0); + this.writePointer(0); + this.writePointer(0); + } + } diff --git a/predefined/sys/node.idl b/predefined/sys/node.idl index 33b00d4e..e20082d8 100644 --- a/predefined/sys/node.idl +++ b/predefined/sys/node.idl @@ -39,9 +39,13 @@ interface Node { void UnblockVsyncWait(pointer pipeline); void SetChildTotalCount(pointer ptr0, i32 arg); void ShowCrash(String message); + + // TODO: rename to smth more sensible! i32 CheckArkoalaGeneratedEvents(sequence result, i32 size); + i32 InjectEvent(sequence data, i32 size); void EmulateClickEvent(i32 nodeId, f32 x, f32 y); void EmulateTextInputEvent(i32 nodeId, String text); + void CallCallback(i32 callbackKind, sequence args, i32 argsSize); void CallCallbackResourceHolder(pointer holder, i32 resourceId); void CallCallbackResourceReleaser(pointer releaser, i32 resourceId); diff --git a/src/peer-generation/printers/EventsPrinter.ts b/src/peer-generation/printers/EventsPrinter.ts index c00fae97..4d88524c 100644 --- a/src/peer-generation/printers/EventsPrinter.ts +++ b/src/peer-generation/printers/EventsPrinter.ts @@ -431,8 +431,9 @@ interface PeerEvent { true, )) + // TODO: maybe we shall use a switch statement here! this.printer.writeStatement(this.printer.makeMultiBranchCondition(infos.map(info => { - // TODO wait until TS deserializer is uncomplited + // TODO wait until TS deserializer is complete const constructorTypeArgs = [ `kind?: number`, `nodeId?: ${PeerEventKind}`, diff --git a/templates/arkoala_node_api.h b/templates/arkoala_node_api.h index 77239527..686f9c76 100644 --- a/templates/arkoala_node_api.h +++ b/templates/arkoala_node_api.h @@ -82,6 +82,7 @@ typedef struct %CPP_PREFIX%ArkUIExtendedNodeAPI { Ark_Float32 (*getFontScale) (Ark_Int32 deviceId); Ark_Float32 (*getDesignWidthScale) (Ark_Int32 deviceId); + // TODO: remove! void (*setCallbackMethod)(%CPP_PREFIX%Ark_APICallbackMethod* method); // the custom node is not set in create. diff --git a/templates/bridge_generated_prologue.cc b/templates/bridge_generated_prologue.cc index 1610b23b..09e71dbf 100644 --- a/templates/bridge_generated_prologue.cc +++ b/templates/bridge_generated_prologue.cc @@ -18,6 +18,7 @@ #include "common-interop.h" #include "arkoala_api_generated.h" #include "Serializers.h" +#include "events.h" const %CPP_PREFIX%ArkUIAnyAPI* GetAnyImpl(int kind, int version, std::string* result = nullptr); @@ -35,6 +36,10 @@ static const %CPP_PREFIX%ArkUIAccessors* GetAccessors() { return GetFullImpl()->getAccessors(); } +namespace Generated { + extern const GENERATED_ArkUIEventsAPI* GetArkUiEventsAPI(); +} + void impl_EmulateClickEvent(KInt nodeId, KFloat x, KFloat y) { // TODO: proper fill all by default values for Ark_ClickEvent /* @@ -88,6 +93,14 @@ void impl_EmulateClickEvent(KInt nodeId, KFloat x, KFloat y) { GetFullImpl()->getEventsAPI()->getCommonMethodEventsReceiver()->onClick0(nodeId, event); */ + fprintf(stderr, "EmulateClickEvent: %d %f %f\n", nodeId, x, y); + Ark_ClickEvent event = {}; + event.x = { ARK_TAG_FLOAT32, { .f32 = x } }; + event.y = { ARK_TAG_FLOAT32, { .f32 = y } }; + event.displayX = { ARK_TAG_FLOAT32, { .f32 = x } }; + event.displayY = { ARK_TAG_FLOAT32, { .f32 = y } }; + + Generated::GetArkUiEventsAPI()->getCommonMethodEventsReceiver()->onClick0(nodeId, event); } KOALA_INTEROP_V3(EmulateClickEvent, KInt, KFloat, KFloat) diff --git a/tests/java-subset/ets/common.d.ts b/tests/java-subset/ets/common.d.ts index ddc74670..6a47d09c 100644 --- a/tests/java-subset/ets/common.d.ts +++ b/tests/java-subset/ets/common.d.ts @@ -27,6 +27,10 @@ declare interface BaseEvent {} declare interface ClickEvent extends BaseEvent { + x: number; + + y: number; + displayX: number; displayY: number; @@ -393,6 +397,9 @@ declare class CommonMethod { gestureModifier(modifier: GestureModifier): T; //~onGestureRecognizerJudgeBegin(callback: GestureRecognizerJudgeBeginCallback): T; + + onClick(event: (event: ClickEvent) => void): T; + onClick(event: Callback, distanceThreshold: number): T; } declare interface Rectangle { -- Gitee From 572c622a21bf1a8d3741a1a4abb787527f963c61 Mon Sep 17 00:00:00 2001 From: scherbatiyalexander Date: Thu, 21 Nov 2024 10:46:14 +0000 Subject: [PATCH 49/53] !1015 Use MaterializedBase interface to distinguish materialized interfaces from user implemented interfaces * Cast materialized class to MaterializedBase in serializer * Extend MaterializedBase by materialized class --- .../org/koalaui/arkoala/MaterializedBase.java | 23 +++++++++++++++++++ src/peer-generation/FileGenerators.ts | 1 + .../printers/MaterializedPrinter.ts | 12 ++++++++-- .../printers/SerializerPrinter.ts | 11 ++++++++- .../arkts/materialized_class_prologue.ts | 1 + 5 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/MaterializedBase.java diff --git a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/MaterializedBase.java b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/MaterializedBase.java new file mode 100644 index 00000000..0d05ec9b --- /dev/null +++ b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/MaterializedBase.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 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. + */ + +package org.koalaui.arkoala; + +import org.koalaui.interop.Finalizable; + +public interface MaterializedBase { + + public Finalizable getPeer(); +} diff --git a/src/peer-generation/FileGenerators.ts b/src/peer-generation/FileGenerators.ts index dc4cfc6f..d118bdde 100644 --- a/src/peer-generation/FileGenerators.ts +++ b/src/peer-generation/FileGenerators.ts @@ -290,6 +290,7 @@ export function makeTSSerializer(library: PeerLibrary): LanguageWriter { imports.addFeature('KPointer', '@koalaui/interop') } if (printer.language == Language.ARKTS) { + imports.addFeatures(["MaterializedBase"], "../MaterializedBase") imports.addFeatures(["NativeModule"], "#components") imports.addFeatures(["CallbackKind"], "CallbackKind") imports.addFeatures(['KStringPtr', 'nullptr', 'KInt', 'KPointer', 'KLong'], '@koalaui/interop') diff --git a/src/peer-generation/printers/MaterializedPrinter.ts b/src/peer-generation/printers/MaterializedPrinter.ts index 1e6b00b4..0d01c09c 100644 --- a/src/peer-generation/printers/MaterializedPrinter.ts +++ b/src/peer-generation/printers/MaterializedPrinter.ts @@ -106,7 +106,7 @@ class TSMaterializedFileVisitor extends MaterializedFileVisitorBase { ? `${clazz.className}${clazz.generics?.length ? `<${clazz.generics.join(", ")}>` : ``}` : undefined - const interfaces: string[] = [] + const interfaces: string[] = ["MaterializedBase"] if (clazz.isInterface) { // self-interface is not supported ArkTS if (this.library.language == Language.ARKTS) { @@ -307,6 +307,8 @@ class JavaMaterializedFileVisitor extends MaterializedFileVisitorBase { const finalizableType = toIDLType('Finalizable') const superClassName = clazz.superClass?.getSuperType() ?? ARK_MATERIALIZEDBASE + const interfaces:string[] = ["MaterializedBase"] + this.printer.writeClass(clazz.className, writer => { // TODO: getters and setters for fields /*clazz.fields.forEach(f => { @@ -338,6 +340,12 @@ class JavaMaterializedFileVisitor extends MaterializedFileVisitorBase { } })*/ + // write getPeer() method + const getPeerSig = new MethodSignature(idl.maybeOptional(idl.createReferenceType("Finalizable"), true),[]) + writer.writeMethodImplementation(new Method("getPeer", getPeerSig, [MethodModifier.PUBLIC]), writer => { + writer.writeStatement(writer.makeReturn(writer.makeString("this.peer"))) + }) + const pointerType = IDLPointerType this.library.setCurrentContext(`${clazz.className}.constructor`) writePeerMethod(writer, clazz.ctor, true, this.printerContext, this.dumpSerialized, '', '', pointerType) @@ -387,7 +395,7 @@ class JavaMaterializedFileVisitor extends MaterializedFileVisitorBase { writePeerMethod(writer, method, true, this.printerContext, this.dumpSerialized, '', 'this.peer.ptr', returnType) this.library.setCurrentContext(undefined) }) - }, superClassName, undefined, clazz.generics) + }, superClassName, interfaces, clazz.generics) } visit(): void { diff --git a/src/peer-generation/printers/SerializerPrinter.ts b/src/peer-generation/printers/SerializerPrinter.ts index 72a46878..c58a4d5b 100644 --- a/src/peer-generation/printers/SerializerPrinter.ts +++ b/src/peer-generation/printers/SerializerPrinter.ts @@ -105,11 +105,20 @@ class IdlSerializerPrinter { writer.makeMethodCall(`valueSerializer`, `writePointer`, [writer.makeString(`value.ptr`)])) return } + const baseType = idl.createReferenceType("MaterializedBase") + writer.writeStatement( + writer.makeAssign( + `base`, + baseType, + writer.makeCast(writer.makeString(`value`), baseType), + true, + true + )) writer.writeStatement( writer.makeAssign( `peer`, undefined, - writer.makeString(`value.getPeer()`), + writer.makeString(`base.getPeer()`), true, true )) diff --git a/templates/arkts/materialized_class_prologue.ts b/templates/arkts/materialized_class_prologue.ts index 956a6ecb..ff700789 100644 --- a/templates/arkts/materialized_class_prologue.ts +++ b/templates/arkts/materialized_class_prologue.ts @@ -1,4 +1,5 @@ import { Finalizable } from "./Finalizable" +import { MaterializedBase } from "./MaterializedBase" import { Serializer } from "./peers/Serializer" import { isResource, isInstanceOf, runtimeType, RuntimeType, SerializerBase, registerCallback } from "./peers/SerializerBase" import { NativeModule } from "#components" -- Gitee From b6f20189af174a94dfa83d51d07e3d23c01fd3da Mon Sep 17 00:00:00 2001 From: kolegovilya Date: Thu, 21 Nov 2024 11:41:51 +0000 Subject: [PATCH 50/53] !985 Read optional type from IDL and from .d.ts --- .../java/src/org/koalaui/arkoala/Main.java | 4 ++-- src/IDLVisitor.ts | 10 +++++++-- src/from-idl/DtsPrinter.ts | 4 +++- src/from-idl/deserialize.ts | 5 +++++ src/idl.ts | 21 ++++++++----------- src/peer-generation/ArgConvertors.ts | 2 +- src/peer-generation/BuilderClass.ts | 2 +- .../writers/TsLanguageWriter.ts | 17 +++++++++++++-- src/peer-generation/OhosGenerator.ts | 4 ++-- src/peer-generation/PeerLibrary.ts | 2 +- src/peer-generation/idl/DependencySorter.ts | 3 +++ .../idl/IdlPeerGeneratorVisitor.ts | 7 ++++++- .../printers/BuilderClassPrinter.ts | 6 +++--- .../printers/MaterializedPrinter.ts | 4 ++-- src/peer-generation/printers/PeersPrinter.ts | 4 ++-- .../printers/SerializerPrinter.ts | 2 +- 16 files changed, 64 insertions(+), 33 deletions(-) diff --git a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Main.java b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Main.java index 5d84fb36..967e6ba0 100644 --- a/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Main.java +++ b/peer_lib/sig/arkoala/framework/java/src/org/koalaui/arkoala/Main.java @@ -118,8 +118,8 @@ public class Main { // optional var listPeer = ArkListPeer.create(ArkUINodeType.List, null, 0); TestUtils.checkResult("[Optional] ListPeer.someOptional", - () -> { listPeer.someOptionalAttribute(new Union_boolean_Ark_Undefined(false)); }, - "someOptional({.selector=0, .value0=false})"); + () -> { listPeer.someOptionalAttribute(new Opt_Boolean(false)); }, + "someOptional({.tag=ARK_TAG_OBJECT, .value=false})"); // enum TestUtils.checkResult("[Enum] ButtonPeer.type", () -> { buttonPeer.typeAttribute(ButtonType.CAPSULE); }, "type(Ark_ButtonType(0))"); diff --git a/src/IDLVisitor.ts b/src/IDLVisitor.ts index 5df94ee0..3d0b90f5 100644 --- a/src/IDLVisitor.ts +++ b/src/IDLVisitor.ts @@ -752,6 +752,7 @@ export class IDLVisitor implements GenericVisitor { } private computeTypeName(type: idl.IDLType): string { + if (idl.isOptionalType(type)) return "Opt_" + this.computeTypeName(type.type) if (idl.isPrimitiveType(type)) return capitalize(type.name) if (idl.isContainerType(type)) { const typeArgs = type.elementType.map(it => this.computeTypeName(it)).join("_") @@ -764,7 +765,7 @@ export class IDLVisitor implements GenericVisitor { } if (idl.isNamedNode(type)) return type.name - throw `Can not compute type name of ${idl.IDLKind[type.kind]}` + throw new Error(`Can not compute type name of ${idl.IDLKind[type.kind]}`) } /** @@ -1020,6 +1021,11 @@ export class IDLVisitor implements GenericVisitor { console.log(`WARNING: ${sourceText} is union with 'void', which is not supported, remove 'void' variant`) types = types.filter(it => it !== idl.IDLVoidType) } + if (types.find(it => it === idl.IDLUndefinedType)) { + return idl.createOptionalType( + typeOrUnion(types.filter(it => it !== idl.IDLUndefinedType)) + ) + } return typeOrUnion(types, selectedUnionName) } @@ -1040,7 +1046,7 @@ export class IDLVisitor implements GenericVisitor { * `onWillScroll(handler: ScrollOnWillScrollCallback): ScrollAttribute;`. So that override is not * valid and cannot be correctly processed so we force ScrollOnWillScrollCallback as parameter type. */ - type = idl.createUnionType([idl.createReferenceType("ScrollOnWillScrollCallback"), idl.IDLUndefinedType]) + type = idl.createOptionalType(idl.createReferenceType("ScrollOnWillScrollCallback")) console.log(`WARNING: forcing type of ${parentName}.${escapedName} to ScrollOnWillScrollCallback|undefined`) } } diff --git a/src/from-idl/DtsPrinter.ts b/src/from-idl/DtsPrinter.ts index d3a8aca7..9c7df2cb 100644 --- a/src/from-idl/DtsPrinter.ts +++ b/src/from-idl/DtsPrinter.ts @@ -43,7 +43,8 @@ import { IDLCallback, IDLConstructor, IDLEntity, IDLEntry, IDLEnum, IDLInterface transformMethodsAsync2ReturnPromise, isNamedNode, IDLNode, - IDLThisType,} from "../idl" + IDLThisType, + isOptionalType,} from "../idl" import * as webidl2 from "webidl2" import { resolveSyntheticType, toIDLNode } from "./deserialize" import { Language } from "../Language" @@ -294,6 +295,7 @@ export class CustomPrintVisitor { private printTypeForTS(type: IDLType | undefined, undefinedToVoid?: boolean, sequenceToArrayInterface: boolean = false, isCommonMethod = false): string { if (!type) throw new Error("Missing type") + if (isOptionalType(type)) return `${this.printTypeForTS(type.type, undefinedToVoid, sequenceToArrayInterface)} | undefined` if (type === IDLUndefinedType && undefinedToVoid) return "void" if (type === IDLStringType) return "string" // if (isCommonMethod && forceAsNamedNode(type).name == "this") return "T" diff --git a/src/from-idl/deserialize.ts b/src/from-idl/deserialize.ts index 0f2a2f1d..d4262bc6 100644 --- a/src/from-idl/deserialize.ts +++ b/src/from-idl/deserialize.ts @@ -159,6 +159,11 @@ function toIDLType(file: string, type: webidl2.IDLTypeDescription | string, extA refType.typeArguments = extractTypeArguments(file, extAttrs, idl.IDLExtendedAttributes.TypeArguments) return refType } + if (type.nullable) { + return idl.createOptionalType( + toIDLType(file, { ...type, nullable: false }, extAttrs) + ) + } if (isUnionTypeDescription(type)) { return idl.createUnionType(type.idlType .map(it => toIDLType(file, it)) diff --git a/src/idl.ts b/src/idl.ts index 696c53f9..42dbbb2c 100644 --- a/src/idl.ts +++ b/src/idl.ts @@ -315,7 +315,7 @@ export function isNamedNode(type: IDLNode): type is IDLNamedNode { export function forceAsNamedNode(type: IDLNode): IDLNamedNode { if (!isNamedNode(type)) { - throw new Error("Expected to be an IDLNamedNode") + throw new Error(`Expected to be an IDLNamedNode, but got '${IDLKind[type.kind]}'`) } return type } @@ -404,7 +404,7 @@ export function isSyntheticEntry(node: IDLNode): boolean { return isDefined(node.extendedAttributes?.find(it => it.name === IDLExtendedAttributes.Synthetic)) } -export function isOptionalType(type: IDLType): type is IDLOptionalType { +export function isOptionalType(type: IDLNode): type is IDLOptionalType { return type.kind === IDLKind.OptionalType } @@ -1167,20 +1167,17 @@ export function toIDLType(typeName: string): IDLType { } } -export function maybeOptional(type: IDLType, optional?: boolean): IDLType { - if (optional === undefined) { - return type +export function maybeUnwrapOptionalType(type: IDLType): IDLType { + if (isOptionalType(type)) { + return type.type } + return type +} + +export function maybeOptional(type: IDLType, optional = false): IDLType { if (optional) { - if (isOptionalType(type)) { - return type - } return createOptionalType(type) } - - if (isOptionalType(type)) { - return type.type - } return type } diff --git a/src/peer-generation/ArgConvertors.ts b/src/peer-generation/ArgConvertors.ts index a57c66b8..87c25ac0 100644 --- a/src/peer-generation/ArgConvertors.ts +++ b/src/peer-generation/ArgConvertors.ts @@ -721,7 +721,7 @@ export class OptionConvertor extends BaseArgConvertor { // if (!runtimeTypes.includes(RuntimeType.UNDEFINED)) { runtimeTypes.push(RuntimeType.UNDEFINED) } - super(idl.maybeOptional(conv.idlType, true), runtimeTypes, conv.isScoped, true, param) + super(idl.createOptionalType(conv.idlType), runtimeTypes, conv.isScoped, true, param) this.typeConvertor = conv } convertorArg(param: string, writer: LanguageWriter): string { diff --git a/src/peer-generation/BuilderClass.ts b/src/peer-generation/BuilderClass.ts index 55bb1878..6856ec18 100644 --- a/src/peer-generation/BuilderClass.ts +++ b/src/peer-generation/BuilderClass.ts @@ -19,7 +19,7 @@ import { ImportFeature } from "./ImportsCollector" import { Language } from "../Language"; import { PeerLibrary } from "./PeerLibrary"; import { convertTypeToFeature } from "./idl/IdlPeerGeneratorVisitor"; -import { createReferenceType, IDLThisType, IDLType, IDLVoidType, maybeOptional, toIDLType } from "../idl" +import { createReferenceType, IDLThisType, IDLType, IDLVoidType } from "../idl" function builderMethod(name: string, type: IDLType): Method { return new Method(name, new NamedMethodSignature(IDLThisType, [type], ["value"])) diff --git a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts index 69fd5280..255210a4 100644 --- a/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts +++ b/src/peer-generation/LanguageWriters/writers/TsLanguageWriter.ts @@ -284,7 +284,20 @@ export class TSLanguageWriter extends LanguageWriter { const typeParams = generics?.length ? `<${generics.join(", ")}>` : "" // FIXME: const isSetter = modifiers?.includes(MethodModifier.SETTER) - this.printer.print(`${prefix}${name}${typeParams}(${signature.args.map((it, index) => `${signature.argName(index)}${idl.isOptionalType(it) && !isSetter ? "?" : ""}: ${this.getNodeName(it)}${signature.argDefault(index) ? ' = ' + signature.argDefault(index) : ""}`).join(", ")})${needReturn ? ": " + this.getNodeName(signature.returnType) : ""} ${needBracket ? "{" : ""}`) + const canBeOptional: boolean[] = [] + for (let i = signature.args.length - 1; i >= 0; --i) { + const prevCanBeOptional = canBeOptional.at(-1) ?? true + const curr = signature.args[i] + + const result = prevCanBeOptional && (idl.isOptionalType(curr) || signature.argDefault(i) !== undefined) + canBeOptional.push(result) + } + canBeOptional.reverse() + const isOptional = signature.args.map((it, i) => idl.isOptionalType(it) && canBeOptional[i] && !isSetter) + const normalizedArgs = signature.args.map((it, i) => + idl.isOptionalType(it) && isOptional[i] ? idl.maybeUnwrapOptionalType(it) : it + ) + this.printer.print(`${prefix}${name}${typeParams}(${normalizedArgs.map((it, index) => `${signature.argName(index)}${isOptional[index] ? "?" : ""}: ${this.getNodeName(it)}${signature.argDefault(index) ? ' = ' + signature.argDefault(index) : ""}`).join(", ")})${needReturn ? ": " + this.getNodeName(signature.returnType) : ""} ${needBracket ? "{" : ""}`) } makeNull(): LanguageExpression { return new StringExpression("undefined") @@ -317,7 +330,7 @@ export class TSLanguageWriter extends LanguageWriter { this.print(`console.log("${message}")`) } makeCast(value: LanguageExpression, type: idl.IDLType, options?: MakeCastOptions): LanguageExpression { - return new TSCastExpression(value, this.getNodeName(/* FIXME: */ idl.maybeOptional(type, false)), options?.unsafe ?? false) + return new TSCastExpression(value, this.getNodeName(/* FIXME: */ idl.maybeUnwrapOptionalType(type)), options?.unsafe ?? false) } getObjectAccessor(convertor: ArgConvertor, value: string, args?: ObjectArgs): string { if (convertor.useArray && args?.index != undefined) { diff --git a/src/peer-generation/OhosGenerator.ts b/src/peer-generation/OhosGenerator.ts index 3fa10737..7d2fc14d 100644 --- a/src/peer-generation/OhosGenerator.ts +++ b/src/peer-generation/OhosGenerator.ts @@ -15,7 +15,7 @@ import * as fs from 'fs' import * as path from 'path' -import { createConstructor, createContainerType, createReferenceType, createTypeParameterReference, forceAsNamedNode, getExtAttribute, hasExtAttribute, IDLCallback, IDLConstructor, IDLEntry, IDLEnum, IDLExtendedAttributes, IDLI32Type, IDLInterface, IDLMethod, IDLNumberType, IDLParameter, IDLPointerType, IDLType, IDLU8Type, IDLUint8ArrayType, IDLVoidType, isCallback, isClass, isConstructor, isContainerType, isEnum, isInterface, isMethod, isReferenceType, isType, isUnionType, maybeOptional } from '../idl' +import { createConstructor, createContainerType, createOptionalType, createReferenceType, createTypeParameterReference, forceAsNamedNode, getExtAttribute, hasExtAttribute, IDLCallback, IDLConstructor, IDLEntry, IDLEnum, IDLExtendedAttributes, IDLI32Type, IDLInterface, IDLMethod, IDLNumberType, IDLParameter, IDLPointerType, IDLType, IDLU8Type, IDLUint8ArrayType, IDLVoidType, isCallback, isClass, isConstructor, isContainerType, isEnum, isInterface, isMethod, isReferenceType, isType, isUnionType, maybeOptional } from '../idl' import { IndentedPrinter } from "../IndentedPrinter" import { PeerLibrary } from './PeerLibrary' import { Language } from '../Language' @@ -460,7 +460,7 @@ class OHOSVisitor { // TODO refactor MaterializedPrinter to generate OHOS peers // write getPeer() method - const getPeerSig = new MethodSignature(maybeOptional(createReferenceType("Finalizable"), true),[]) + const getPeerSig = new MethodSignature(createOptionalType(createReferenceType("Finalizable")),[]) writer.writeMethodImplementation(new Method("getPeer", getPeerSig), writer => { // TODO add better (platform-agnostic) way to return Finalizable writer.writeStatement(writer.makeReturn(writer.makeString("{ ptr: this.peer }"))) diff --git a/src/peer-generation/PeerLibrary.ts b/src/peer-generation/PeerLibrary.ts index e3466e3b..98443144 100644 --- a/src/peer-generation/PeerLibrary.ts +++ b/src/peer-generation/PeerLibrary.ts @@ -174,7 +174,7 @@ export class PeerLibrary implements LibraryInterface { typeConvertor(param: string, type: idl.IDLType, isOptionalParam = false): ArgConvertor { if (isOptionalParam) { - return new OptionConvertor(this, param, idl.maybeOptional(type, false)) + return new OptionConvertor(this, param, idl.maybeUnwrapOptionalType(type)) } if (idl.isOptionalType(type)) { return new OptionConvertor(this, param, type.type) diff --git a/src/peer-generation/idl/DependencySorter.ts b/src/peer-generation/idl/DependencySorter.ts index 666b03db..bed7dc32 100644 --- a/src/peer-generation/idl/DependencySorter.ts +++ b/src/peer-generation/idl/DependencySorter.ts @@ -79,6 +79,9 @@ export class DependencySorter { for (const type of target.elementType) this.addDep(this.library.toDeclaration(type)) } + if (idl.isOptionalType(target)) { + this.addDep(this.library.toDeclaration(target.type)) + } if (idl.isCallback(target)) { for (const parameter of target.parameters) this.addDep(this.library.toDeclaration(parameter.type!)) diff --git a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts index e8ad7b46..a200607f 100644 --- a/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts +++ b/src/peer-generation/idl/IdlPeerGeneratorVisitor.ts @@ -200,6 +200,10 @@ function generateRetConvertor(type?: idl.IDLType): RetConvertor { // TODO convert to convertor ;) function mapCInteropRetType(type: idl.IDLType): string { + // probably wrong + if (idl.isOptionalType(type)) { + return mapCInteropRetType(type.type) + } if (idl.isPrimitiveType(type)) { switch (type) { case idl.IDLBooleanType: return PrimitiveType.Boolean.getText() @@ -209,6 +213,7 @@ function mapCInteropRetType(type: idl.IDLType): string { case idl.IDLVoidType: case idl.IDLThisType: case idl.IDLUndefinedType: + case idl.IDLUnknownType: return "void" } } @@ -231,7 +236,7 @@ function mapCInteropRetType(type: idl.IDLType): string { } else return PrimitiveType.NativePointer.getText() } - throw `mapCInteropType failed for ${idl.IDLKind[type.kind]}` + throw new Error(`mapCInteropType failed for ${idl.IDLKind[type.kind]}`) } diff --git a/src/peer-generation/printers/BuilderClassPrinter.ts b/src/peer-generation/printers/BuilderClassPrinter.ts index 043acad5..3cb36e6a 100644 --- a/src/peer-generation/printers/BuilderClassPrinter.ts +++ b/src/peer-generation/printers/BuilderClassPrinter.ts @@ -23,7 +23,7 @@ import { ImportsCollector } from "../ImportsCollector"; import { ARKOALA_PACKAGE, ARKOALA_PACKAGE_PATH } from "./lang/Java"; import { PeerLibrary } from "../PeerLibrary"; import { Language } from "../../Language"; -import { forceAsNamedNode, IDLType, IDLVoidType, isOptionalType, maybeOptional, toIDLType } from "../../idl"; +import { createOptionalType, forceAsNamedNode, IDLType, IDLVoidType, isOptionalType, toIDLType } from "../../idl"; interface BuilderClassFileVisitor { printFile(): void @@ -361,7 +361,7 @@ function syntheticName(name: string): string { function toSyntheticField(method: Method): Field { const type = method.signature.args[0] - return new Field(syntheticName(method.name), maybeOptional(type, true)) + return new Field(syntheticName(method.name), createOptionalType(type)) } function collapse(methods: Method[]): Method[] { @@ -388,7 +388,7 @@ function processTSBuilderClass(clazz: BuilderClass): BuilderClass { const ctorFields = constructors.flatMap(cons => { const ctorSig = cons.signature - return ctorSig.args.map((type, index) => new Field(syntheticName(ctorSig.argName(index)), maybeOptional(type, true))) + return ctorSig.args.map((type, index) => new Field(syntheticName(ctorSig.argName(index)), createOptionalType(type))) }) const syntheticFields = methods diff --git a/src/peer-generation/printers/MaterializedPrinter.ts b/src/peer-generation/printers/MaterializedPrinter.ts index 0d01c09c..5d350fb5 100644 --- a/src/peer-generation/printers/MaterializedPrinter.ts +++ b/src/peer-generation/printers/MaterializedPrinter.ts @@ -172,7 +172,7 @@ class TSMaterializedFileVisitor extends MaterializedFileVisitorBase { }) // write getPeer() method - const getPeerSig = new MethodSignature(idl.maybeOptional(idl.createReferenceType("Finalizable"), true),[]) + const getPeerSig = new MethodSignature(idl.createOptionalType(idl.createReferenceType("Finalizable")),[]) writer.writeMethodImplementation(new Method("getPeer", getPeerSig), writer => { writer.writeStatement(writer.makeReturn(writer.makeString("this.peer"))) }) @@ -205,7 +205,7 @@ class TSMaterializedFileVisitor extends MaterializedFileVisitorBase { const ctorSig = clazz.ctor.method.signature as NamedMethodSignature const sigWithPointer = new NamedMethodSignature( ctorSig.returnType, - ctorSig.args.map(it => maybeOptional(it, true)), + ctorSig.args.map(it => idl.createOptionalType(it)), ctorSig.argsNames, ctorSig.defaults) diff --git a/src/peer-generation/printers/PeersPrinter.ts b/src/peer-generation/printers/PeersPrinter.ts index bd3a6ebc..e91627f0 100644 --- a/src/peer-generation/printers/PeersPrinter.ts +++ b/src/peer-generation/printers/PeersPrinter.ts @@ -42,7 +42,7 @@ import { PeerMethod } from "../PeerMethod"; import { collectJavaImports } from "./lang/JavaIdlUtils"; import { printJavaImports } from "./lang/JavaPrinters"; import { Language } from "../../Language"; -import { forceAsNamedNode, IDLI32Type, IDLPointerType, IDLStringType, IDLThisType, IDLType, IDLVoidType, isNamedNode, isOptionalType, isPrimitiveType, maybeOptional, toIDLType } from "../../idl"; +import { createOptionalType, forceAsNamedNode, IDLI32Type, IDLPointerType, IDLStringType, IDLThisType, IDLType, IDLVoidType, isNamedNode, isOptionalType, isPrimitiveType, maybeOptional, toIDLType } from "../../idl"; import { getReferenceResolver } from "../ReferenceResolver"; export function componentToPeerClass(component: string) { @@ -171,7 +171,7 @@ class PeerFileVisitor { const peerClass = componentToPeerClass(peer.componentName) const signature = new NamedMethodSignature( toIDLType(peerClass), - [toIDLType('ArkUINodeType'), maybeOptional(toIDLType('ComponentBase'), true), IDLI32Type], + [toIDLType('ArkUINodeType'), createOptionalType(toIDLType('ComponentBase')), IDLI32Type], ['nodeType', 'component', 'flags'], [undefined, undefined, '0']) diff --git a/src/peer-generation/printers/SerializerPrinter.ts b/src/peer-generation/printers/SerializerPrinter.ts index c58a4d5b..9e96a548 100644 --- a/src/peer-generation/printers/SerializerPrinter.ts +++ b/src/peer-generation/printers/SerializerPrinter.ts @@ -344,7 +344,7 @@ class IdlDeserializerPrinter {///converge w/ IdlSerP? const continuationReference = this.library.createContinuationCallbackReference(target.returnType) const continuationConvertor = this.library.typeConvertor(continuationCallbackName, continuationReference) const returnType = target.returnType - const optionalReturnType = idl.maybeOptional(target.returnType, true) + const optionalReturnType = idl.createOptionalType(target.returnType) continuation = [ writer.makeAssign(continuationValueName, optionalReturnType, undefined, true, false), writer.makeAssign( -- Gitee From fe6e3a7b9f6a0ae6ad8ad77468ea000d3aa16ad6 Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Thu, 21 Nov 2024 12:16:02 +0000 Subject: [PATCH 51/53] !1016 Complete vsync * Bring back pipelineContext * Complete vsync --- templates/bridge_custom_prologue.cc | 10 ++++------ templates/dummy_impl_prologue.cc | 2 -- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/templates/bridge_custom_prologue.cc b/templates/bridge_custom_prologue.cc index f4278c8f..5f7415b7 100644 --- a/templates/bridge_custom_prologue.cc +++ b/templates/bridge_custom_prologue.cc @@ -343,8 +343,6 @@ void impl_SetLazyItemIndexer(KVMContext vmContext, Ark_NativePointer nodePtr, Ar } KOALA_INTEROP_CTX_V2(SetLazyItemIndexer, Ark_NativePointer, Ark_Int32) -KVMDeferred* vsyncDeferred = nullptr; - // TODO: map if multiple pipeline contexts. static KVMDeferred* currentVsyncDeferred = nullptr; @@ -364,11 +362,11 @@ KOALA_INTEROP_V1(SetVsyncCallback, Ark_NativePointer) KVMObjectHandle impl_VSyncAwait(KVMContext vmContext, Ark_NativePointer pipelineContext) { - Ark_PipelineContext pipelineContextCast = (Ark_PipelineContext) pipelineContext; + Ark_PipelineContext pipelineContextCast = (Ark_PipelineContext)pipelineContext; KVMObjectHandle result = nullptr; KVMDeferred* deferred = CreateDeferred(vmContext, &result); if (currentVsyncDeferred) { - fprintf(stderr, "Multiple unresolved vsync deferred\n"); + LOGE("%s", "Multiple unresolved vsync deferred"); currentVsyncDeferred->reject(currentVsyncDeferred, "Wrong"); } currentVsyncDeferred = deferred; @@ -376,14 +374,14 @@ KVMObjectHandle impl_VSyncAwait(KVMContext vmContext, Ark_NativePointer pipeline } KOALA_INTEROP_CTX_1(VSyncAwait, KVMObjectHandle, Ark_NativePointer) -void impl_UnblockVsyncWait(KVMContext vmContext, Ark_NativePointer pipelineContext) +void impl_UnblockVsyncWait(Ark_NativePointer pipelineContext) { if (currentVsyncDeferred) { currentVsyncDeferred->resolve(currentVsyncDeferred, nullptr, 0); currentVsyncDeferred = nullptr; } } -KOALA_INTEROP_CTX_V1(UnblockVsyncWait, Ark_NativePointer) +KOALA_INTEROP_V1(UnblockVsyncWait, Ark_NativePointer) void impl_SetCustomCallback(KVMContext vmContext, Ark_NativePointer nodePtr, Ark_Int32 updaterId) { diff --git a/templates/dummy_impl_prologue.cc b/templates/dummy_impl_prologue.cc index f8610248..0fa81358 100644 --- a/templates/dummy_impl_prologue.cc +++ b/templates/dummy_impl_prologue.cc @@ -772,7 +772,6 @@ void SetLazyItemIndexer(Ark_VMContext vmContext, Ark_NodeHandle nodePtr, Ark_Int Ark_PipelineContext GetPipelineContext(Ark_NodeHandle node) { return (Ark_PipelineContext)42; } - void SetVsyncCallback(Ark_PipelineContext pipelineContext, Ark_VsyncCallback callback) { auto producer = std::thread([pipelineContext, callback] { while (true) { @@ -782,7 +781,6 @@ void SetVsyncCallback(Ark_PipelineContext pipelineContext, Ark_VsyncCallback cal }); producer.detach(); } - void SetChildTotalCount(Ark_NodeHandle node, Ark_Int32 totalCount) {} void ShowCrash(Ark_CharPtr message) {} } -- Gitee From c54fb407b07db08da36f9a46dc8fd1f51a7f0dec Mon Sep 17 00:00:00 2001 From: tsvetkovaelena Date: Thu, 21 Nov 2024 12:36:35 +0000 Subject: [PATCH 52/53] !1017 Edited synthetic tuple type naming * Added search for duplicate SYNTHETIC declarations * Revert subset fixes * Edited synthetic tuple type naming --- src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 3fadbe30..6607600c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -25,6 +25,7 @@ import { isClass, isEnum, isInterface, + isSyntheticEntry, toIDLString, transformMethodsAsync2ReturnPromise } from "./idl" @@ -347,7 +348,8 @@ if (options.dts2peer) { !idlLibrary.files.find(peerFile => peerFile.entries.find(entry => { if (([newEntry, entry].every(isInterface) || [newEntry, entry].every(isClass) - || [newEntry, entry].every(isEnum))) { + || [newEntry, entry].every(isEnum) + || [newEntry, entry].every(isSyntheticEntry))) { if (newEntry.name === entry.name) { console.warn(`WARNING: Skip entry:'${newEntry.name}'(${sourceFile.fileName}) already exists in ${peerFile.originalFilename}`) return true -- Gitee From 87c56f048d577f6e54178b3ae3561501d257098d Mon Sep 17 00:00:00 2001 From: tsvetkovaelena Date: Thu, 21 Nov 2024 12:52:27 +0000 Subject: [PATCH 53/53] !1018 Edited arkts-subset * arkts subset fixes --- tests/arkts-subset/ets/calendar_picker.d.ts | 2 +- tests/arkts-subset/ets/units.d.ts | 74 ++++++++++----------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/tests/arkts-subset/ets/calendar_picker.d.ts b/tests/arkts-subset/ets/calendar_picker.d.ts index 5744287f..cf2e6991 100644 --- a/tests/arkts-subset/ets/calendar_picker.d.ts +++ b/tests/arkts-subset/ets/calendar_picker.d.ts @@ -12,7 +12,7 @@ declare interface CalendarPickerInterface { declare class CalendarPickerAttribute extends CommonMethod { edgeAlign(alignType: CalendarAlign, offset?: Offset): CalendarPickerAttribute; - altEdgeAlign(alignType: CalendarAlign, offset?: AltOffset): CalendarPickerAttribute; + // altEdgeAlign(alignType: CalendarAlign, offset?: AltOffset): CalendarPickerAttribute; } declare const CalendarPicker: CalendarPickerInterface \ No newline at end of file diff --git a/tests/arkts-subset/ets/units.d.ts b/tests/arkts-subset/ets/units.d.ts index 02be5d05..d5da01bd 100644 --- a/tests/arkts-subset/ets/units.d.ts +++ b/tests/arkts-subset/ets/units.d.ts @@ -18,43 +18,43 @@ * @kit ArkUI */ -/** - * Defines the data type of the interface restriction. - * - * @typedef { import('../api/global/resource').Resource } Resource - * @interface Resource - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ -/** - * Defines the data type of the interface restriction. - * - * @typedef { import('../api/global/resource').Resource } Resource - * @interface Resource - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ -/** - * Defines the data type of the interface restriction. - * - * @typedef { import('../api/global/resource').Resource } Resource - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ -/** - * Defines the data type of the interface restriction. - * - * @typedef { import('../api/global/resource').Resource } Resource - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - */ -declare type Resource = import('../api/global/resource').Resource; +// /** +// * Defines the data type of the interface restriction. +// * +// * @typedef { import('../api/global/resource').Resource } Resource +// * @interface Resource +// * @syscap SystemCapability.ArkUI.ArkUI.Full +// * @since 7 +// */ +// /** +// * Defines the data type of the interface restriction. +// * +// * @typedef { import('../api/global/resource').Resource } Resource +// * @interface Resource +// * @syscap SystemCapability.ArkUI.ArkUI.Full +// * @form +// * @since 9 +// */ +// /** +// * Defines the data type of the interface restriction. +// * +// * @typedef { import('../api/global/resource').Resource } Resource +// * @syscap SystemCapability.ArkUI.ArkUI.Full +// * @crossplatform +// * @form +// * @since 10 +// */ +// /** +// * Defines the data type of the interface restriction. +// * +// * @typedef { import('../api/global/resource').Resource } Resource +// * @syscap SystemCapability.ArkUI.ArkUI.Full +// * @crossplatform +// * @form +// * @atomicservice +// * @since 11 +// */ +// declare type Resource = import('../api/global/resource').Resource; /** * Defines the length property with string, number and resource unit. -- Gitee