npm package: @serebano/capacitor-icloud-preferences
Description: Capacitor plugin for iCloud key-value sync
Author: serebano
Latest version: 0.1.1

# @serebano/capacitor-icloud-preferences

Capacitor plugin for iCloud key-value sync

## Install

```bash
npm install @serebano/capacitor-icloud-preferences
npx cap sync
```

## API

<docgen-index>

* [`set(...)`](#set)
* [`get(...)`](#get)
* [`remove(...)`](#remove)
* [`setContainer(...)`](#setcontainer)
* [`configureSyncKeys(...)`](#configuresynckeys)
* [`addListener('icloudSyncComplete', ...)`](#addlistenericloudsynccomplete-)
* [`removeAllListeners()`](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### set(...)

```typescript
set(options: { key: string; value: any; }) => Promise<void>
```

| Param         | Type                                      |
| ------------- | ----------------------------------------- |
| **`options`** | <code>{ key: string; value: any; }</code> |

--------------------


### get(...)

```typescript
get(options: { key: string; }) => Promise<{ value: any; }>
```

| Param         | Type                          |
| ------------- | ----------------------------- |
| **`options`** | <code>{ key: string; }</code> |

**Returns:** <code>Promise&lt;{ value: any; }&gt;</code>

--------------------


### remove(...)

```typescript
remove(options: { key: string; }) => Promise<void>
```

| Param         | Type                          |
| ------------- | ----------------------------- |
| **`options`** | <code>{ key: string; }</code> |

--------------------


### setContainer(...)

```typescript
setContainer(options: { identifier: string; }) => Promise<void>
```

| Param         | Type                                 |
| ------------- | ------------------------------------ |
| **`options`** | <code>{ identifier: string; }</code> |

--------------------


### configureSyncKeys(...)

```typescript
configureSyncKeys(options: { keys: string[]; }) => Promise<void>
```

| Param         | Type                             |
| ------------- | -------------------------------- |
| **`options`** | <code>{ keys: string[]; }</code> |

--------------------


### addListener('icloudSyncComplete', ...)

```typescript
addListener(eventName: 'icloudSyncComplete', listenerFunc: (data: Record<string, any>) => void) => Promise<PluginListenerHandle>
```

| Param              | Type                                                                            |
| ------------------ | ------------------------------------------------------------------------------- |
| **`eventName`**    | <code>'icloudSyncComplete'</code>                                               |
| **`listenerFunc`** | <code>(data: <a href="#record">Record</a>&lt;string, any&gt;) =&gt; void</code> |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

--------------------


### removeAllListeners()

```typescript
removeAllListeners() => Promise<void>
```

--------------------


### Interfaces


#### PluginListenerHandle

| Prop         | Type                                      |
| ------------ | ----------------------------------------- |
| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |


### Type Aliases


#### Record

Construct a type with a set of properties K of type T

<code>{ [P in K]: T; }</code>

</docgen-api>