@react-native-tapsell-mediation/tapsell
Version:
Tapsell Mediation package
134 lines (121 loc) • 4.35 kB
text/typescript
import { BannerSize } from './request/banner/BannerSize';
import type {
BannerAdStateListener,
InterstitialAdStateListener,
NativeAdStateListener,
RewardedAdStateListener,
} from './show/AdStateListener';
import { BannerPosition } from './show/banner/BannerPosition';
import { NativeAdDispatch } from './show/native/NativeAdDispatch';
export namespace ReactNativeTapsell {
export interface RequestCourier {
/**
* Requests a rewarded ad for the specified zone.
*
* @param {string} zoneId - The ID of the zone for the ad request
* @return {Promise<string>} A promise that resolves with the ad content
*/
requestRewardedAd(zoneId: string): Promise<string>;
/**
* Requests an interstitial ad for the specified zone.
*
* @param {string} zoneId - The ID of the zone for the ad request
* @return {Promise<string>} A promise that resolves with the ad content
*/
requestInterstitialAd(zoneId: string): Promise<string>;
/**
* Requests a banner advertisement for the specified zone and size.
*
* @param {string} zoneId - The ID of the zone for the ad request.
* @param {BannerSize} bannerSize - The size of the banner ad to request.
* @return {Promise<string>} A promise that resolves to the requested banner ad.
*/
requestBannerAd(zoneId: string, bannerSize: BannerSize): Promise<string>;
/**
* Requests a native ad for the specified zone.
*
* @param {string} zoneId - The ID of the zone for the ad request
* @return {Promise<string>} A promise that resolves with the ad content
*/
requestNativeAd(zoneId: string): Promise<string>;
/**
* Requests multiple native ads for the specified zone.
*
* @param {string} zoneId - The ID of the zone for the ad request
* @param {number} maximumCount - The maximum number of ads to request
* @return {Promise<string>} A promise that resolves with the ad content
*/
requestMultipleNativeAd(
zoneId: string,
maximumCount: number
): Promise<string>;
}
export interface ShowCourier {
/**
* Show a rewarded ad with the given ID and listen for ad state changes.
*
* @param {string} adId - The ID of the ad to show
* @param {RewardedAdStateListener} listener - The listener for ad state changes
* @return {void}
*/
showRewardedAd(adId: string, listener: RewardedAdStateListener): void;
/**
* Show an interstitial ad with the given ID and listen for ad state changes.
*
* @param {string} adId - The ID of the ad to show
* @param {InterstitialAdStateListener} listener - The listener for ad state changes
* @return {void}
*/
showInterstitialAd(
adId: string,
listener: InterstitialAdStateListener
): void;
/**
* Displays a banner advertisement at the specified position.
*
* @param {string} adId - The identifier of the ad to display.
* @param {BannerPosition} bannerPosition - The position to display the banner ad.
* @param {BannerAdStateListener} listener - The listener for ad state changes.
* @return {void}
*/
showBannerAd(
adId: string,
bannerPosition: BannerPosition,
listener: BannerAdStateListener
): void;
/**
* Show a native ad with the given ID and listen for ad state changes.
*
* @param {string} adId - The ID of the ad to show
* @param {NativeAdDispatch} adDispatch - The callbacks for the native ad content
* @param {NativeAdStateListener} listener - The listener for ad state changes
* @return {void}
*/
showNativeAd(
adId: string,
adDispatch: NativeAdDispatch,
listener: NativeAdStateListener
): void;
/**
* Click a native ad with the given ID
*
* @param {string} adId - The ID of the ad to show
* @return {void}
*/
clickNativeAd(adId: string): void;
/**
* Destroys the banner ad with the given ID.
*
* @param {string} adId - The ID of the ad to destroy
* @return {void}
*/
destroyBannerAd(adId: string): void;
/**
* Destroys the native ad with the given ID.
*
* @param {string} adId - The ID of the ad to destroy
* @return {void}
*/
destroyNativeAd(adId: string): void;
}
}