Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
fix(docs): updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thegnuu committed Mar 1, 2022
1 parent 6165cc9 commit 16a904e
Showing 1 changed file with 62 additions and 9 deletions.
71 changes: 62 additions & 9 deletions API_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ Below is an index of all the methods available.

<docgen-index>

- [`prepare()`](#prepare)
- [`prepare(...)`](#prepare)
- [`hideBackground()`](#hidebackground)
- [`showBackground()`](#showbackground)
- [`startScan(...)`](#startscan)
- [`startScanning(...)`](#startscanning)
- [`pauseScanning()`](#pausescanning)
- [`resumeScanning()`](#resumescanning)
- [`stopScan(...)`](#stopscan)
- [`checkPermission(...)`](#checkpermission)
- [`openAppSettings()`](#openappsettings)
Expand All @@ -16,19 +19,24 @@ Below is an index of all the methods available.
- [`toggleTorch()`](#toggletorch)
- [`getTorchState()`](#gettorchstate)
- [Interfaces](#interfaces)
- [Type Aliases](#type-aliases)
- [Enums](#enums)

</docgen-index>

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

### prepare()
### prepare(...)

```typescript
prepare() => Promise<void>
prepare(options?: ScanOptions | undefined) => Promise<void>
```

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

---

### hideBackground()
Expand Down Expand Up @@ -61,6 +69,37 @@ startScan(options?: ScanOptions | undefined) => Promise<ScanResult>

---

### startScanning(...)

```typescript
startScanning(options?: ScanOptions | undefined, callback?: ((result: ScanResult, err?: any) => void) | undefined) => Promise<CallbackID>
```

| Param | Type |
| -------------- | ----------------------------------------------------------------------------------- |
| **`options`** | <code><a href="#scanoptions">ScanOptions</a></code> |
| **`callback`** | <code>((result: <a href="#scanresult">ScanResult</a>, err?: any) =&gt; void)</code> |

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

---

### pauseScanning()

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

---

### resumeScanning()

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

---

### stopScan(...)

```typescript
Expand Down Expand Up @@ -131,6 +170,13 @@ getTorchState() => Promise<TorchStateResult>

### Interfaces

#### ScanOptions

| Prop | Type | Description | Since |
| --------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **`targetedFormats`** | <code>SupportedFormat[]</code> | This parameter can be used to make the scanner only recognize specific types of barcodes. If `targetedFormats` is _not specified_ or _left empty_, _all types_ of barcodes will be targeted. | 1.2.0 |
| **`cameraDirection`** | <code><a href="#cameradirection">CameraDirection</a></code> | This parameter can be used to set the camera direction. | 2.1.0 |

#### ScanResult

| Prop | Type | Description | Since |
Expand All @@ -139,12 +185,6 @@ getTorchState() => Promise<TorchStateResult>
| **`content`** | <code>string</code> | This holds the content of the barcode if available. | 1.0.0 |
| **`format`** | <code>string</code> | This returns format of scan result. | 2.1.0 |

#### ScanOptions

| Prop | Type | Description | Since |
| --------------------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **`targetedFormats`** | <code>SupportedFormat[]</code> | This parameter can be used to make the scanner only recognize specific types of barcodes. If `targetedFormats` is _not specified_ or _left empty_, _all types_ of barcodes will be targeted. | 1.2.0 |

#### StopScanOptions

| Prop | Type | Description | Default | Since |
Expand Down Expand Up @@ -174,6 +214,12 @@ getTorchState() => Promise<TorchStateResult>
| --------------- | -------------------- | ---------------------------------------------- |
| **`isEnabled`** | <code>boolean</code> | Whether or not the torch is currently enabled. |

### Type Aliases

#### CallbackID

<code>string</code>

### Enums

#### SupportedFormat
Expand All @@ -200,4 +246,11 @@ getTorchState() => Promise<TorchStateResult>
| **`RSS_14`** | <code>'RSS_14'</code> | Android only |
| **`RSS_EXPANDED`** | <code>'RSS_EXPANDED'</code> | Android only |

#### CameraDirection

| Members | Value |
| ----------- | -------------------- |
| **`FRONT`** | <code>'front'</code> |
| **`BACK`** | <code>'back'</code> |

</docgen-api>

0 comments on commit 16a904e

Please sign in to comment.