1/* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file Defines the ad component 18 * @kit AdsKit 19 */ 20 21import advertising from './@ohos.advertising'; 22 23/** 24 * Defines the ad component. 25 * @syscap SystemCapability.Advertising.Ads 26 * @since 11 27 */ 28/** 29 * Defines the ad component. 30 * @syscap SystemCapability.Advertising.Ads 31 * @atomicservice 32 * @since 12 33 */ 34@Component 35declare struct AdComponent { 36 /** 37 * The ads to display. 38 * @type { Advertisement[] } 39 * @syscap SystemCapability.Advertising.Ads 40 * @since 11 41 */ 42 /** 43 * The ads to display. 44 * @type { Advertisement[] } 45 * @syscap SystemCapability.Advertising.Ads 46 * @atomicservice 47 * @since 12 48 */ 49 ads: advertising.Advertisement[]; 50 51 /** 52 * The interaction options info for displaying ads. 53 * @type { AdDisplayOptions } 54 * @syscap SystemCapability.Advertising.Ads 55 * @since 11 56 */ 57 /** 58 * The interaction options info for displaying ads. 59 * @type { AdDisplayOptions } 60 * @syscap SystemCapability.Advertising.Ads 61 * @atomicservice 62 * @since 12 63 */ 64 displayOptions: advertising.AdDisplayOptions; 65 66 /** 67 * The interaction listener to be registered that use to show ads. 68 * @type { AdInteractionListener } 69 * @syscap SystemCapability.Advertising.Ads 70 * @since 11 71 */ 72 /** 73 * The interaction listener to be registered that use to show ads. 74 * @type { AdInteractionListener } 75 * @syscap SystemCapability.Advertising.Ads 76 * @atomicservice 77 * @since 12 78 */ 79 interactionListener: advertising.AdInteractionListener; 80 81 /** 82 * The builder param to render customized ad content. 83 * @type { ?() => void } 84 * @syscap SystemCapability.Advertising.Ads 85 * @since 12 86 */ 87 /** 88 * The builder param to render customized ad content. 89 * @type { ?() => void } 90 * @syscap SystemCapability.Advertising.Ads 91 * @atomicservice 92 * @since 20 93 */ 94 @BuilderParam adRenderer?: () => void; 95 96 /** 97 * The property to control the playback status of the roll ad. 98 * @type { ?number } 99 * @syscap SystemCapability.Advertising.Ads 100 * @since 15 101 */ 102 /** 103 * The property to control the playback status of the roll ad. 104 * @type { ?number } 105 * @syscap SystemCapability.Advertising.Ads 106 * @atomicservice 107 * @since 20 108 */ 109 @Prop rollPlayState?: number; 110 111 /** 112 * The method to build ad component. 113 * @syscap SystemCapability.Advertising.Ads 114 * @since 11 115 */ 116 /** 117 * The method to build ad component. 118 * @syscap SystemCapability.Advertising.Ads 119 * @atomicservice 120 * @since 12 121 */ 122 build(): void; 123} 124 125export { AdComponent }; 126