open-index/open-npm huggingface dataset:
npm package: @nativescript-use/nativescript-clipboard
Description: Add a plugin description
Author: Juan de Dios Matínez Vallejo
Latest version: 0.0.3

# @nativescript-use/nativescript-clipboard

```javascript
npm install @nativescript-use/nativescript-clipboard
```

## Usage

```ts
import { Clipboard } from "@nativescript-use/nativescript-clipboard"

const clipboard = new Clipboard();

// Copy text
clipboard.copy("My text");

// Read Clipboard
const currentClipboardValue = clipboard.read();

// Add listener
clipboard.onCopy((textCopied: string) =>{
  console.log(textCopied)
});
// Remove listener
clipboard.offCopy();
```

Type declaration
```ts
export declare class Clipboard {
    abstract onCopy(callback: (text: string) => void): void
    abstract offCopy(): void
    abstract copy(text: string): boolean
    abstract read(): string
}
```

## License

Apache License Version 2.0
npm package: @nativescript-use/nativescript-intersection-observer
Description: Add a plugin description
Author: Juan de Dios Martínez Vallejo
Latest version: 0.0.2

# @nativescript-use/nativescript-intersection-observer

```javascript
npm install @nativescript-use/nativescript-intersection-observer
```

## Usage

```ts
import { IntersectionObserver } from "@nativescript-use/nativescript-intersection-observer"

const intersectionObserver = new IntersectionObserver();

// Track if `targetView` is visible
intersectionObserver.track(targetView, scollView, (isVisible) => {
    console.log("isVisible: " + isVisible);
})

// Stop track
intersectionObserver.stopTrack();

// Check if is visible view
const isVisible = intersectionObserver.isVisible(targetView, scollView);


Type declaration
```ts
export declare class IntersectionObserver {
    track(view: View, parentView: ScrollView, callback: (isVisible: boolean) => void): void;
    topTrack(parentView: ScrollView): void
    isVisible(view: View, parentView?: View): boolean;
}
```

## License

Apache License Version 2.0
npm package: @nativescript-use/nativescript-keyboard
Description: Add a plugin description
Author: Juan de Dios Matínez Vallejo
Latest version: 0.0.1

# @nativescript-use/nativescript-keyboard

```javascript
npm install @nativescript-use/nativescript-keyboard
```

## Usage

```ts
import { Keyboard } from "@nativescript-use/nativescript-keyboard"

const keyboard = new Keyboard();

// Open keyboard with focus
keyboard.keyboard(myView);

// Close keyboard
keyboard.close();

// Add listener
keyboard.onChangeVisibility((isOpen: boolean) =>{
  console.log(isOpen)
});
// Remove listener
keyboard.offChangeVisibility();
```

Type declaration
```ts
export declare class Keyboard {
  onChangeVisibility(callback: (isOpen: boolean) => void): void
  offChangeVisibility(): void
  isOpen(): boolean
  open(view: View): void
  close(): void
}
```

## License

Apache License Version 2.0
npm package: @nativescript-use/nativescript-localstorage
Description: Add a plugin description
Author: Juan de Dios Martínez Vallejo
Latest version: 0.0.1

# @nativescript-use/nativescript-localstorage

```javascript
npm install @nativescript-use/nativescript-localstorage
```

Use localStorage like in the browser. 
This library uses [ApplicationStorage](https://docs.nativescript.org/core/application-settings) from NativeScript behind it.

## Usage
```ts
import localStorage from '@nativescript-use/nativescript-localstorage';

localStorage.setItem('myKey', "myValue");
localStorage.getItem('myKey'); // -> "myValue"
localStorage.has('myKey');
localStorage.removeItem('myKey');
localStorage.length();
localStorage.clear();
```

## Extend LocalStorage class

You can define a storage with a prefix for all entries in ApplicationSettings like:

```ts
// BusinessStorage.ts
import { LocalStorage } from '@nativescript-use/nativescript-localstorage';

export enum BusinessKeys {
  NAME = 'name',
}

class BusinessStorage extends LocalStorage<BusinessKeys> {
  prefix = '_businnes_.';
}
const businessStorage = new BusinessStorage();
export default businessStorage;
```

And use it like.
```ts
import businessStorage, { BusinessKeys } from './BusinessStorage';

businessStorage.setItem(BusinessKeys.NAME, 'MyBusiness');
businessStorage.getItem(BusinessKeys.NAME);

```
This will generate the following entry in ApplicationSettings
```
_businnes_.name = 'MyBusiness'
```
## Type declaration
```ts
declare class LocalStorage<K extends string> {
    protected prefix: string;
    getItem<T>(key: K): T;
    setItem(key: K, data: any): void;
    has(key: K): boolean;
    removeItem(key: K): void;
    length(): number;
    clear(): void;
}
export declare const localStorage: LocalStorage<string>;
```
## License

Apache License Version 2.0
npm package: @nativescript-use/nativescript-media-query
Description: Add a plugin description
Author: Juan de Dios Martínez Vallejo
Latest version: 0.0.5

# DEPRECATED. Nativescript introduced media queries in version 8.8. We've deprecated this package in favor of using @nativescript/core. Official documentation is available [here](https://docs.nativescript.org/guide/styling#media-queries-8-8).


# @nativescript-use/nativescript-media-query

```javascript
npm install @nativescript-use/nativescript-media-query
```

## Usage

```ts
import { matchMedia, MediaQueryList } from "@nativescript-use/nativescript-media-query"

const mql: MediaQueryList = matchMedia("(min-width: 400)");

if (mql.matches) {
  /* The screen is at least 400 dpi wide */
} else {
  /* The screen is less than 400 dpi wide */
}


// Add listener
mql.onchange = (event: MediaQueryListEvent) => {
      // some logic
}); 

const myListener = () => console.log("Change!");
    
mql.addListener(myListener);

// Remove listener
mql.removeListener(myListener);

```

Type declaration
```ts
export interface MediaQueryList {
    readonly matches: boolean;
    readonly media: string;
    onchange: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null;
    addListener(listener: MediaQueryListListener): void;
    removeListener(listener: MediaQueryListListener): void;
}

export type MediaQueryListListener = (mql: MediaQueryList) => void;

export interface MediaQueryListEvent {
    readonly matches: boolean;
    readonly media: string;
}

export declare function matchMedia(mediaQueryString: string): MediaQueryList;

```

## License

Apache License Version 2.0
npm package: @nativescript-use/nativescript-orientation
Description: Add a plugin description
Author: Juan de Dios Matínez Vallejo
Latest version: 0.0.3

# @nativescript-use/nativescript-orientation

```javascript
npm install @nativescript-use/nativescript-orientation
```

## Usage

```ts
import { Orientation } from "@nativescript-use/nativescript-orientation"

const orientation = new Orientation();

// Get current orientation
const currentOrientation = orientation.getOrientation();

// Change orientation. values: 'landscape' | 'landscaperight' | 'landscapeleft' | 'portrait'
orientation.setOrientation('landscape');

// Enable rotation
orientation.enableRotation();

// Disable rotation
orientation.disableRotation();

// Add listener
orientation.onChangedOrientation((newValue: CoreTypes.DeviceOrientationType) =>{
  console.log(newValue)
});
// Remove listener
orientation.offChangedOrientation();
```

Type declaration
```ts
export declare class Orientation {
  getOrientation(): CoreTypes.DeviceOrientationType
  onChangedOrientation(callback: (newValue: CoreTypes.DeviceOrientationType) => void): void
  offChangedOrientation(): void
  enableRotation(): void
  disableRotation(): void
  setOrientation(value: 'landscape' | 'landscaperight' | 'landscapeleft' | 'portrait', animation: false): void
}
```

## License

Apache License Version 2.0