0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-09 00:10:12 -05:00
penpot-plugins/docs/create-api.md
2024-02-28 08:59:25 +01:00

16 lines
354 B
Markdown

Add your API in `libs/plugins-runtime/src/lib/api/index.ts`.
Try to use `zod` to validate the input an output, for example:
```ts
{
sum: z.function()
.args(z.number(), z.number())
.returns(z.number())
.implement((callback, time) => {
setTimeout(callback, time);
});
}
```
Update `/libs/plugins-runtime/src/lib/api/index.d.ts`.