UNPKG

2.7 kBTypeScriptView Raw
1import * as React from 'react';
2import { View } from 'react-native';
3declare type AppEvent = {
4 [eventName: string]: any;
5};
6declare type PropsType = React.ComponentProps<typeof View> & {
7 /**
8 * AdMob iOS library banner size constants
9 * (https://developers.google.com/admob/ios/banner)
10 * banner (320x50, Standard Banner for Phones and Tablets)
11 * largeBanner (320x100, Large Banner for Phones and Tablets)
12 * mediumRectangle (300x250, IAB Medium Rectangle for Phones and Tablets)
13 * fullBanner (468x60, IAB Full-Size Banner for Tablets)
14 * leaderboard (728x90, IAB Leaderboard for Tablets)
15 * smartBannerPortrait (Screen width x 32|50|90, Smart Banner for Phones and Tablets)
16 * smartBannerLandscape (Screen width x 32|50|90, Smart Banner for Phones and Tablets)
17 *
18 * banner is default
19 */
20 bannerSize: 'banner' | 'largeBanner' | 'mediumRectangle' | 'fullBanner' | 'leaderboard' | 'smartBannerPortrait' | 'smartBannerLandscape';
21 /**
22 * AdMob ad unit ID
23 */
24 adUnitID?: string;
25 /**
26 * Additional request params added to underlying request for the ad.
27 */
28 additionalRequestParams?: {
29 [key: string]: string;
30 };
31 /**
32 * Whether the SDK should serve personalized ads (use only with user's consent). If this value is
33 * `false` or `undefined`, this sets the `npa` key of `additionalRequestParams` to `'1'` following
34 * https://developers.google.com/admob/ios/eu-consent#forward_consent_to_the_google_mobile_ads_sdk
35 * and
36 * https://developers.google.com/admob/android/eu-consent#forward_consent_to_the_google_mobile_ads_sdk.
37 */
38 servePersonalizedAds?: boolean;
39 /**
40 * AdMob iOS library events
41 */
42 onAdViewDidReceiveAd?: () => void;
43 onDidFailToReceiveAdWithError?: (error: string) => void;
44 onAdViewWillPresentScreen?: () => void;
45 onAdViewWillDismissScreen?: () => void;
46 onAdViewDidDismissScreen?: () => void;
47 onAdViewWillLeaveApplication?: () => void;
48 onAdMobDispatchAppEvent?: (event: AppEvent) => void;
49};
50declare type StateType = {
51 style: {
52 width?: number;
53 height?: number;
54 };
55};
56export default class PublisherBanner extends React.Component<PropsType, StateType> {
57 static defaultProps: {
58 bannerSize: string;
59 };
60 state: {
61 style: {};
62 };
63 _handleSizeChange: ({ nativeEvent }: {
64 nativeEvent: {
65 width: number;
66 height: number;
67 };
68 }) => void;
69 _handleDidFailToReceiveAdWithError: ({ nativeEvent }: {
70 nativeEvent: {
71 error: string;
72 };
73 }) => void | undefined;
74 render(): JSX.Element;
75}
76export {};