forked from NativeScript/docs-v7
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7757911
commit 7528241
Showing
386 changed files
with
12,801 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
*.sln merge=union | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "runtimes/android"] | ||
path = runtimes/android | ||
url = [email protected]:NativeScript/android-runtime-docs.git | ||
[submodule "runtimes/ios"] | ||
path = runtimes/ios | ||
url = [email protected]:NativeScript/ios-runtime-docs.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# NativeScript API Reference | ||
|
||
### Modules | ||
- ["application"](application/) | ||
- ["camera"](camera/) | ||
- ["color"](color/) | ||
- ["console"](console/) | ||
- ["data/observable"](data/observable/) | ||
- ["data/observable-array"](data/observable-array/) | ||
- ["data/virtual-array"](data/virtual-array/) | ||
- ["file-system"](file-system/) | ||
- ["file-system/file-system-access"](file-system/file-system-access/) | ||
- ["fps-meter"](fps-meter/) | ||
- ["fps-meter/fps-native"](fps-meter/fps-native/) | ||
- ["http"](http/) | ||
- ["image-source"](image-source/) | ||
- ["local-settings"](local-settings/) | ||
- ["location"](location/) | ||
- ["platform"](platform/) | ||
- ["text"](text/) | ||
- ["text/formatted-string"](text/formatted-string/) | ||
- ["text/span"](text/span/) | ||
- ["timer"](timer/) | ||
- ["trace"](trace/) | ||
- ["ui/activity-indicator"](ui/activity-indicator/) | ||
- ["ui/border"](ui/border/) | ||
- ["ui/button"](ui/button/) | ||
- ["ui/content-view"](ui/content-view/) | ||
- ["ui/core/bindable"](ui/core/bindable/) | ||
- ["ui/core/control-state-change"](ui/core/control-state-change/) | ||
- ["ui/core/dependency-observable"](ui/core/dependency-observable/) | ||
- ["ui/core/proxy"](ui/core/proxy/) | ||
- ["ui/core/view"](ui/core/view/) | ||
- ["ui/core/weak-event-listener"](ui/core/weak-event-listener/) | ||
- ["ui/date-picker"](ui/date-picker/) | ||
- ["ui/dialogs"](ui/dialogs/) | ||
- ["ui/editable-text-base"](ui/editable-text-base/) | ||
- ["ui/enums"](ui/enums/) | ||
- ["ui/frame"](ui/frame/) | ||
- ["ui/gestures"](ui/gestures/) | ||
- ["ui/image"](ui/image/) | ||
- ["ui/image-cache"](ui/image-cache/) | ||
- ["ui/label"](ui/label/) | ||
- ["ui/layouts/absolute-layout"](ui/layouts/absolute-layout/) | ||
- ["ui/layouts/dock-layout"](ui/layouts/dock-layout/) | ||
- ["ui/layouts/grid-layout"](ui/layouts/grid-layout/) | ||
- ["ui/layouts/layout"](ui/layouts/layout/) | ||
- ["ui/layouts/stack-layout"](ui/layouts/stack-layout/) | ||
- ["ui/layouts/wrap-layout"](ui/layouts/wrap-layout/) | ||
- ["ui/list-picker"](ui/list-picker/) | ||
- ["ui/list-view"](ui/list-view/) | ||
- ["ui/page"](ui/page/) | ||
- ["ui/progress"](ui/progress/) | ||
- ["ui/scroll-view"](ui/scroll-view/) | ||
- ["ui/search-bar"](ui/search-bar/) | ||
- ["ui/segmented-bar"](ui/segmented-bar/) | ||
- ["ui/slider"](ui/slider/) | ||
- ["ui/styling"](ui/styling/) | ||
- ["ui/styling/stylers"](ui/styling/stylers/) | ||
- ["ui/styling/visual-state-constants"](ui/styling/visual-state-constants/) | ||
- ["ui/switch"](ui/switch/) | ||
- ["ui/tab-view"](ui/tab-view/) | ||
- ["ui/text-base"](ui/text-base/) | ||
- ["ui/text-field"](ui/text-field/) | ||
- ["ui/text-view"](ui/text-view/) | ||
- ["ui/time-picker"](ui/time-picker/) | ||
- ["ui/web-view"](ui/web-view/) | ||
- ["utils/containers"](utils/containers/) | ||
- ["utils/types"](utils/types/) | ||
- ["utils/utils"](utils/utils/) | ||
- ["xml"](xml/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
nav-title: "Object application.AndroidApplication" | ||
title: "Object application.AndroidApplication" | ||
description: "Object application.AndroidApplication" | ||
--- | ||
## Object: "application".AndroidApplication | ||
The abstraction of an Android-specific application object. | ||
|
||
##### Properties | ||
- **nativeApp** - _Object_. | ||
The [android Application](http://developer.android.com/reference/android/app/Application.html) object instance provided to the init of the module. | ||
- **context** - _Object_. | ||
The application's [android Context](http://developer.android.com/reference/android/content/Context.html) object instance. | ||
- **foregroundActivity** - _Object_. | ||
The currently active (loaded) [android Activity](http://developer.android.com/reference/android/app/Activity.html). This property is automatically updated upon Activity events. | ||
- **currentContext** - _Object_. | ||
The currently active (loaded) Context. This is typically the top-level Activity that is just created. | ||
- **startActivity** - _Object_. | ||
The main (start) Activity for the application. | ||
- **packageName** - _String_. | ||
The name of the application package. | ||
- **onActivityCreated** - _Function_(activity _Object_, bundle _Object_). | ||
Direct handler of the [onActivityCreated method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html). | ||
- **onActivityDestroyed** - _Function_(activity _Object_). | ||
Direct handler of the [onActivityDestroyed method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html). | ||
- **onActivityStarted** - _Function_(activity _Object_). | ||
Direct handler of the [onActivityDestroyed method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html). | ||
- **onActivityPaused** - _Function_(activity _Object_). | ||
Direct handler of the [onActivityPaused method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html). | ||
- **onActivityResumed** - _Function_(activity _Object_). | ||
Direct handler of the [onActivityResumed method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html). | ||
- **onActivityStopped** - _Function_(activity _Object_). | ||
Direct handler of the [onActivityStopped method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html). | ||
- **onSaveActivityState** - _Function_(activity _Object_, bundle _Object_). | ||
Direct handler of the [onActivitySaveInstanceState method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html). | ||
- **onActivityResult** - _Function_(requestCode _Number_, resultCode _Number_, data _Object_). | ||
Direct handler of the onActivityResult method. | ||
|
||
##### Functions | ||
- **getActivity(** intent _Object_ **)** _Object_ | ||
This method is called by the JavaScript Bridge when navigation to a new activity is triggered. | ||
- **intent** - _Object_ | ||
- Native (android) intent used to create the activity. | ||
Returns com.tns.NativeScriptActivity.extend implementation. | ||
- _**return**_ - _Object_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
nav-title: "application How-To" | ||
title: "How-To" | ||
description: "Examples for using application" | ||
--- | ||
# Application | ||
The Application module provides abstraction over the platform-specific Application implementations. | ||
It is the main BCL module and is required for other BCL modules to work properly. | ||
The default bootstrap.js implementation for each platform loads and initializes this module. | ||
``` JavaScript | ||
var app = require("application"); | ||
``` | ||
The pre-required `app` module is used throughout the following code snippets. | ||
### Checking the target platform | ||
Use the following code in case you need to check somewhere in your code the platform you are running against: | ||
``` JavaScript | ||
if (app.android) { | ||
console.log("We are running on Android device!"); | ||
} | ||
else if (app.ios) { | ||
console.log("We are running on iOS device"); | ||
} | ||
``` | ||
### Using the Android-specific implementation | ||
Accessing the Android-specific object instance (will be undefined if running on iOS) | ||
``` JavaScript | ||
var androidApp = app.android; | ||
``` | ||
### Using the Android Application context | ||
``` JavaScript | ||
var context = app.android.context; | ||
// get the Files (Documents) folder (directory) | ||
var dir = context.getFilesDir(); | ||
``` | ||
### Tracking the current Activity | ||
``` JavaScript | ||
if (androidApp.foregroundActivity === androidApp.startActivity) { | ||
console.log("We are currently in the main (start) activity of the application"); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
nav-title: "Object application.NativeScriptError" | ||
title: "Object application.NativeScriptError" | ||
description: "Object application.NativeScriptError" | ||
--- | ||
## Object: "application".NativeScriptError | ||
_Extends:_ _Error_ | ||
An extended JavaScript Error which will have the nativeError property initialized in case the error is caused by executing platform-specific code. | ||
|
||
##### Properties | ||
- **nativeError** - _Object_. | ||
Represents the native error object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
nav-title: "Module application" | ||
title: "Module application" | ||
description: "Module application" | ||
--- | ||
# Module: "application" | ||
|
||
``` JavaScript | ||
// To import the "application" module: | ||
var application = require("application"); | ||
``` | ||
|
||
Object | Description | ||
------|------------ | ||
[NativeScriptError](../application/NativeScriptError.md) | An extended JavaScript Error which will have the nativeError property initialized in case the error is caused by executing platform-specific code. | ||
[AndroidApplication](../application/AndroidApplication.md) | The abstraction of an Android-specific application object. | ||
[iOSApplication](../application/iOSApplication.md) | The abstraction of an iOS-specific application object. | ||
|
||
##### Variables | ||
- **mainModule** - _String_. | ||
The main page path (without the file extension) for the application starting from the application root. | ||
For example if you have page called "main.js" in a folder called "subFolder" and your root folder is "app" you can specify mainModule like this: | ||
var application = require("application"); | ||
application.mainModule = "app/subFolder/main"; | ||
application.start(); | ||
- **cssFile** - _String_. | ||
The application level css file name (starting from the application root). Used to set css across all pages. | ||
Css will be applied for every page and page css will be applied after. | ||
- **cssSelectorsCache** - _Array_ of _Object_. | ||
Cached css selectors created from the content of the css file. | ||
- **android** - [_AndroidApplication_](../application/AndroidApplication.md). | ||
This is the Android-specific application object instance. | ||
Encapsulates methods and properties specific to the Android platform. | ||
Will be undefined when TargetOS is iOS. | ||
- **ios** - [_iOSApplication_](../application/iOSApplication.md). | ||
This is the iOS-specific application object instance. | ||
Encapsulates methods and properties specific to the iOS platform. | ||
Will be undefined when TargetOS is Android. | ||
|
||
##### Functions | ||
- **loadCss()** | ||
Loads css file and parses to a css syntax tree. | ||
- **start()** | ||
Call this method to start the application. Important: All code after this method call will not be executed! | ||
- **onLaunch(** context _Object_ **)** | ||
The main entry point event. This method is expected to use the root frame to navigate to the main application page. | ||
- **context** - _Object_ | ||
- **onUncaughtError(** error [_NativeScriptError_](../application/NativeScriptError.md) **)** | ||
A callback to be used when an uncaught error occurs while the application is running. | ||
The application will be shut down after this method returns. | ||
Loading new UI at this point is erroneous and may lead to unpredictable results. | ||
The method is intended to be used for crash reports and/or application restart. | ||
- **error** - [_NativeScriptError_](../application/NativeScriptError.md) | ||
- **onSuspend()** | ||
This method will be called when the Application is suspended. | ||
- **onResume()** | ||
This method will be called when the Application is resumed after it has been suspended. | ||
- **onExit()** | ||
This method will be called when the Application is about to exit. | ||
- **onLowMemory()** | ||
This method will be called when there is low memory on the target device. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
nav-title: "Object application.iOSApplication" | ||
title: "Object application.iOSApplication" | ||
description: "Object application.iOSApplication" | ||
--- | ||
## Object: "application".iOSApplication | ||
The abstraction of an iOS-specific application object. | ||
|
||
##### Properties | ||
- **rootController** - _UIViewController_. | ||
The root view controller for the application. | ||
- **nativeApp** - _UIApplication_. | ||
The [UIApplication](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html) object instance provided to the init of the module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
nav-title: "camera How-To" | ||
title: "How-To" | ||
description: "Examples for using camera" | ||
--- | ||
# Camera module | ||
Using a camera requires the camera module. | ||
``` JavaScript | ||
var camera = require("camera"); | ||
``` | ||
### Taking a picture. | ||
``` JavaScript | ||
camera.takePicture().then(function (result) { | ||
// result is ImageSource | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
nav-title: "Module camera" | ||
title: "Module camera" | ||
description: "Module camera" | ||
--- | ||
# Module: "camera" | ||
|
||
``` JavaScript | ||
// To import the "camera" module: | ||
var camera = require("camera"); | ||
``` | ||
|
||
##### Functions | ||
- **takePicture()** _Promise_... | ||
Take a photo using the camera. | ||
- _**return**_ - _Promise_ of [_ImageSource_](../image-source/ImageSource.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
nav-title: "Class color.Color" | ||
title: "Class color.Color" | ||
description: "Class color.Color" | ||
--- | ||
## Class: "color".Color | ||
Represents a color object. Stores all color components (alpha (opacity), red, green, blue) in a [0..255] range. | ||
|
||
##### Static Functions | ||
- **equals(** value1 [_Color_](../color/Color.md), value2 [_Color_](../color/Color.md) **)** _Boolean_ | ||
Compares two Color instances. | ||
- **value1** - [_Color_](../color/Color.md) | ||
A Color to compare. | ||
- **value2** - [_Color_](../color/Color.md) | ||
A Color to compare. | ||
- _**return**_ - _Boolean_ | ||
|
||
##### Instance Properties | ||
- **a** - _Number_. | ||
Gets the Alpha component (in the [0, 255] range) of this color. This is a read-only property. | ||
- **r** - _Number_. | ||
Gets the Red component (in the [0, 255] range) of this color. This is a read-only property. | ||
- **g** - _Number_. | ||
Gets the Green component (in the [0, 255] range) of this color. This is a read-only property. | ||
- **b** - _Number_. | ||
Gets the Blue component (in the [0, 255] range) of this color. This is a read-only property. | ||
- **hex** - _String_. | ||
Gets the Hexadecimal string representation of this color. This is a read-only property. | ||
- **argb** - _Number_. | ||
Gets the Argb Number representation of this color where each 8 bits represent a single color component. This is a read-only property. | ||
- **name** - _String_. | ||
Gets the known name of this instance. Defined only if it has been constructed from a known color name - e.g. "red". This is a read-only property. | ||
- **android** - _Number_. | ||
Gets the android-specific integer value representation. Same as the Argb one. This is a read-only property. | ||
- **ios** - _UIColor_. | ||
Gets the iOS-specific UIColor value representation. This is a read-only property. | ||
|
||
##### Instance Functions | ||
- **equals(** value [_Color_](../color/Color.md) **)** _Boolean_ | ||
Specifies whether this Color is equal to the Color parameter. | ||
- **value** - [_Color_](../color/Color.md) | ||
The Color to test. | ||
- _**return**_ - _Boolean_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
nav-title: "color How-To" | ||
title: "How-To" | ||
description: "Examples for using color" | ||
--- | ||
# Color | ||
Using Colors requires the "color" module. | ||
``` JavaScript | ||
var colorModule = require("color"); | ||
var Color = colorModule.Color; | ||
``` | ||
### Creating a Color from a hex value. | ||
``` JavaScript | ||
// Creates the red color | ||
var color = new Color("#FF0000"); | ||
``` | ||
### Creating a Color from a short hex value. | ||
``` JavaScript | ||
// Creates the color #FF8800 | ||
var color = new Color("#F80"); | ||
``` | ||
### Creating a Color from four ARGB values | ||
``` JavaScript | ||
// Creates the color with 100 alpha, 255 red, 100 green, 100 blue | ||
var color = new Color(100, 255, 100, 100); | ||
``` | ||
### Creating a Color from a single ARGB value | ||
``` JavaScript | ||
// Creates the color with 100 alpha, 100 red, 100 green, 100 blue | ||
var argb = (100 << 24) | (100 << 16) | (100 << 8) | 100; | ||
var color = new Color(argb); | ||
``` |
Oops, something went wrong.