Added some more API reference comments. Renamed some parameters in Console module.

This commit is contained in:
atanasovg
2014-05-08 16:32:55 +03:00
parent 298bf0977a
commit d896a5e85f
3 changed files with 35 additions and 22 deletions

View File

@ -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);
/**
* The current singleton instance of the application object.
*/
export declare var current: Application;

12
Console/console.d.ts vendored
View File

@ -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.

View File

@ -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));
}