npm package: @nadlowebagentur/capacitor-device-control
Description: Device control helpers for Capacitor (wake, open app, sleep, admin/notifications checks)
Author: @themarchenko
Latest version: 0.0.3

# capacitor-device-control

Android-first device control helpers for Capacitor (wake, open app, sleep, admin checks).

iOS and web implementations are stubs for now.

## Install

```bash
npm install @nadlowebagentur/capacitor-device-control
npx cap sync
```

## API

<docgen-index>

* [`wakeUp(...)`](#wakeup)
* [`openApp(...)`](#openapp)
* [`sleep()`](#sleep)
* [`isAdminActive()`](#isadminactive)
* [`requestAdmin(...)`](#requestadmin)
* [`ensureAdmin(...)`](#ensureadmin)
* [`isScreenOn()`](#isscreenon)
* [`addListener('screenStateChanged', ...)`](#addlistenerscreenstatechanged)
* [`removeAllListeners()`](#removealllisteners)
* [Interfaces](#interfaces)

</docgen-index>

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

### wakeUp(...)

```typescript
wakeUp(options?: WakeOptions | undefined) => Promise<void>
```

| Param         | Type                                                |
| ------------- | --------------------------------------------------- |
| **`options`** | <code><a href="#wakeoptions">WakeOptions</a></code> |

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


### openApp(...)

```typescript
openApp(options?: OpenAppOptions | undefined) => Promise<void>
```

| Param         | Type                                                      |
| ------------- | --------------------------------------------------------- |
| **`options`** | <code><a href="#openappoptions">OpenAppOptions</a></code> |

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


### sleep()

```typescript
sleep() => Promise<SleepResult>
```

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

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


### isAdminActive()

```typescript
isAdminActive() => Promise<AdminStatus>
```

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

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


### requestAdmin(...)

```typescript
requestAdmin(options?: AdminPromptOptions | undefined) => Promise<AdminStatus>
```

| Param         | Type                                                              |
| ------------- | ----------------------------------------------------------------- |
| **`options`** | <code><a href="#adminpromptoptions">AdminPromptOptions</a></code> |

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

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


### ensureAdmin(...)

```typescript
ensureAdmin(options?: AdminPromptOptions | undefined) => Promise<AdminStatus>
```

| Param         | Type                                                              |
| ------------- | ----------------------------------------------------------------- |
| **`options`** | <code><a href="#adminpromptoptions">AdminPromptOptions</a></code> |

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

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


### isScreenOn()

```typescript
isScreenOn() => Promise<ScreenState>
```

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

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


### addListener('screenStateChanged', ...)

```typescript
addListener(eventName: 'screenStateChanged', listener: (state: ScreenState) => void) => Promise<PluginListenerHandle>
```

| Param           | Type                                                                    |
| --------------- | ----------------------------------------------------------------------- |
| **`eventName`** | <code>'screenStateChanged'</code>                                       |
| **`listener`**  | <code>(state: <a href="#screenstate">ScreenState</a>) =&gt; void</code> |

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

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


### removeAllListeners()

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

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


### Interfaces


#### WakeOptions

| Prop               | Type                 |
| ------------------ | -------------------- |
| **`reason`**       | <code>string</code>  |
| **`bringToFront`** | <code>boolean</code> |


#### OpenAppOptions

| Prop         | Type                |
| ------------ | ------------------- |
| **`reason`** | <code>string</code> |


#### SleepResult

| Prop          | Type                 |
| ------------- | -------------------- |
| **`success`** | <code>boolean</code> |
| **`reason`**  | <code>string</code>  |


#### AdminStatus

| Prop         | Type                 |
| ------------ | -------------------- |
| **`active`** | <code>boolean</code> |


#### AdminPromptOptions

| Prop              | Type                 |
| ----------------- | -------------------- |
| **`enabled`**     | <code>boolean</code> |
| **`title`**       | <code>string</code>  |
| **`message`**     | <code>string</code>  |
| **`actionLabel`** | <code>string</code>  |
| **`cancelLabel`** | <code>string</code>  |


#### ScreenState

| Prop             | Type                 |
| ---------------- | -------------------- |
| **`isScreenOn`** | <code>boolean</code> |


#### PluginListenerHandle

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

</docgen-api>