From d896a5e85fabaccd556564a46c47405061f1faeb Mon Sep 17 00:00:00 2001 From: atanasovg Date: Thu, 8 May 2014 16:32:55 +0300 Subject: [PATCH] Added some more API reference comments. Renamed some parameters in Console module. --- Application/application.d.ts | 35 ++++++++++++++++++++++++----------- Console/console.d.ts | 12 ++++++------ Console/console.ts | 10 +++++----- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/Application/application.d.ts b/Application/application.d.ts index 0b2043884..5747d434a 100644 --- a/Application/application.d.ts +++ b/Application/application.d.ts @@ -2,15 +2,17 @@ * Defines the available target operating systems. */ export declare enum TargetOS { + /** + * iOS operating system. + */ iOS, + + /** + * Android operating system. + */ Android } -/** -* The current singleton instance of the application object. -*/ -export declare var current: Application; - /** * The abstraction of an Application object, common for each target OS. */ @@ -47,12 +49,16 @@ export declare class Application { public onLowMemory: () => any; /** - * This is the Android-specific application object instance. It encapsulates methods and properties specific to the Android platform. + * This is the Android-specific application object instance. + * Encapsulates methods and properties specific to the Android platform. + * Will be undefined when TargetOS is iOS. */ public android: AndroidApplication; /** - * This is the iOS-specific application object instance. It encapsulates methods and properties specific to the iOS platform. + * This is the iOS-specific application object instance. + * Encapsulates methods and properties specific to the iOS platform. + * Will be undefined when TargetOS is Android. */ public ios: iOSApplication; } @@ -67,7 +73,7 @@ export declare class AndroidApplication { public nativeApp: android.app.Application; /** - * The android.content.Context object instance. + * The application android.content.Context object instance. */ public context: android.content.Context; @@ -132,11 +138,18 @@ export declare class AndroidApplication { * The abstraction of an iOS-specific application object. */ export declare class iOSApplication { - // TODO: what methods/properties we can put here - public rootController: any; + /** + * The root view controller for the application. + */ + public rootController: UIKit.UIViewController; } /** * Entry point for the module. Initializes the Application singleton and hooks application lifecycle events. */ -export declare function init(nativeApp: any); \ No newline at end of file +export declare function init(nativeApp: any); + +/** +* The current singleton instance of the application object. +*/ +export declare var current: Application; \ No newline at end of file diff --git a/Console/console.d.ts b/Console/console.d.ts index b4166f907..bcf74972c 100644 --- a/Console/console.d.ts +++ b/Console/console.d.ts @@ -1,5 +1,5 @@ /** -* Encapsulates methods used to report some information to the console. +* Encapsulates methods used to print some information in the console. * Instance of this class is declared in the global JavaScript context and is accessible by directly calling console.[xxx] methods. */ export declare class Console { @@ -16,27 +16,27 @@ export declare class Console { /** * Asserts a boolean condition and prints a message in case the assert fails. */ - public assert(test: boolean, message: string, ...optionalParams: any[]): void; + public assert(test: boolean, message: string, ...formatParams: any[]): void; /** * Reports some information. */ - public info(message: any, ...optionalParams: any[]): void; + public info(message: any, ...formatParams: any[]): void; /** * Reports a warning. */ - public warn(message: any, ...optionalParams: any[]): void; + public warn(message: any, ...formatParams: any[]): void; /** * Reports an error. */ - public error(message: any, ...optionalParams: any[]): void; + public error(message: any, ...formatParams: any[]): void; /** * Verbously logs a message. */ - public log(message: any, ...optionalParams: any[]): void; + public log(message: any, ...formatParams: any[]): void; /** * Prints the current stack trace in the console. diff --git a/Console/console.ts b/Console/console.ts index 2d53a267c..6eef3df08 100644 --- a/Console/console.ts +++ b/Console/console.ts @@ -235,7 +235,7 @@ export class Console { } } - public assert(test: boolean, message: string, ...optionalParams: any[]): void { + public assert(test: boolean, message: string, ...formatParams: any[]): void { if (!test) { Array.prototype.shift.apply(arguments); helperModule.error(this.formatParams.apply(this, arguments)); @@ -265,19 +265,19 @@ export class Console { } } - public info(message: any, ...optionalParams: any[]): void { + public info(message: any, ...formatParams: any[]): void { helperModule.info(this.formatParams.apply(this, arguments)); } - public warn(message: any, ...optionalParams: any[]): void { + public warn(message: any, ...formatParams: any[]): void { helperModule.warn(this.formatParams.apply(this, arguments)); } - public error(message: any, ...optionalParams: any[]): void { + public error(message: any, ...formatParams: any[]): void { helperModule.error(this.formatParams.apply(this, arguments)); } - public log(message: any, ...optionalParams: any[]): void { + public log(message: any, ...formatParams: any[]): void { helperModule.log(this.formatParams.apply(this, arguments)); }