1
1
import { ContainerView , CoreTypes , CSSType , Property , View } from '@nativescript/core' ;
2
- import { AdEventListener , AdEventType , BannerAdSizeBase , ManagerRequestOptions } from '../common' ;
2
+ import { AdEventType } from '../common' ;
3
+ import { IMediaContent , INativeAd } from '.' ;
3
4
4
5
@CSSType ( 'NativeAdView' )
5
6
export abstract class NativeAdViewBase extends ContainerView {
@@ -28,22 +29,14 @@ export abstract class NativeAdViewBase extends ContainerView {
28
29
abstract storeView : View ;
29
30
}
30
31
31
- export interface IMediaContent {
32
- aspectRatio : number ;
33
- currentTime : number ;
34
- duration : number ;
35
- mainImage : any ;
36
- hasVideoContent : boolean ;
37
- }
38
-
39
32
export const stretchProperty = new Property < MediaViewBase , CoreTypes . ImageStretchType > ( {
40
33
name : 'stretch' ,
41
34
defaultValue : 'aspectFit' ,
42
35
affectsLayout : global . isIOS ,
43
36
} ) ;
44
37
45
38
export const mediaContentProperty = new Property < MediaViewBase , IMediaContent > ( {
46
- name : 'mediaContent'
39
+ name : 'mediaContent' ,
47
40
} ) ;
48
41
49
42
@CSSType ( 'MediaView' )
@@ -62,22 +55,6 @@ export enum VideoStatus {
62
55
Ended ,
63
56
}
64
57
65
- export interface IVideoController {
66
- status : VideoStatus ;
67
-
68
- clickToExpandEnabled ( ) : boolean ;
69
-
70
- customControlsEnabled ( ) : boolean ;
71
-
72
- pause ( ) : void ;
73
-
74
- play ( ) : void ;
75
-
76
- mute : boolean ;
77
-
78
- stop ( ) : void ;
79
- }
80
-
81
58
export enum MediaAspectRatio {
82
59
LANDSCAPE = 'landscape' ,
83
60
PORTRAIT = 'portrait' ,
@@ -92,73 +69,8 @@ export enum AdChoicesPlacement {
92
69
BOTTOM_LEFT = 'bottomLeft' ,
93
70
}
94
71
95
- export interface NativeAdOptions {
96
- nativeAdOptions ?: {
97
- adChoicesPlacement ?: AdChoicesPlacement ;
98
- mediaAspectRatio ?: MediaAspectRatio ;
99
- customMuteThisAd ?: boolean ;
100
- multipleImages ?: boolean ;
101
- returnUrlsForImageAssets ?: boolean ;
102
- videoOptions ?: {
103
- startMuted ?: boolean ;
104
- clickToExpandRequested ?: boolean ;
105
- customControlsRequested ?: boolean ;
106
- } ;
107
- } ;
108
- adSizes ?: BannerAdSizeBase [ ] ;
109
- adManagerAdViewOptions ?: {
110
- manualImpressionsEnabled ?: boolean ;
111
- shouldDelayBannerRendering ?: boolean ;
112
- } ;
113
- }
114
-
115
- export interface IResponseInfo { }
116
-
117
- export interface UnconfirmedClickListener {
118
- unconfirmedClickReceived ?( value : string ) ;
119
- unconfirmedClickCancelled ?( ) : void ;
120
- }
121
-
122
- export interface IMuteThisAdReason {
123
- description : string ;
124
- }
125
-
126
- export class INativeAdImage {
127
- image : any ;
128
- url : string ;
129
- scale : number ;
130
- }
131
-
132
72
export enum NativeAdEventType {
133
73
LOADED = 'native_ad_loaded' ,
134
74
}
135
75
136
76
export type NativeAdEventListener = ( type : AdEventType | NativeAdEventType , error ?: Error , data ?: any | INativeAd ) => void ;
137
-
138
- export interface INativeAdLoader {
139
- isLoading ( ) : boolean ;
140
- load ( maxAdCount ?: number ) : void ;
141
- load ( requestOptions ?: ManagerRequestOptions ) : void ;
142
- load ( ) : void ;
143
- onAdEvent ( listener : NativeAdEventListener ) ;
144
- }
145
-
146
- export interface INativeAd {
147
- adUnitId : string ;
148
- onAdEvent ( listener : AdEventListener ) ;
149
- destroy ( ) : void ;
150
- advertiser : string ;
151
- body : string ;
152
- callToAction : string ;
153
- headline : string ;
154
- price : string ;
155
- isCustomClickGestureEnabled ( ) : boolean ;
156
- enableCustomClickGesture ( ) : void ;
157
- recordCustomClickGesture ( ) : void ;
158
- setUnconfirmedClickListener ( listener ?: UnconfirmedClickListener ) : void ;
159
- images : INativeAdImage [ ] ;
160
- icon : INativeAdImage ;
161
- store : string ;
162
- starRating : number ;
163
- muteThisAdReasons : IMuteThisAdReason [ ] ;
164
- }
0 commit comments