chore(markdown): Updated plugin guide for v3
This commit is contained in:
parent
d7442b9bc4
commit
cac698027c
15 changed files with 195 additions and 348 deletions
25
markdown/dev/guides/plugins/structure/en.md
Normal file
25
markdown/dev/guides/plugins/structure/en.md
Normal 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.
|
Loading…
Add table
Add a link
Reference in a new issue