From 352ad8af4020f9105734dd828773acd26b92cfac Mon Sep 17 00:00:00 2001 From: Julien Evano Date: Fri, 6 Nov 2015 06:29:28 +1100 Subject: [PATCH] refactor(Ionic framework): update ionic.Platform.ready callback to accept any return To be more generic, the ionic.Platform.ready callback has been updated to accept any return. --- ionic/ionic-tests.ts | 6 ++++-- ionic/ionic.d.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ionic/ionic-tests.ts b/ionic/ionic-tests.ts index e6e8ab0d5..ee8647b08 100644 --- a/ionic/ionic-tests.ts +++ b/ionic/ionic-tests.ts @@ -371,8 +371,10 @@ class IonicTestController { * ionic.Platform */ private testStaticPlaform(): void { - var ready: void = ionic.Platform.ready(function() { - }); + var callbackWithoutReturn: ()=>void; + var callbackWithReturn: ()=>boolean; + var ready: void = ionic.Platform.ready(callbackWithoutReturn); + ready = ionic.Platform.ready(callbackWithReturn); var setGrade: void = ionic.Platform.setGrade('iOS'); var deviceInformation: string = ionic.Platform.device(); var isWebView: boolean = ionic.Platform.isWebView(); diff --git a/ionic/ionic.d.ts b/ionic/ionic.d.ts index 774102c95..688a253ed 100644 --- a/ionic/ionic.d.ts +++ b/ionic/ionic.d.ts @@ -21,7 +21,7 @@ interface IonicStatic { * Please remember that Cordova features (Camera, FileSystem, etc) still * will not work in a web browser. */ - ready(callback: ()=>void): void; + ready(callback: ()=>any): void; /** * Set the grade of the device: ‘a’, ‘b’, or ‘c’. ‘a’ is the best * (most css features enabled), ‘c’ is the worst. By default, sets the grade