Skip to content

Commit

Permalink
test: add plugin configs output test
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Mar 3, 2021
1 parent ffb351a commit aad02f1
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,55 @@ How often a vibration repeats.

</docgen-api>


## Haptics Plugin Config

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

Haptics can be configured with this options:

| Prop | Type | Description | Default | Since |
| -------------- | ------------------------------- | ----------------------- | ------------------- | ----- |
| **`style`** | <code>'none' \| 'native'</code> | Configure the style. | <code>native</code> | 1.0.0 |
| **`duration`** | <code>number</code> | Configure the duration. | | 1.2.3 |

### Examples

In `capacitor.config.json`:

```json
{
"plugins": {
"Haptics": {
"style": undefined,
"duration": undefined
}
}
}
```

In `capacitor.config.ts`:

```ts
/// <reference types="@capacitor/haptics" />

import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
plugins: {
Haptics: {
style: undefined,
duration: undefined,
},
},
};

export = config;
```

</docgen-config>

## Commit Your Readme 🚀

The benefit of this readme file is that is also acts as the landing
Expand Down
37 changes: 37 additions & 0 deletions src/test/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,5 +409,42 @@
}
]
}
],
"pluginConfigs": [
{
"name": "Haptics",
"slug": "haptics",
"properties": [
{
"name": "style",
"tags": [
{
"text": "1.0.0",
"name": "since"
},
{
"text": "native",
"name": "default"
}
],
"docs": "Configure the style.",
"complexTypes": [],
"type": "'none' | 'native' | undefined"
},
{
"name": "duration",
"tags": [
{
"text": "1.2.3",
"name": "since"
}
],
"docs": "Configure the duration.",
"complexTypes": [],
"type": "number | undefined"
}
],
"docs": "Haptics can be configured with this options:"
}
]
}

0 comments on commit aad02f1

Please sign in to comment.