Advertisement
Guest User

Invalid definition conversion

a guest
Jun 24th, 2016
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 4.38 KB | None | 0 0
  1. @JS('AdMob')
  2. library AdMob;
  3.  
  4. import "package:func/func.dart";
  5. import "package:js/js.dart";
  6. import 'dart:html';
  7.  
  8.  
  9.  /**
  10. *   TypeScript Definition for the cordova-admob-pro Cordova Plugin
  11. *   https://github.com/floatinghotpot/cordova-admob-pro
  12. */
  13. declare class AdMob {
  14.    
  15.     /**
  16.     * See google doc: http://developer.android.com/google/play-services/id.html
  17.     * See apple doc: https://developer.apple.com/library/ios/documentation/AdSupport/Reference/ASIdentifierManager_Ref/
  18.     *
  19.     * getAdSettings(function(data){
  20.     *   data.adId;  // UUID String
  21.     *   data.adTrackingEnabled; // bool
  22.     * }, function(){
  23.     *   // fail to get user ad settings
  24.     * });
  25.    
  26.  
  27.         */
  28.      external static void getAdSettings(Function successCallback , Function failureCallback );
  29.    
  30.     /**
  31.     * Set ad options
  32.     * Expects an instance of the AdMobOptions class
  33.     */
  34.      external static void setOptions(Object options , Function successCallback , Function failureCallback );
  35.    
  36.     /** Create and display a banner ad */
  37.      external static void createBanner(Object args , Function successCallback , Function failureCallback );
  38.    
  39.     /** Remove the currently displayed banner ad */
  40.      external static void removeBanner(Function successCallback , Function failureCallback );
  41.    
  42.     /** Hide the currently displayed banner ad */
  43.      external static void hideBanner(Function successCallback , Function failureCallback );
  44.    
  45.     /** Show the currently hidden banner ad */
  46.      external static void showBanner(Function successCallback , Function failureCallback );
  47.    
  48.     /** Show the current banner ad at a specific (x, y) location */
  49.      external static void showBannerAtXY(Number x , Number y , Function successCallback , Function failureCallback );
  50.    
  51.     /** Prepare an interstitial ad in the background */
  52.      external static void prepareInterstitial(Object args , Function successCallback , Function failureCallback );
  53.    
  54.     /** Show an interstitial ad that has been prepared */
  55.      external static void showInterstitial(Function successCallback , Function failureCallback );
  56.    
  57.     /** Check if an interstitial ad is ready yet or not */
  58.      external static void isInterstitialReady(Function successCallback , Function failureCallback );
  59.    
  60.     /** Prepare a reward video ad */
  61.      external static void prepareRewardVideoAd(Object args , Function successCallback , Function failureCallback );
  62.    
  63.     /** Show a prepared reward video ad */
  64.      external static void showRewardVideoAd(Function successCallback , Function failureCallback );
  65.  
  66. }
  67.  
  68. declare module AdMob {
  69.  
  70.     /** Constants for the various ad sizes */
  71.     class AD_SIZE {
  72.          static String SMART_BANNER;
  73.          static String BANNER;
  74.          static String MEDIUM_RECTANGLE;
  75.          static String FULL_BANNER;
  76.          static String LEADERBOARD;
  77.          static String SKYSCRAPER;
  78.     }
  79.  
  80.     /** Constants for the various ad positions */
  81.     class AD_POSITION {
  82.          static Number NO_CHANGE;
  83.          static Number TOP_LEFT;
  84.          static Number TOP_CENTER;
  85.          static Number TOP_RIGHT;
  86.          static Number LEFT;
  87.          static Number CENTER;
  88.          static Number RIGHT;
  89.          static Number BOTTOM_LEFT;
  90.          static Number BOTTOM_CENTER;
  91.          static Number BOTTOM_RIGHT;
  92.          static Number POS_XY;
  93.     }
  94.  
  95.     /**
  96.     *   Class used to pass in all ad options to be used by default for all ads
  97.     *   Unfortunately the extension uses generic objects, so this class can't be used :-(
  98.     *   Keeping here commented out for reference sake (and a nudge to hopefully use it in the extension)
  99.     */
  100.     /*class AdMobOptions {
  101.         // The ID of the ad to show
  102.          String public adId;
  103.         // The ID of the specific banner ad to show
  104.          String public bannerId;
  105.         // The ID of the specific interstitial ad to show
  106.          String public interstitialId;
  107.         // Banner type size
  108.          String public adSize;
  109.         // Banner width, if set adSize to 'CUSTOM'
  110.          Number public width;
  111.         // Banner height, if set adSize to 'CUSTOM'
  112.          Number public height;
  113.         // Default position
  114.          Number public position;
  115.         // Default X of banner
  116.         public x:Number
  117.         // Default Y of banner
  118.          Number public y;
  119.         // If set to true, to receive test ads
  120.          Boolean public isTesting;
  121.         // If set to true, no need call showBanner or showInterstitial
  122.          Boolean public autoShow;
  123.         // Extra ad setting options
  124.          dynamic public adExtra;
  125.         // Whether or not to output verbose logs
  126.          Boolean public logVerbose;
  127.         // Whether or not ads can overlap
  128.          Boolean public overlap;
  129.         // Refresh the render of the ad if the orientation changes
  130.          Boolean public orientationRenew;
  131.     }*/
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement