Skip to content

Commit aad02f1

Browse files
committed
test: add plugin configs output test
1 parent ffb351a commit aad02f1

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

src/test/README.md

+49
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,55 @@ How often a vibration repeats.
207207

208208
</docgen-api>
209209

210+
211+
## Haptics Plugin Config
212+
213+
<docgen-config>
214+
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
215+
216+
Haptics can be configured with this options:
217+
218+
| Prop | Type | Description | Default | Since |
219+
| -------------- | ------------------------------- | ----------------------- | ------------------- | ----- |
220+
| **`style`** | <code>'none' \| 'native'</code> | Configure the style. | <code>native</code> | 1.0.0 |
221+
| **`duration`** | <code>number</code> | Configure the duration. | | 1.2.3 |
222+
223+
### Examples
224+
225+
In `capacitor.config.json`:
226+
227+
```json
228+
{
229+
"plugins": {
230+
"Haptics": {
231+
"style": undefined,
232+
"duration": undefined
233+
}
234+
}
235+
}
236+
```
237+
238+
In `capacitor.config.ts`:
239+
240+
```ts
241+
/// <reference types="@capacitor/haptics" />
242+
243+
import { CapacitorConfig } from '@capacitor/cli';
244+
245+
const config: CapacitorConfig = {
246+
plugins: {
247+
Haptics: {
248+
style: undefined,
249+
duration: undefined,
250+
},
251+
},
252+
};
253+
254+
export = config;
255+
```
256+
257+
</docgen-config>
258+
210259
## Commit Your Readme 🚀
211260

212261
The benefit of this readme file is that is also acts as the landing

src/test/docs.json

+37
Original file line numberDiff line numberDiff line change
@@ -409,5 +409,42 @@
409409
}
410410
]
411411
}
412+
],
413+
"pluginConfigs": [
414+
{
415+
"name": "Haptics",
416+
"slug": "haptics",
417+
"properties": [
418+
{
419+
"name": "style",
420+
"tags": [
421+
{
422+
"text": "1.0.0",
423+
"name": "since"
424+
},
425+
{
426+
"text": "native",
427+
"name": "default"
428+
}
429+
],
430+
"docs": "Configure the style.",
431+
"complexTypes": [],
432+
"type": "'none' | 'native' | undefined"
433+
},
434+
{
435+
"name": "duration",
436+
"tags": [
437+
{
438+
"text": "1.2.3",
439+
"name": "since"
440+
}
441+
],
442+
"docs": "Configure the duration.",
443+
"complexTypes": [],
444+
"type": "number | undefined"
445+
}
446+
],
447+
"docs": "Haptics can be configured with this options:"
448+
}
412449
]
413450
}

0 commit comments

Comments
 (0)