mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Updated TypeScript definitions.
Added features in the API Reference MD.
This commit is contained in:
35
application/application.d.ts
vendored
35
application/application.d.ts
vendored
@@ -50,87 +50,86 @@ declare module "application" {
|
|||||||
/**
|
/**
|
||||||
* The abstraction of an Android-specific application object.
|
* The abstraction of an Android-specific application object.
|
||||||
*/
|
*/
|
||||||
export class AndroidApplication {
|
interface AndroidApplication {
|
||||||
/**
|
/**
|
||||||
* The android.app.Application object instance provided to the init of the module.
|
* The android.app.Application object instance provided to the init of the module.
|
||||||
*/
|
*/
|
||||||
public nativeApp: android.app.Application;
|
nativeApp: android.app.Application;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The application android.content.Context object instance.
|
* The application android.content.Context object instance.
|
||||||
*/
|
*/
|
||||||
public context: android.content.Context;
|
context: android.content.Context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The currently active (loaded) android.app.Activity. This property is automatically updated upon Activity events.
|
* The currently active (loaded) android.app.Activity. This property is automatically updated upon Activity events.
|
||||||
*/
|
*/
|
||||||
public currentActivity: android.app.Activity;
|
currentActivity: android.app.Activity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The main (start) Activity for the application.
|
* The main (start) Activity for the application.
|
||||||
*/
|
*/
|
||||||
public startActivity: android.app.Activity;
|
startActivity: android.app.Activity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the application package.
|
* The name of the application package.
|
||||||
*/
|
*/
|
||||||
public packageName: string;
|
packageName: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called by the JavaScript Bridge when navigation to a new activity is triggered.
|
* This method is called by the JavaScript Bridge when navigation to a new activity is triggered.
|
||||||
* The return value of this method should be com.tns.NativeScriptActivity.extends implementation.
|
* The return value of this method should be com.tns.NativeScriptActivity.extends implementation.
|
||||||
* @param intent The android.content.Intent object for which the activity is required.
|
|
||||||
*/
|
*/
|
||||||
public getActivity: (intent: android.content.Intent) => any;
|
getActivity: (intent: android.content.Intent) => any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityCreated method.
|
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityCreated method.
|
||||||
*/
|
*/
|
||||||
public onActivityCreated: (activity: android.app.Activity, bundle: android.os.Bundle) => void;
|
onActivityCreated: (activity: android.app.Activity, bundle: android.os.Bundle) => void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityDestroyed method.
|
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityDestroyed method.
|
||||||
*/
|
*/
|
||||||
public onActivityDestroyed: (activity: android.app.Activity) => void;
|
onActivityDestroyed: (activity: android.app.Activity) => void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityDestroyed method.
|
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityDestroyed method.
|
||||||
*/
|
*/
|
||||||
public onActivityStarted: (activity: android.app.Activity) => void;
|
onActivityStarted: (activity: android.app.Activity) => void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityPaused method.
|
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityPaused method.
|
||||||
*/
|
*/
|
||||||
public onActivityPaused: (activity: android.app.Activity) => void;
|
onActivityPaused: (activity: android.app.Activity) => void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityResumed method.
|
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityResumed method.
|
||||||
*/
|
*/
|
||||||
public onActivityResumed: (activity: android.app.Activity) => void;
|
onActivityResumed: (activity: android.app.Activity) => void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityStopped method.
|
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onActivityStopped method.
|
||||||
*/
|
*/
|
||||||
public onActivityStopped: (activity: android.app.Activity) => void;
|
onActivityStopped: (activity: android.app.Activity) => void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onSaveActivityState method.
|
* Direct handler of the android.app.Application.ActivityLifecycleCallbacks.onSaveActivityState method.
|
||||||
*/
|
*/
|
||||||
public onSaveActivityState: (activity: android.app.Activity, bundle: android.os.Bundle) => void;
|
onSaveActivityState: (activity: android.app.Activity, bundle: android.os.Bundle) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The abstraction of an iOS-specific application object.
|
* The abstraction of an iOS-specific application object.
|
||||||
*/
|
*/
|
||||||
export class iOSApplication {
|
interface iOSApplication {
|
||||||
/**
|
/**
|
||||||
* The root view controller for the application.
|
* The root view controller for the application.
|
||||||
*/
|
*/
|
||||||
public rootController: UIKit.UIViewController;
|
rootController: UIKit.UIViewController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The android.app.Application object instance provided to the init of the module.
|
* The android.app.Application object instance provided to the init of the module.
|
||||||
*/
|
*/
|
||||||
public nativeApp: UIKit.UIApplication;
|
nativeApp: UIKit.UIApplication;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
16
local-settings/local-settings.d.ts
vendored
16
local-settings/local-settings.d.ts
vendored
@@ -4,53 +4,53 @@ declare module "local-settings" {
|
|||||||
* Checks whether such a key exists.
|
* Checks whether such a key exists.
|
||||||
* @param key The key to check for.
|
* @param key The key to check for.
|
||||||
*/
|
*/
|
||||||
var hasKey: (key: string) => boolean;
|
function hasKey(key: string): boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a value (if existing) for a key as a Boolean Object. A default value can be provided in case there is no existing value.
|
* Gets a value (if existing) for a key as a Boolean Object. A default value can be provided in case there is no existing value.
|
||||||
* @param key The key to check for.
|
* @param key The key to check for.
|
||||||
* @param defaultValue An optional value to be returned in case there is no existing value.
|
* @param defaultValue An optional value to be returned in case there is no existing value.
|
||||||
*/
|
*/
|
||||||
var getBoolean: (key: string, defaultValue?: boolean) => boolean;
|
function getBoolean(key: string, defaultValue?: boolean): boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a value (if existing) for a key as a String Object. A default value can be provided in case there is no existing value.
|
* Gets a value (if existing) for a key as a String Object. A default value can be provided in case there is no existing value.
|
||||||
* @param key The key to check for.
|
* @param key The key to check for.
|
||||||
* @param defaultValue An optional value to be returned in case there is no existing value.
|
* @param defaultValue An optional value to be returned in case there is no existing value.
|
||||||
*/
|
*/
|
||||||
var getString: (key: string, defaultValue?: string) => string;
|
function getString(key: string, defaultValue?: string): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a value (if existing) for a key as a Number Object. A default value can be provided in case there is no existing value.
|
* Gets a value (if existing) for a key as a Number Object. A default value can be provided in case there is no existing value.
|
||||||
* @param key The key to check for.
|
* @param key The key to check for.
|
||||||
* @param defaultValue An optional value to be returned in case there is no existing value.
|
* @param defaultValue An optional value to be returned in case there is no existing value.
|
||||||
*/
|
*/
|
||||||
var getNumber: (key: string, defaultValue?: number) => number;
|
function getNumber(key: string, defaultValue?: number): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a Boolean Object for a key.
|
* Sets a Boolean Object for a key.
|
||||||
* @param key The key.
|
* @param key The key.
|
||||||
* @param value The value.
|
* @param value The value.
|
||||||
*/
|
*/
|
||||||
var setBoolean: (key: string, value: boolean) => void;
|
function setBoolean(key: string, value: boolean): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a String Object for a key.
|
* Sets a String Object for a key.
|
||||||
* @param key The key.
|
* @param key The key.
|
||||||
* @param value The value.
|
* @param value The value.
|
||||||
*/
|
*/
|
||||||
var setString: (key: string, value: string) => void;
|
function setString(key: string, value: string): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a Number Object for a key.
|
* Sets a Number Object for a key.
|
||||||
* @param key The key.
|
* @param key The key.
|
||||||
* @param value The value.
|
* @param value The value.
|
||||||
*/
|
*/
|
||||||
var setNumber: (key: string, value: number) => void;
|
function setNumber(key: string, value: number): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes a value (if existing) for a key.
|
* Removes a value (if existing) for a key.
|
||||||
* @param key The key to check for.
|
* @param key The key to check for.
|
||||||
*/
|
*/
|
||||||
var remove: (key: string) => void;
|
function remove(key: string): void;
|
||||||
}
|
}
|
||||||
2
location/location.d.ts
vendored
2
location/location.d.ts
vendored
@@ -171,5 +171,5 @@ declare module "location" {
|
|||||||
* However if you specify maximumAge and the location received is older it won't be received.
|
* However if you specify maximumAge and the location received is older it won't be received.
|
||||||
* @param options An optional object specifying location update settings.
|
* @param options An optional object specifying location update settings.
|
||||||
*/
|
*/
|
||||||
var getLocation: (options?: Options) => promises.Promise<Location>;
|
function getLocation(options?: Options): promises.Promise<Location>;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user