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 @BuilderParam adRenderer?: () => void; 88 89 /** 90 * The property to control the playback status of the roll ad. 91 * @type { ?number } 92 * @syscap SystemCapability.Advertising.Ads 93 * @since 15 94 */ 95 @Prop rollPlayState?: number; 96 97 /** 98 * The method to build ad component. 99 * @syscap SystemCapability.Advertising.Ads 100 * @since 11 101 */ 102 /** 103 * The method to build ad component. 104 * @syscap SystemCapability.Advertising.Ads 105 * @atomicservice 106 * @since 12 107 */ 108 build(): void; 109} 110 111export { AdComponent }; 112