1
0
Fork 0

chore(markdown): Updated plugin guide for v3

This commit is contained in:
Joost De Cock 2022-10-12 21:52:47 +02:00
parent d7442b9bc4
commit cac698027c
15 changed files with 195 additions and 348 deletions

View file

@ -0,0 +1,25 @@
---
title: Plugin structure
order: 100
---
A FreeSewing plugin is a plain object with the following structure:
```mjs
Object plugin = {
String name,
String version,
Object hooks,
Object macros,
Array store,
}
```
A plugin **must** have the `name` and `version` properties.
The other properties are optional, and they map to the three different functionalities macros can provide:
- `hooks`: Holds an object with lifecycle hooks the plugin wants to hook into
- `macros`: Holds and object with macros the plugin provides
- `store`: Holds and Array with store methods the plugin provides.
Click on the links above for more details on the structure of these properties.