npm package: @jwot/capacitor-apkupdater
Description: justwei
Author: wlclass
Latest version: 0.0.2

# @jwot/capacitor-apkupdater

justwei

## Install

```bash
npm install @jwot/capacitor-apkupdater
npx cap sync
```

## API

<docgen-index>

* [`checkPermissions()`](#checkpermissions)
* [`requestPermissions()`](#requestpermissions)
* [`openInstallSetting()`](#openinstallsetting)
* [`install(...)`](#install)
* [`addInstallListener(...)`](#addinstalllistener)
* [`removeAllListeners()`](#removealllisteners)
* [`openSetting(...)`](#opensetting)
* [`openMarket(...)`](#openmarket)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

</docgen-index>

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

### checkPermissions()

```typescript
checkPermissions() => Promise<PermissionStatus>
```

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

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


### requestPermissions()

```typescript
requestPermissions() => Promise<PermissionStatus>
```

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

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


### openInstallSetting()

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

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


### install(...)

```typescript
install(options: { apkPath: string; }) => Promise<InstallStatus>
```

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

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

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


### addInstallListener(...)

```typescript
addInstallListener(listenerFunc: (status: InstallStatus) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
```

| Param              | Type                                                                         |
| ------------------ | ---------------------------------------------------------------------------- |
| **`listenerFunc`** | <code>(status: <a href="#installstatus">InstallStatus</a>) =&gt; void</code> |

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

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


### removeAllListeners()

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

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


### openSetting(...)

```typescript
openSetting(options: { action: string; }) => Promise<void>
```

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

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


### openMarket(...)

```typescript
openMarket(options?: { packageName: string; } | undefined) => Promise<void>
```

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

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


### Interfaces


#### PluginListenerHandle

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


### Type Aliases


#### PermissionStatus

<code>{ canRequestPackageInstalls: <a href="#permissionstate">PermissionState</a>; // 是否有安装权限 }</code>


#### PermissionState

<code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>


#### InstallStatus

<code>{ success: boolean; // 安装是否成功 error?: string; // 错误信息（如果有） }</code>

</docgen-api>