Add media_cached_image.d.ts

Signed-off-by: baosiyuan <baosiyuan@huawei.com>
This commit is contained in:
baosiyuan 2024-02-20 16:34:26 +08:00
parent d3cfbb0da8
commit be9ed60c52
5 changed files with 97 additions and 0 deletions

View File

@ -60,6 +60,7 @@
/// <reference path="./location_button.d.ts" />
/// <reference path="./matrix2d.d.ts" />
/// <reference path="./marquee.d.ts" />
/// <reference path="./media_cached_image.d.ts" />
/// <reference path="./menu.d.ts" />
/// <reference path="./menu_item.d.ts" />
/// <reference path="./menu_item_group.d.ts" />

View File

@ -0,0 +1,88 @@
/*
* 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.
*/
/**
* 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<string> }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @systemapi
* @since 12
*/
sources: Array<string>;
/**
* 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;

View File

@ -3899,6 +3899,7 @@ ast
astaire
astarte
astatine
astc
aster
asteria
asterisk

View File

@ -46,6 +46,7 @@
"ListItemGroup",
"LoadingProgress",
"Marquee",
"MediaCachedImage",
"Menu",
"MenuItem",
"MenuItemGroup",
@ -301,6 +302,11 @@
"type": "MarqueeAttribute",
"instance": "MarqueeInstance"
},
{
"name": "MediaCachedImage",
"type": "MediaCachedImageAttribute",
"instance": "MediaCachedImageInstance"
},
{
"name": "Menu",
"type": "MenuAttribute",

View File

@ -15,6 +15,7 @@
"calendar.d.ts",
"effect_component.d.ts",
"form_component.d.ts",
"media_cached_image.d.ts",
"plugin_component.d.ts",
"remote_window.d.ts",
"root_scene.d.ts",