mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Added some more API reference comments. Renamed some parameters in Console module.
This commit is contained in:
33
Application/application.d.ts
vendored
33
Application/application.d.ts
vendored
@ -2,15 +2,17 @@
|
|||||||
* Defines the available target operating systems.
|
* Defines the available target operating systems.
|
||||||
*/
|
*/
|
||||||
export declare enum TargetOS {
|
export declare enum TargetOS {
|
||||||
|
/**
|
||||||
|
* iOS operating system.
|
||||||
|
*/
|
||||||
iOS,
|
iOS,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Android operating system.
|
||||||
|
*/
|
||||||
Android
|
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.
|
* The abstraction of an Application object, common for each target OS.
|
||||||
*/
|
*/
|
||||||
@ -47,12 +49,16 @@ export declare class Application {
|
|||||||
public onLowMemory: () => any;
|
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;
|
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;
|
public ios: iOSApplication;
|
||||||
}
|
}
|
||||||
@ -67,7 +73,7 @@ export declare class AndroidApplication {
|
|||||||
public nativeApp: android.app.Application;
|
public nativeApp: android.app.Application;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The android.content.Context object instance.
|
* The application android.content.Context object instance.
|
||||||
*/
|
*/
|
||||||
public context: android.content.Context;
|
public context: android.content.Context;
|
||||||
|
|
||||||
@ -132,11 +138,18 @@ export declare class AndroidApplication {
|
|||||||
* The abstraction of an iOS-specific application object.
|
* The abstraction of an iOS-specific application object.
|
||||||
*/
|
*/
|
||||||
export declare class iOSApplication {
|
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.
|
* Entry point for the module. Initializes the Application singleton and hooks application lifecycle events.
|
||||||
*/
|
*/
|
||||||
export declare function init(nativeApp: any);
|
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
12
Console/console.d.ts
vendored
@ -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.
|
* Instance of this class is declared in the global JavaScript context and is accessible by directly calling console.[xxx] methods.
|
||||||
*/
|
*/
|
||||||
export declare class Console {
|
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.
|
* 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.
|
* Reports some information.
|
||||||
*/
|
*/
|
||||||
public info(message: any, ...optionalParams: any[]): void;
|
public info(message: any, ...formatParams: any[]): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reports a warning.
|
* Reports a warning.
|
||||||
*/
|
*/
|
||||||
public warn(message: any, ...optionalParams: any[]): void;
|
public warn(message: any, ...formatParams: any[]): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reports an error.
|
* Reports an error.
|
||||||
*/
|
*/
|
||||||
public error(message: any, ...optionalParams: any[]): void;
|
public error(message: any, ...formatParams: any[]): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verbously logs a message.
|
* 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.
|
* Prints the current stack trace in the console.
|
||||||
|
@ -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) {
|
if (!test) {
|
||||||
Array.prototype.shift.apply(arguments);
|
Array.prototype.shift.apply(arguments);
|
||||||
helperModule.error(this.formatParams.apply(this, 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));
|
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));
|
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));
|
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));
|
helperModule.log(this.formatParams.apply(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user