-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathindex.d.ts
244 lines (169 loc) · 6.05 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
import { Application } from '@nativescript/core';
import { IAdmob, IInterstitialAd, IRewardedAd, BannerAdBase, IRewardedInterstitialAd, RewardedAdEventType, MaxAdContentRating, ServerSideVerificationOptions } from './common';
export { MaxAdContentRating, RewardedAdEventType };
export type AdEventListener = (type: AdEventType | RewardedAdEventType, error?: Error, data?: any | IRewardedItem) => void;
export * from './adsconsent';
export * from './nativead';
export interface AdShowOptions {
immersiveModeEnabled: undefined | false | true;
}
export interface RequestConfiguration {
maxAdContentRating?: MaxAdContentRating.G | MaxAdContentRating.PG | MaxAdContentRating.T | MaxAdContentRating.MA;
tagForChildDirectedTreatment?: undefined | false | true;
tagForUnderAgeOfConsent?: undefined | false | true;
testDevices?: string[];
}
export interface RequestOptions {
contentUrl?: undefined | string;
keywords?: string[];
networkExtras?: undefined | { [key: string]: string };
requestAgent?: undefined | string;
requestNonPersonalizedAdsOnly?: undefined | false | true;
}
export interface ManagerRequestOptions extends RequestOptions {
publisherProvidedId?: string;
customTargeting?: { [key: string]: string | string[] };
categoryExclusions?: string[];
adString?: string;
}
export interface IRewardedItem {
amount: number;
type: string;
}
export interface TestIds {
BANNER: string;
INTERSTITIAL: string;
REWARDED: string;
}
export interface IAdmob {
app: FirebaseApp;
setRequestConfiguration(requestConfiguration: RequestConfiguration);
}
export interface AdapterStatus {
description: string;
latency: number;
initializationState: AdapterStatusState;
}
export interface IMobileAd {
adUnitId: string;
loaded: boolean;
load(): void;
onAdEvent(listener?: AdEventListener);
show(showOptions?: AdShowOptions);
}
export interface IRewardedInterstitialAd extends IInterstitialAd {
setServerSideVerificationOptions(options: ServerSideVerificationOptions): void;
}
export interface ServerSideVerificationOptions {
userId: string;
customData: string;
}
export interface IInterstitialAd extends IMobileAd {}
export interface IRewardedAd extends IMobileAd {
setServerSideVerificationOptions(options: ServerSideVerificationOptions): void;
}
export declare class AdRequest {
readonly contentUrl: string;
readonly keywords: string[];
readonly neighboringContentUrls: string[];
readonly native: any;
readonly android: any;
readonly ios: any;
isTestDevice(): boolean;
}
export declare class InterstitialAd implements IInterstitialAd {
static createForAdRequest(adUnitId: string): InterstitialAd;
static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): InterstitialAd;
readonly adUnitId: string;
readonly loaded: boolean;
load(): void;
onAdEvent(listener: AdEventListener);
show(showOptions?: AdShowOptions);
readonly native: any;
readonly android: any;
readonly ios: any;
}
export declare class RewardedInterstitialAd implements IRewardedInterstitialAd {
static createForAdRequest(adUnitId: string): RewardedInterstitialAd;
static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): RewardedInterstitialAd;
readonly adUnitId: string;
readonly loaded: boolean;
load(): void;
onAdEvent(listener: AdEventListener);
show(showOptions?: AdShowOptions);
setServerSideVerificationOptions(options: ServerSideVerificationOptions): void;
readonly native: any;
readonly android: any;
readonly ios: any;
}
export declare class RewardedAd implements IRewardedAd {
static createForAdRequest(adUnitId: string): RewardedAd;
static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): RewardedAd;
readonly adUnitId: string;
readonly loaded: boolean;
load(): void;
onAdEvent(listener: AdEventListener);
show(showOptions?: AdShowOptions);
setServerSideVerificationOptions(options: ServerSideVerificationOptions): void;
readonly native: any;
readonly android: any;
readonly ios: any;
}
export declare class RewardedItem implements IRewardedItem {
readonly amount: number;
readonly type: string;
readonly native: any;
readonly android: any;
readonly ios: any;
}
export declare class BannerAd extends BannerAdBase {
size: BannerAdSize;
unitId: string;
load(options?: RequestOptions);
isLoading(): boolean;
on(event: 'adClicked', callback: (args: any) => void, thisArg?: any);
on(event: 'adLoaded', callback: (args: any) => void, thisArg?: any);
on(event: 'adClosed', callback: (args: any) => void, thisArg?: any);
on(event: 'adImpression', callback: (args: any) => void, thisArg?: any);
on(event: 'adFailedToLoad', callback: (args: any) => void, thisArg?: any);
}
export declare class BannerAdSize extends BannerAdSizeBase {
constructor(width: number, height: number);
static readonly BANNER: BannerAdSize;
static readonly FULL_BANNER: BannerAdSize;
static readonly LARGE_BANNER: BannerAdSize;
static readonly LEADERBOARD: BannerAdSize;
static readonly MEDIUM_RECTANGLE: BannerAdSize;
static readonly FLUID: BannerAdSize;
static readonly WIDE_SKYSCRAPER: BannerAdSize;
static readonly INVALID: BannerAdSize;
static readonly SEARCH: BannerAdSize;
static createAnchoredAdaptiveBanner(width: number, orientation: 'portrait' | 'landscape' | 'device' = 'device'): BannerAdSize;
static createInLineAdaptiveBanner(width: number, maxHeight: number = 0, orientation: 'portrait' | 'landscape' | 'device' = 'device'): BannerAdSize;
readonly native: any;
readonly android: any;
readonly ios: any;
}
export declare class Admob implements IAdmob {
readonly app: any;
static init(): Promise<{ [key: string]: AdapterStatus }>;
static getInstance(): Admob;
requestConfiguration: RequestConfiguration;
/**
* @deprecated Use requestConfiguration
*/
setRequestConfiguration(requestConfiguration: RequestConfiguration);
/**
* @deprecated Use requestConfiguration
*/
getRequestConfiguration(requestConfiguration: RequestConfiguration);
}
export enum AdapterStatusState {
NOT_READY,
READY,
}
export interface AdapterStatus {
description: string;
latency: number;
initializationState: AdapterStatusState;
}