open-index/open-npm huggingface dataset:
npm package: @nativescript/canvas-phaser
Description: Build awesome 2D games with Phaser.js and NativeScript
Author: NativeScript
Latest version: 2.0.11

# @nativescript/canvas-phaser

Tools for using Phaser3 to build native 2D games in NativeScript 👾👾

- [Installation](#installation)
- [Usage](#usage)
- [Functions](#functions)

### Installation

```bash
npm i @nativescript/canvas-phaser
```

### Usage

Import the library into your JavaScript file:

```js
import TNSPhaser from "@nativescript/canvas-phaser";
```

## Functions

### `TNSPhaser.game({ canvas, renderer: Phaser.WEBGL || Phaser.CANVAS, ...extras })`

Given a `canvas` from a
[`Canvas`](https://github.com/nativescript/canvas), return a
[`Phaser.Game`](https://photonstorm.github.io/phaser3-docs/Phaser.Game.html)
that draws into it.

#### Props

| Property    |         Type          | Description                                                                 |         Default Value         |
| ----------- | :-------------------: | --------------------------------------------------------------------------- | :---------------------------: |
| canvas     | TNSCanvas| Required: canvas that the `Phaser.Game` will render to                     |            `null`             |
| renderer     | number?| Optional: choose the renderer type e.g Phaser.CANVAS (1) , Phaser.WEBGL(2)             |            `1`             |
| width       |        number?        | Optional: height of the `Phaser.Game`                                       | `canvas height`  |
| height      |        number?        | Optional: width of the `Phaser.Game`                                        | `canvas width` |
| title       |        string?        | Optional: title of the `Phaser.Game`                                        |     `"tns-phaser-game"`      |

#### Returns

| Property |                              Type                              | Description                                      |
| -------- | :------------------------------------------------------------: | ------------------------------------------------ |
| game     | [`Phaser.Game`](https://photonstorm.github.io/phaser3-docs/Phaser.Game.html) | The Phaser3 game used for rendering game logic |

## Example

```js
const game = TNSPhaser.game({ canvas });
```

## What does it do?

Under the hood, TNSPhaser is maintaining global instances of a few libraries.

- [Phaser3](https://github.com/photonstorm/phaser)

```js
window.Phaser = require("phaser");
```

Finally when a new instance of `TNSPhaser.Game` is created, we set the `document.readyState` to `'complete'`

```js
global.document.readyState = "complete";
```

## License

Apache License Version 2.0, January 2004
npm package: @nativescript/canvas-pixi
Description: Plugin for using pixi.js in NativeScript
Author: NativeScript
Latest version: 2.0.11

# @nativescript/canvas-pixi

## Installation

```bash
npm i three @nativescript/canvas-pixi
```

## Usage

```xml
<GridLayout width="100%" height="100%">
         <canvas:Canvas width="100%" height="100%" id="canvas" ready="onReady"/>
</GridLayout>
```

```typescript
import * as PIXI from "pixi.js";
import { TNSPIXIApplication } from "@nativescript/canvas-pixi";
// Create the Application by passing the canvas view object to it
 function onReady(args) {
   const canvas = args.object;
   const app = new TNSPIXIApplication({
           canvas,
           backgroundColor: 0x1099bb,
       });
       app.loader.add("bg_grass", "~/assets/images/bg_grass.jpg").load(build);
   
       function build() {
           // Create a new texture
           const texture = app.loader.resources.bg_grass.texture;
   
           // Create the simple plane
           const verticesX = 10;
           const verticesY = 10;
           const plane = new PIXI.SimplePlane(texture, verticesX, verticesY);
   
           plane.x = 100;
           plane.y = 100;
   
           app.stage.addChild(plane);
   
           // Get the buffer for vertice positions.
           const buffer = plane.geometry.getBuffer("aVertexPosition") as any;
   
           // Listen for animate update
           app.ticker.add((delta) => {
               // Randomize the vertice positions a bit to create movement.
               for (let i = 0; i < buffer.data.length; i++) {
                   buffer.data[i] += Math.random() - 0.5;
               }
               buffer.update();
           });
       }
}
```

## License

Apache License Version 2.0, January 2004
npm package: @nativescript/canvas-polyfill
Description: Polyfill for making NativeScript compatible with web libs like pixi.js, three.js, phaser.js, babylon.js, etc....
Author: NativeScript
Latest version: 2.0.11

# @nativescript/canvas-polyfill

Browser polyfill for NativeScript

### Installation

```bash
npm i @nativescript/canvas-polyfill
```

### Usage

Import the library into your JavaScript file:

```js
import '@nativescript/canvas-polyfill';
```

## Implements

## DOM

DOM is provided with very low support, these are used for libs like pixi.js that validate type.

```js
class Node
class Element
class Document
class HTMLImageElement
class Image
class ImageBitmap
class HTMLVideoElement
class Video
class HTMLCanvasElement
class Canvas
```

### Image, HTMLImageElement, ImageBitmap

Image has support for loading callbacks, however the loaded uri must be passed to the src already.

```js
const image = new Image();
image.src = '';
image.onload = () => {
  const { src, width, height } = image;
};
image.addEventListener('loading', () => {});
image.addEventListener('error', () => {});
```

### Document

```js
const element = document.createElement('div');
const fakeContext = element.getContext('');
```

### Element

#### All sizes return the window size:

```js
element.clientWidth;
element.clientHeight;
element.innerWidth;
element.innerHeight;
element.offsetWidth;
element.offsetHeight;
```

#### Empty attributes that prevent libraries from crashing

```js
element.tagName;
element.addEventListener;
element.removeEventListener;
element.setAttributeNS;
element.createElementNS;
```

### Node

```js
node.ownerDocument;
node.className;
node.appendChild;
node.insertBefore;
node.removeChild;
node.setAttributeNS;
node.getBoundingClientRect;
```

# Debug flags

For debugging base64 image transformations toggle:

```js
global.__debug_browser_polyfill_image = true;
```

By default `global.__debug_browser_polyfill_image` is false.


## License

Apache License Version 2.0, January 2004
npm package: @nativescript/canvas-three
Description: Utilities for using THREE.js on NativeScript
Author: NativeScript
Latest version: 2.0.12

# @nativescript/canvas-three

## Installation

```bash
npm i three @nativescript/canvas-three
```

## Usage

```js
import * as THREE from '@nativescript/canvas-three';
```

## Creating a Renderer

#### Using WebGPU

Add the following to the webpackconfig.js

```js
const webpack = require('@nativescript/webpack');
const { resolve } = require('path');

module.exports = (env) => {
	....
  /// the path depends on the location of node_modules in this example it's in the root of the plugin repo in a simple project it would be './node_modules/three/build.three.webgpu.js' and not '../../node_modules/three/build.three.webgpu.js'
	webpack.chainWebpack((config) => {
    config.resolve.alias.set('three', resolve(__dirname, '..', '..', 'node_modules', 'three', 'build', 'three.webgpu.js'));
	});
```

```ts
const renderer = new THREE.WebGPURenderer({ canvas, antialias: false });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(canvas.clientWidth, canvas.clientHeight, false);
await renderer.init();
// grab the webgpu context as it's needed to present/render to the screen this is currently needed for now until it's removed in the future
const context = canvas.getContext('webgpu');
/// at the end of your render loop add the following
// context.presentSurface();
// e.g

function render() {
	renderer.render(scene, camera);
	context.presentSurface();
}
```

####

Given a `gl (context)` from a
[`Canvas`](https://github.com/nativescript/canvas), return a
[`THREE.WebGLRenderer`](https://threejs.org/docs/#api/renderers/WebGLRenderer)
that draws into it.

```ts
import * as THREE from 'three';

var camera, scene, renderer;
var geometry, material, mesh;

canvas; // Canvas instance
init();
animate();

function init() {
	camera = new THREE.PerspectiveCamera(70, canvas.clientWidth / canvas.clientHeight, 0.01, 10);
	camera.position.z = 1;

	scene = new THREE.Scene();

	geometry = new THREE.BoxGeometry(0.2, 0.2, 0.2);
	material = new THREE.MeshNormalMaterial();

	mesh = new THREE.Mesh(geometry, material);
	scene.add(mesh);

	const renderer = new THREE.WebGLRenderer({ canvas, antialias: false });
	renderer.setPixelRatio(window.devicePixelRatio);
	renderer.setSize(canvas.clientWidth, canvas.clientHeight, false);
}

function animate() {
	requestAnimationFrame(animate);

	mesh.rotation.x += 0.01;
	mesh.rotation.y += 0.02;

	renderer.render(scene, camera);
}
```

## License

Apache License Version 2.0, January 2004
npm package: @nativescript/capacitor
Description: NativeScript for Capacitor
Author: NativeScript TSC
Latest version: 5.0.2

# @nativescript/capacitor

NativeScript for Capacitor

## Install

```bash
yarn add @nativescript/capacitor
yarn build:mobile
npx cap sync
```

## Docs

See https://capacitor.nativescript.org/

Contribute to docs [here](https://github.com/NativeScript/capacitor-docs)
npm package: @nativescript/core-widgets
Description: Native widgets used in @nativescript/core.
Author: NativeScript team
Latest version: 7.0.0-rc.0

# NativeScript Core Modules Widgets
[![Build Status](https://travis-ci.org/NativeScript/NativeScript.svg?branch=master)](https://travis-ci.org/NativeScript/NativeScript)

This library represents native code (Java and Objective-C) used by the NativeScript [`core modules`](https://github.com/NativeScript/NativeScript/tree/master/tns-core-modules-widgets).

[NativeScript](https://www.nativescript.org/) is a framework which enables developers to write truly native mobile applications for Android and iOS using JavaScript and CSS.

<!-- TOC depthFrom:2 -->

- [Contribute](#contribute)
- [Get Help](#get-help)

<!-- /TOC -->

## Contribute
We love PRs! Check out the [contributing guidelines](CONTRIBUTING.md) and [development workflow for local setup](DevelopmentWorkflow.md). If you want to contribute, but you are not sure where to start - look for issues labeled [`help wanted`](https://github.com/NativeScript/tns-core-modules-widgets/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).

## Get Help
Please, use [github issues](https://github.com/NativeScript/tns-core-modules-widgets/issues) strictly for [reporting bugs](CONTRIBUTING.md#reporting-bugs) or [requesting features](CONTRIBUTING.md#requesting-new-features). For general questions and support, check out the [NativeScript community forum](https://discourse.nativescript.org/) or ask our experts in [NativeScript community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation).
npm package: @nativescript/debug-ios
Description: NativeScript iOS Debugging tools.
Author: NativeScript
Latest version: 2.0.0

# @nativescript/debug-ios

Advanced iOS debugging made possible via [DebugSwift](https://github.com/DebugSwift/DebugSwift).

```cli
npm install @nativescript/debug-ios -D
```

## Usage

```typescript
import { NativeScriptDebugIOS } from '@nativescript/debug-ios';

NativeScriptDebugIOS.show();
```

## API

### `NativeScriptDebugIOS.show()`

Shows the DebugSwift debugging UI.

### `NativeScriptDebugIOS.toggle()`

Toggles the visibility of the DebugSwift debugging UI.

## License

Apache License Version 2.0
npm package: @nativescript/eslint-plugin
Description: A set of ESLint rules for NativeScript projects.
Author: NativeScript Team
Latest version: 0.0.4

# NativeScript ESLint Plugin

ESLint rules for NativeScript projects.

## Installation and setup

1. Install

```
npm i -D @nativescript/eslint-plugin @typescript-eslint/parser eslint
```

2. Add an `.eslintrc.json` config file with the following content.

**.eslintrc.json**

```json
{
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "sourceType": "module",
    "ecmaVersion": 2015
  },
  "plugins": ["@nativescript"],
  "extends": [
    "plugin:@nativescript/recommended"
  ]
}
```

3. Lint the project.

```
npx eslint --ext=ts src/
```

**Notice that you need to provide the path to your source code. In the example above, we use `src/`. Change that to match your project setup.**

4. Fix all auto-fixable problems.

```
npx eslint --ext=ts --fix src/
```

5. [Optional] Set up VSCode to use `eslint`.

-   Install the `dbaeumer.vscode-eslint` extension.
-   Add the following to your `settings.json` file:

```json
"eslint.validate": [ "typescript", "javascript" ],
```
npm package: @nativescript/firebase-app-check-debug
Description: NativeScript Firebase - App Check
Author: NativeScript
Latest version: 5.0.2

# @nativescript/firebase-app-check-debug

```cli
npm install @nativescript/firebase-app-check-debug
```

> **Warning**: The debug provider allows access to your Firebase resources from unverified devices. Don't use the debug provider in production builds of your app, and don't share your debug builds with untrusted parties.



> **Note**: (iOS) App Check requires you set the minimum iOS Deployment version in ios/Podfile to 11.0 or greater.


### What does it do

App Check works alongside other Firebase services to help protect your backend resources from abuse, such as billing fraud or phishing. With App Check, devices running your app will use an app or device attestation provider that attests to one or both of the following:

Requests originate from your authentic app
Requests originate from an authentic, untampered device
This attestation is attached to every request your app makes to your Firebase backend resources.

[![image](https://img.youtube.com/vi/Fjj4fmr2t04/hqdefault.jpg)](https://www.youtube.com/watch?v=Fjj4fmr2t04)

This App Check module has built-in support for using the following services as attestation providers:

DeviceCheck on iOS
SafetyNet on Android
App Check currently works with the following Firebase products:

Realtime Database
Cloud Storage
Cloud Functions (callable functions)
The [official Firebase App Check documentation](https://firebase.google.com/docs/app-check) has more information, including about the iOS AppAttest provider, and testing/ CI integration, it is worth a read.

## Usage

### Activate



```ts
import { firebase } from '@nativescript/firebase-core';
import { AppCheck } from '@nativescript/firebase-app-check-debug';

AppCheck.setProviderFactory(); // call before the fb app is initialized 
firebase.initializeApp()
.then(app =>{
    firebase().appCheck().activate(true);
})


```

 The only configuration possible is the token auto refresh. When you call activate, the provider stays the same but the token auto refresh setting will be changed based on the argument provided.

You must call activate prior to calling any firebase back-end services for App Check to function.


### Automatic Data Collection

App Check has an "tokenAutoRefreshEnabled" setting. This may cause App Check to attempt a remote App Check token fetch prior to user consent. In certain scenarios, like those that exist in GDPR-compliant apps running for the first time, this may be unwanted.

If unset, the "tokenAutoRefreshEnabled" setting will defer to the app's "automatic data collection" setting, which may be set in the Info.plist or AndroidManifest.xml


### Using App Check tokens for non-firebase services

The [official documentation](https://firebase.google.com/docs/app-check/web/custom-resource) shows how to use getToken to access the current App Check token and then verify it in external services.

## License

Apache License Version 2.0
npm package: @nativescript/firebase-installations
Description: NativeScript Firebase - Installations
Author: NativeScript
Latest version: 5.0.2

# @nativescript/firebase-installations

```cli
npm install @nativescript/firebase-installations
```

## What does it do

The Firebase installations service:

- provides a unique identifier for a Firebase installation
- provides an auth token for a Firebase installation
- provides an API to perform GDPR-compliant deletion of a Firebase installation.
Each configured FirebaseApp has a corresponding single instance of Installations. An instance of the class provides access to the installation info for the FirebaseApp as well as the ability to delete it. A Firebase Installation is unique by FirebaseApp.name and FirebaseApp.options.googleAppID


## Usage



## License

Apache License Version 2.0
npm package: @nativescript/google-maps-utils
Description: Google Maps Utilities for NativeScript
Author: Dylan Llewellyn
Latest version: 1.0.2

# @nativescript/google-maps-utils

```javascript
ns plugin add @nativescript/google-maps-utils
```
*Requires google maps plugin [@nativescript/google-maps](packages/google-maps/README.md)* 

## Installation
Install the mixins to the GoogleMaps object
```javascript
import { installMixins } from '@nativescript/google-maps-utils';
installMixins();
```

## Usage
You can access the google maps utilities from the GoogleMaps object after the mixins have been installed.
```javascript
onMapReady(args: MapReadyEvent) {
	const map = args.map;
}
```

---

## HeatMaps
```javascript
import { HeatmapTileProvider, HeatmapOptions } from '@nativescript/google-maps-utils';
import { GoogleMap, Coordinate } from '@nativescript/google-maps';

addHeatmapOverlay(map: GoogleMap, heatmapOptions: HeatmapOptions) {
	// Create a new heat map tile provider
	const heatmapProvider = new HeatmapTileProvider(heatmapOptions);
	// Pass tile provider to Google Maps 
	const heatmapOverlay = map.addTileOverlay({
		tileProvider: heatmapProvider,
	});
}
```

### HeatmapOptions

| Property | Type 
|:---------|:-----
|	`coordinates` | `Coordinate[]`;
|	`opacity` | `number`;
|	`radius` | `number`;
|	`maxIntensity` | `number`;
|	`gradient` | ` IGradient[]`;

---

## Clustering
```javascript
import { ClusterManager } from '@nativescript/google-maps-utils';
import { GoogleMap, MarkerOptions } from '@nativescript/google-maps';

addClusteredMarkers(map: GoogleMap, markers: MarkerOptions[]) {
	const clusterManager: ClusterManager = map.clusterManager(markers);
}
```

---

## Experimental Features
Features that are not yet fully implemented or likely to change.
### GeoJson Layers

Currently only supports GeoJson Objects.

```javascript
import { GeoJsonLayer, IGeometryStyle } from '@nativescript/google-maps-utils';

onMapReady(args: MapReadyEvent) {
	const style: Partial<IGeometryStyle> = { 
		fillColor: new Color('blue'),
		strokeColor: new Color('red'),
		width: 4,
	}
	
	map.addGeoJson({
		geoJson: geoJson,
		style: style,
	});
}
```

```javascript
import { GeoJsonLayer } from '@nativescript/google-maps-utils';

removeGeoJsonLayer(map: GoogleMap, layer: GeoJsonLayer) {
	map.removeGeoJson(layer);
}
```


## License

Apache License Version 2.0
npm package: @nativescript/ios-security
Description: IOSSecuritySuite for NativeScript
Author: NativeScript
Latest version: 1.0.0

# @nativescript/ios-security

🔒 [IOSSecuritySuite](https://github.com/securing/IOSSecuritySuite) for NativeScript.

> 🌏 iOS Security Suite is an advanced and easy-to-use platform security & anti-tampering library. If you are developing for iOS and you want to protect your app according to the OWASP [MASVS](https://github.com/OWASP/owasp-masvs) standard, chapter v8, then this library could save you a lot of time. 🚀
> What ISS detects:
> * Jailbreak (even the iOS 11+ with brand new indicators! 🔥)
> * Attached debugger 👨🏻‍🚀
> * If an app was run in an emulator 👽
> * Common reverse engineering tools running on the device 🔭

```javascript
ns plugin add @nativescript/ios-security
```

## Usage

*TypeScript*
``` 
import { IOSSecurity } from "@nativescript/ios-security";
```

*Javascript*
``` 
var IOSSecurity = require("@nativescript/ios-security").IOSSecurity;
```

### Update Info.plist

After adding ios-security to your project, you will also need to update your Info.plist. There is a check in jailbreak detection module that uses ```canOpenURL(_:)``` method and [requires](https://developer.apple.com/documentation/uikit/uiapplication/1622952-canopenurl) specifying URLs that will be queried.

```xml
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>cydia</string>
    <string>undecimus</string>
    <string>sileo</string>
    <string>zbra</string>
    <string>filza</string>
    <string>activator</string>
</array>
```

### Jailbreak detector module

* **The simplest method** returns true/false if you just want to know if the device is jailbroken or jailed

*Javascript*
```
if (IOSSecurity.amIJailbroken()) {
	console.log("This device is jailbroken");
} else {
	console.log("This device is not jailbroken");
}
```

### Debugger detector module
```
const amIDebugged = IOSSecurity.amIDebugged();
```

### Deny debugger at all
```
IOSSecurity.denyDebugger();
```

### Emulator detector module
```
const runInEmulator = IOSSecurity.amIRunInEmulator();
```

### Reverse engineering tools detector module
```
const amIReverseEngineered = IOSSecurity.amIReverseEngineered();
```

### System proxy detector module
```
const amIProxied = IOSSecurity.amIProxied();
```

## License

Apache License Version 2.0
npm package: @nativescript/mlkit-digital-ink-recognition
Description: NativeScript MLKit Digital Ink Recognition module
Author: NativeScript
Latest version: 3.0.4

# @nativescript/mlkit-digital-ink-recognition

```javascript
npm install @nativescript/mlkit-digital-ink-recognition
```

## Usage

See [@nativescript/mlkit-core](../plugins/mlkit-core) Usage
## License

Apache License Version 2.0
npm package: @nativescript/mlkit-face-detection
Description: NativeScript MLKit Face Detection module
Author: NativeScript
Latest version: 3.0.4

# @nativescript/mlkit-face-detection

A plugin that is used with [@nativescript/mlkit-core](../plugins/mlkit-core/) to enable face detection and provide the [FaceResult](#faceresult) type for the data of the face detection event.

## Contents
* [Installation](#installation)
* [Use @nativescript/mlkit-face-detection](#use-nativescriptmlkit-face-detection)
* [API](#api)
    * [FaceResult](#faceresult)
* [License](#license)

## Installation
Install `@nativescript/mlkit-face-detection` by running the following command:

```cli
npm install @nativescript/mlkit-face-detection
```

## Use @nativescript/mlkit-face-detection

For more details, read [use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [@nativescript/mlkit-core](../mlkit-core#face-detection)

## API

### FaceResult

The Face Detection event data type.

```ts
interface FaceResult {
    smilingProbability: number;
    leftEyeOpenProbability: number;
    rightEyeOpenProbability: number;
    trackingId: number;
    bounds: Bounds;
    headEulerAngleZ: number;
    headEulerAngleY: number;
    headEulerAngleX: number;
}
```

#### Bounds
```ts
interface Bounds {
    origin: Origin;
    size: Size;
}
```
#### Origin
```ts
interface Origin {
    x: number;
    y: number;
}
```
#### Size
```ts
interface Size {
    width: number;
    height: number;
}
```

## License

Apache License Version 2.0
npm package: @nativescript/mlkit-image-labeling
Description: NativeScript MLKit Image Labeling module
Author: NativeScript
Latest version: 3.0.4

# @nativescript/mlkit-image-labeling

A plugin that is used with [@nativescript/mlkit-core](../plugins/mlkit-core/) to enable Image Labeling and provide the [ImageLabelingResult](#imagelabelingresult) type for the image labeling event data.

## Contents
* [Installation](#installation)
* [Use @nativescript/mlkit-image-labeling](#use-nativescriptmlkit-image-labeling)
* [API](#api)
    * [ImageLabelingResult](#imagelabelingresult)
* [License](#license)

## Installation

```cli
npm install @nativescript/mlkit-image-labeling
```

## Use @nativescript/mlkit-image-labeling

For an example, read [Use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [Image Labeling](../mlkit-core#image-labeling)

## API

### ImageLabelingResult

The Image Labeling event data type.

```ts
interface ImageLabelingResult {
    text?: string
    confidence?: number;
    index?: number;
}
```
## License

Apache License Version 2.0
npm package: @nativescript/mlkit-object-detection
Description: NativeScript MLKit Object Detection module
Author: NativeScript
Latest version: 3.0.4

# @nativescript/mlkit-object-detection

A plugin that is used with [@nativescript/mlkit-core](../plugins/mlkit-core/) to enable Object Detection and provide the [ObjectResult](#objectresult) type for the object detection event data.

## Contents
* [Installation](#installation)
* [Use @nativescript/mlkit-object-detection](#use-nativescriptmlkit-object-detection)
* [ObjectResult](#objectresult)
* [API](#api)
    * [ObjectResult]

## Installation

Install `@nativescript/mlkit-object-detection` by running the following command:

```cli
npm install @nativescript/mlkit-object-detection
```

## Use @nativescript/mlkit-object-detection

For an example, read [Use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [Object Detection](../mlkit-core#object-detection).

## API 

### ObjectResult

The type of object detection event data.

```ts
interface ObjectResult {
    trackingId?: number
    bounds: Bounds
    labels: ObjectLabeling[]
}
```
#### ObjectLabeling

```ts
interface ObjectLabeling {
    text?: string
    confidence?: number
    index?: number
}
```
#### Bounds

```ts
interface Bounds {
    origin: Origin;
    size: Size;
}
```
#### Origin

```ts
export interface Origin {
    x: number;
    y: number;
}
```
#### Size

```ts
interface Size {
    width: number;
    height: number;
}
```

## License

Apache License Version 2.0
npm package: @nativescript/mlkit-pose-detection
Description: NativeScript MLKit Pose Detection module
Author: NativeScript
Latest version: 3.0.4

# @nativescript/mlkit-pose-detection

A plugin that is used with [@nativescript/mlkit-core](../mlkit-core/) to enable Pose Detection and provide the [PoseResult](#poseresult) type for the Pose Detection event data.

## Contents
* [Installation](#installation)
* [Use @nativescript/mlkit-pose-detection](#use-nativescriptmlkit-pose-detection)
* [API](#api)
    * [PoseResult](#poseresult)
* [License](#license)

## Installation
Install `@nativescript/mlkit-pose-detection` by running the following command:

```cli
npm install @nativescript/mlkit-pose-detection
```

## Use @nativescript/mlkit-pose-detection

For an example, read [Use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [Pose Detection](../mlkit-core#pose-detection).

## API

### PoseResult
The Pose Detection event data type.

```ts
interface PoseResult {
    landmarks: [PoseLandMark]
}
```
### PoseLandMark
```ts
interface PoseLandMark {
    inFrameLikelihood: number
    position: PoseLandMarkPosition
    type?: PoseType
}
```
### PoseLandMarkPosition
```ts
interface PoseLandMarkPosition {
    x: number
    y: number
    z: number
}
```
### PoseType
```ts
enum PoseType {
    LeftAnkle = "leftAnkle",
    LeftEar = "leftEar",
    LeftElbow = "leftElbow",
    LeftEye = "leftEye",
    LeftEyeInner = "leftEyeInner",
    LeftEyeOuter = "leftEyeOuter",
    LeftHeel = "leftHeel",
    LeftHip = "leftHip",
    LeftIndexFinger = "leftIndex",
    LeftKnee = "leftKnee",
    LeftPinkyFinger = "leftPinky",
    LeftShoulder = "leftShoulder",
    LeftThumb = "leftThumb",
    LeftToe = "leftToe",
    LeftWrist = "leftWrist",
    MouthLeft = "mouthLeft",
    MouthRight = "mouthRight",
    Nose = "nose",
    RightAnkle = "rightAnkle",
    RightEar = "rightEar",
    RightElbow = "rightElbow",
    RightEye = "rightEye",
    RightEyeInner = "rightEyeInner",
    RightEyeOuter = "rightEyeOuter",
    RightHeel = "rightHeel",
    RightHip = "rightHip",
    RightIndexFinger = "rightIndex",
    RightKnee = "rightKnee",
    RightPinkyFinger = "rightPinky",
    RightShoulder = "rightShoulder",
    RightThumb = "rightThumb",
    RightToe = "rightToe",
    RightWrist = "rightWrist",
    Unknown = "unknown"
}
```

## License

Apache License Version 2.0
npm package: @nativescript/mlkit-selfie-segmentation
Description: NativeScript MLKit Self Segmentation module
Author: NativeScript
Latest version: 3.0.4

# @nativescript/mlkit-selfie-segmentation

```javascript
npm install @nativescript/mlkit-selfie-segmentation
```

## Usage

See [@nativescript/mlkit-core](../plugins/mlkit-core) Usage
## License

Apache License Version 2.0
npm package: @nativescript/mlkit-text-recognition
Description: NativeScript MLKit Text Recognition module
Author: NativeScript
Latest version: 3.0.4

# @nativescript/mlkit-text-recognition

A plugin used with [@nativescript/mlkit-core](../plugins/mlkit-core) to enable Text Recognition in your app and provide [TextResult](#textresult) type for the text recognition event data.

## Contents
* [Installation](#installation)
* [Use @nativescript/mlkit-text-recognition](#use-nativescriptmlkit-text-recognition)
* [API](#api)
    * [TextResult](#textresult)
* [License](#license)

## Installation

```cli
npm install @nativescript/mlkit-text-recognition
```

## Use @nativescript/mlkit-text-recognition

For an example, read [Use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [Text Recognition](../mlkit-core#text-recognition).

## API

### TextResult

The Text Recognition event data type.

```ts
interface TextResult {
    text?: string
    bounds: Bounds
    lines: TextLine[]
    points: Point[]
}
```
---
#### Point

```ts
interface Point {
    x: number;
    y: number;
}
```
---
#### Bounds
```ts
interface Bounds {
    origin: Origin;
    size: Size;
}
```
#### Origin
```ts
interface Origin {
    x: number;
    y: number;
}
```

#### Size
```ts
interface Size {
    width: number;
    height: number;
}
```
---
#### TextLine
```ts
interface TextLine {
    text?: string
    bounds: Bounds
    elements: TextElement[]
    points?: Point[]
}
```
#### TextElement
```ts
interface TextElement {
    text?: string
    bounds: Bounds
}
```
---
## License

Apache License Version 2.0
npm package: @nativescript/morph-modal-kit
Description: MorphModalKit for NativeScript on iOS
Author: NativeScript
Latest version: 0.0.2

# @nativescript/morph-modal-kit

*Note: Early release - have fun!*

Providing the brilliant [MorphModalKit](https://github.com/jsmmth/MorphModalKit) by [Joseph Smith](https://github.com/jsmmth) for NativeScript.

```javascript
npm install @nativescript/morph-modal-kit
```

## Usage

```ts
import { MorphModalKit } from '@nativescript/morph-modal-kit';

/**
 * view: Dynamically created view to show in modal
 * ref: the view reference which calls this api
 * options: morph option following MorphOptions
 */
MorphModalKit.open(view, ref, options);
```

Given a view with a tap binding which may open a morphing modal:

```html
<StackLayout>
  <button text="Open Morph Modal" tap="openModalMenu" />

  <StackLayout id="placeholder"> </StackLayout>
</StackLayout>
```

Using plain core, the following would dynamically create the provided view to open in the morphing modal:

```ts
export function openModalMenu(args: EventData) {
    const btn = args.object as Button;
    const placeholder = btn.page.getViewById("placeholder") as StackLayout;
    const lazy: View = Builder.load({
        path: "~/components",
        name: "morph-modal-content"
    });
    placeholder.addChild(lazy);
    MorphModalKit.open(lazy, btn);
}
```

More flavor examples will be posted in subsequent releases.

### MorphOptions

```ts
interface MorphOptions {
  animation: MorphModalAnimationSettings;

  cardShadowColor: UIColor;

  cardShadowOffset: CGSize;

  cardShadowOpacity: number;

  cardShadowRadius: number;

  centerIPadWidthMultiplier: number;

  centerOnIpad: boolean;

  cornerMask: 1 | 2 | 4 | 8;

  cornerRadius: number;

  dimBackgroundColor: UIColor;

  dimOpacityMultiplier: number;

  handleColor: UIColor;

  horizontalInset: number;

  keyboardSpacing: number;

  maxVisibleStack: number;

  modalBackgroundColor: UIColor;

  morphAnimation: MorphModalAnimationSettings;

  overlayColor: UIColor;

  overlayOpacity: number;

  removesSelfWhenCleared: boolean;

  showsHandle: boolean;

  stackVerticalSpacing: number;

  usesSnapshots: boolean;

  usesSnapshotsForMorph: boolean;
}

interface MorphAnimationSettings {
  damping: number;

  duration: number;

  velocity: number;
}
```

## License

Apache License Version 2.0