npm package: @hanwha-ss1/sharedpreference
Description: SharedPreference
Author: NLPLee
Latest version: 0.0.1

# capacitor-plugin-hanwha-sharedpreference

SharedPreference

## Install

```bash
npm install capacitor-plugin-hanwha-sharedpreference
npx cap sync
```

## Example

```javascript
SharedPreference.configuration({ appgroup: 'group.akde.kd.com', iv: '' });

// Set
await SharedPreference.set({
  key: 'currentUserInfo2',
  value: '저장',
  encrypt: true,
});

// Get
const { results } = await SharedPreference.get({
  key: 'currentUserInfo2',
  default: '11',
  encrypt: true,
});
```

## API

<docgen-index>

* [`configuration(...)`](#configuration)
* [`getAll()`](#getall)
* [`get(...)`](#get)
* [`set(...)`](#set)
* [`delete(...)`](#delete)
* [`deleteAll()`](#deleteall)

</docgen-index>

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

### configuration(...)

```typescript
configuration(options: { appgroup: string; iv: string; }) => Promise<any>
```

SharedPreference를 사용하기 위한 기본값 세팅

| Param         | Type                                           | Description                      |
| ------------- | ---------------------------------------------- | -------------------------------- |
| **`options`** | <code>{ appgroup: string; iv: string; }</code> | - appgroup: 앱그룹아이디, iv: AES IV 값 |

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

**Since:** 1.0.0

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


### getAll()

```typescript
getAll() => Promise<any>
```

모든 SharedPreference를 값 출력

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

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


### get(...)

```typescript
get(options: { key: string; default: string; encrypt?: boolean; }) => Promise<any>
```

Key에 매핑되는 SharedPreference 값 출력

| Param         | Type                                                              | Description                                          |
| ------------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
| **`options`** | <code>{ key: string; default: string; encrypt?: boolean; }</code> | - key: key, default: 기본값, encrypt: 암호화여부(true/false) |

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

**Since:** 1.0.0

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


### set(...)

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

Key에 매핑되는 SharedPreference 값 저장

| Param         | Type                                                            | Description                                        |
| ------------- | --------------------------------------------------------------- | -------------------------------------------------- |
| **`options`** | <code>{ key: string; value: string; encrypt?: boolean; }</code> | - key: key, value: 저장값, encrypt: 암호화여부(true/false) |

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

**Since:** 1.0.0

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


### delete(...)

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

Key에 매핑되는 SharedPreference 값 삭제

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

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

**Since:** 1.0.0

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


### deleteAll()

```typescript
deleteAll() => void
```

모든 SharedPreference 값 삭제

**Since:** 1.0.0

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

</docgen-api>